1.打开终端,确保Xcode Command Line Tools
安装了最新版api
xcode-select --install |
2.安装fastlanexcode
sudo gem install -n /usr/local/bin fastlaneruby |
查看源 gem sources -l 卡住不动,可能Ruby的源被墙了,服务器
移除源 gem source -r https://rubygems.org/ (刚才查看到的源)
app
添加源 gem source -a https://gems.ruby-china.comide
备注:https://gems.ruby-china.org 域名改了要用.com 网站
3.CD到工程目录初始化spa
fastlane init |
初始化的过程当中会出现下面的选项:插件
What would you like to use fastlane for?code
1. Automate screenshots
2. Automate beta distribution to TestFlight
3. Automate App Store distribution
4. Manual setup - manually setup your project to automate your tasks
第一个:截图
第二个:发布到TestFlight
第三个:发布到App Store
第四个:手动设置
咱们选择4,enter
安装成功会在工程根目录下生成fastlane文件, 包含Appfile和Fastfile配置文件
4.配置Appfile
app_identifier 包名
apple_id 苹果开发者帐号
5.配置Fastfile
DemoTest为工程名称
若是工程用了CocoaPods,切记须要配置workspace这个参数,没有用的话,去掉workspace这行便可
firim_api_token: '***************'
firim_api_token 你在firim网站登陆后,点击头像,能够查看API token。复制到这地方
备注:若是是蒲公英平台,将firim这行替换为如下蒲公英的配置便可。 pgyer(api_key: "************", user_key: "***********")
其中的 api_key
和 user_key
,请开发者在本身帐号下的 应用管理
- App概述
- API
中能够找到,并替换到以上相应的位置。
desc下面的lane后面的 archive 这个方法名能够自由配置,一会发布到firim须要调用此方法。
desc "ipa打包" lane :archive do |
释义:
6.安装fir插件
fastlane add_plugin firim |
备注:若是是蒲公英平台须要输入 fastlane add_plugin pgyer
7.发布到firim
fastlane archive |
命令执行完成后, 能够在Fastfile文件output_directory参数配置的目录下找到自动生成的ipa文件,和dYSM的压缩包(若是configuration配置的是Debug,就不会有dYSM的压缩包)