安裝 fastlane
這里使用Rubygems 方式安裝fastlane。(MacOS or Linux with ruby 2.0.0 or above)
sudo gem install fastlane
設(shè)置fastlane
用Terminal進入你的項目目錄硕淑,然后執(zhí)行
fastlane init
然后會詢問你的Apple ID侦锯,根據(jù)提供的信息鹦付,生成fastlane的配置文件
使用fastlane測試部署
構(gòu)建你的應(yīng)用
編輯fastfile:
lane :beta do
gym(scheme: "MyApp",
workspace: "MyApp.xcworkspace",
include_bitcode: true)
end
測試運行我們定制的 lane(任務(wù)):
fastlane beta
如果順利執(zhí)行的話,你將會在當(dāng)前文件目錄看到一個 MyApp.ipa 文件和對應(yīng) MyApp.app.dSYM 文件
上傳應(yīng)用
lane :beta do
match(type: "appstore") # see code signing guide for more information
gym(scheme: "MyApp",
workspace: "MyApp.xcworkspace",
include_bitcode: true) # build your app
testflight # upload your app to TestFlight
end
或者再配置下上傳至TestFlight的過程:
lane :beta do
match(type: "appstore")
gym(scheme: "MyApp",
workspace: "MyApp.xcworkspace",
include_bitcode: true)
# Variant 1: Provide a changelog to your build
testflight(changelog: "Add rocket emoji")
# Variant 2: Skip the "Waiting for processing" of the binary
# While this will speed up your build, it will not distribute
# the binary to your tests, nor set a changelog
testflight(skip_waiting_for_build_processing: true)
end
使用fastlane部署至Apple Store
編輯Fastfile:
lane :appstore do
snapshot
#gym(scheme: "MyApp")
gym(scheme: "MyApp",
workspace: "MyApp.xcworkspace",
include_bitcode: true)
appstore
end
執(zhí)行:
fastlane appstore