安裝 fastlane
fastlane tools 使用說明
brew cask install fastlane
或者
sudo gem install fastlane -NV
但是上面兩種安裝方法,都沒有安裝其他附屬的tools 比如(produce,deliver等)
第三種方法是直接手動下載解壓到本地,然后雙擊install script,同時包含uninstall script
卸載
- sudo gem uninstall fastlane
- rm -rf ~/.frameit
APP 信息
如果不手動配置,
fastlane init
的時候會自動幫你初始化, 比如SKU(App的專有ID,一旦創建就不能修改了)
你也可以通過 produce 自己配置,詳細命令可以查看produce
參考如下:
produce create -u 用戶名 -a Bundle_ID -q 'App_name' --sku 'sku嗎' -z '版本號' -m '支持語言' -d
插件 plugins
fastlane 支持很多插件,比如我使用的 firim,
fastlane add_plugin firim
這一步如果報錯了,接著執行bundle install
,后期就可以使用gem管理fastlane
Tools使用說明actions
也可以在終端使用命令
fastlane action [action_name]
比如查看gymfastlane action gym
fastlane list
查看 available lanes
使用match自動創建打包證書和profile文件
fastlane match init
創建Matchfile
文件 , init的時候會讓你輸入一個存儲證書
和profile文件的git地址,然后會在Matchfile
里面生成配置信息
例如
git_url "git地址"
type "appstore" # The default type, can be: appstore, adhoc, enterprise or development
app_identifier ["你的bundleID"]
username "登錄iTunes賬號" # Your Apple Developer Portal username
match 還有個nuke的方法 fastlane match nuke development
,刪除develop環境下的證書和profile,同時刪除了對應的git地址上的證書和profile,如果是distribution環境使用fastlane match nuke distribution
,刪除證書不會影響AppStore上的應用,不過TestFlight上面的會受到影響,可以從新打包上傳
配置一下Matchfile
文件,執行fastlane match
會從新生成證書和profile文件
更多match的使用方法可以參考 match doc
git
fastlane支持git操作,可以先執行git_pull操作,然后gym打包,具體參考source-control
Deliver
- deliver 可以配置適合人群(Available age rating groups)
- 支持的語言(Available Languages)
- submit_for_review 判斷當上傳metadata/binary后,是否自動submit review ,如果為true,則需要配置下一步的信息
- submission_information配置是否使用idfa那坨東西
更多
更高級的用法請參考advance
參考配置
lane :debug do
build_no = get_version_number + '.' + Time.new.strftime("%m%d%H%M")
increment_build_number(build_number: build_no)
match(type: "development")
gym(scheme: "xxx",
workspace: "xxx.xcworkspace",
output_directory: "./build/",
clean: true,
configuration: "Debug",
output_name: "xxx") # Build your app - more options available
firim(firim_api_token: "fir token")
sh ".././sendmail.sh" # 發送郵件的腳本
end
參考文章
https://fastlane.tools/
https://github.com/fastlane/fastlane