ruby -v
xcode-select --install
$ sudo gem install fastlane
$ cd to/your/ios/project $ fastlane init [14:21:43]: Detected iOS/Mac project in current directory... [14:21:43]: This setup will help you get up and running in no time. [14:21:43]: fastlane will check what tools you're already using and set up [14:21:43]: the tool automatically for you. Have fun! [14:21:43]: Created new folder './fastlane'. [14:21:43]: $ xcodebuild -showBuildSettings -project ./xxx.xcodeproj [14:21:48]: Your Apple ID (e.g. fastlane@krausefx.com): xxx@xxx.xom [14:21:54]: Verifying that app is available on the Apple Developer Portal and iTunes Connect... [14:21:54]: Starting login with user 'xxx@xxx.com' +----------------+--------------------------------------+ | Detected Values | +----------------+--------------------------------------+ | Apple ID | xxx@xxx.com | | App Name | xxx | | App Identifier | com.xxx.xxx | | Project | /Users/lisong/Desktop/xxx/x | | | xx.xcodeproj | +----------------+--------------------------------------+ [14:22:06]: Please confirm the above values (y/n) y [14:22:09]: Created new file './fastlane/Appfile'. Edit it to manage your preferred app metadata information. [14:22:09]: Loading up 'deliver', this might take a few seconds [14:22:09]: Login to iTunes Connect (xxx@xxx.com) [14:22:13]: Login successful +-----------------------+------------------------+ | deliver 2.30.1 Summary | +-----------------------+------------------------+ | screenshots_path | ./fastlane/screenshots | | metadata_path | ./fastlane/metadata | | username | xxx@xxx.com | | app_identifier | com.xxx.xxx | | edit_live | false | | platform | ios | | skip_binary_upload | false | | skip_screenshots | false | | skip_metadata | false | | force | false | | submit_for_review | false | | automatic_release | false | | dev_portal_team_id | WKR87TTKML | | overwrite_screenshots | false | +-----------------------+------------------------+ [14:22:21]: Writing to 'fastlane/metadata/zh-Hans/description.txt' ... [14:22:21]: Writing to 'fastlane/metadata/review_information/notes.txt' [14:22:21]: Successfully created new configuration files. [14:22:22]: Successfully downloaded large app icon [14:22:22]: Downloading all existing screenshots... [14:22:27]: Downloading existing screenshot '1_iphone4_1.1.jpg' for language 'zh-Hans' ··· [14:22:34]: Downloading existing screenshot '5_iphone6_5.5.jpg' for language 'zh-Hans' [14:22:34]: Successfully downloaded all existing screenshots [14:22:34]: Successfully created new Deliverfile at path 'fastlane/Deliverfile' [14:22:34]: $ xcodebuild -list -project ./xxx.xcodeproj [14:22:35]: 'snapshot' not enabled. [14:22:35]: 'cocoapods' enabled. [14:22:35]: 'carthage' not enabled. [14:22:35]: Created new file './fastlane/Fastfile'. Edit it to manage your own deployment lanes. [14:22:35]: fastlane will collect the number of errors for each action to detect integration issues [14:22:35]: No sensitive/private information will be uploaded [14:22:35]: Learn more at https://github.com/fastlane/fastlane#metrics [14:22:35]: Successfully finished setting up fastlane
app_identifier "com.xxx.xxx" # app的bundle identifier apple_id "xxx@xxx.com" # 你的Apple ID team_id "XXXXXXXXXX" # Team ID
app_identifier "com.aaa.aaa" apple_id "aaa@aaa.com" team_id "AAAAAAAAAA" for_lane :inhouse do app_identifier "com.bbb.bbb" apple_id "bbb@bbb.com" team_id "AAAAAAAAAA" end
··· # 自动更新fastlane 工具 # update_fastlane #需要的fastlane的最小版本,在每次执行之后会检查是否有新版本,如果有会在最后末尾追加新版本提醒 fastlane_version "2.30.1" #默认使用平台是 ios,也就是说文件可以定义多个平台 default_platform :ios platform :ios do before_all do # ENV["SLACK_URL"] = "https://hooks.slack.com/services/..." cocoapods end desc "Runs all the tests" lane :test do scan end desc "提交一个新的Beta版本到 Apple TestFlight" desc "This will also make sure the profile is up to date" lane :beta do # match(type: "appstore") # more information: https://codesigning.guide gym(scheme: "Docment") # Build your app - more options available pilot # sh "your_script.sh" end desc "部署一个新版本到App Store" lane :release do # match(type: "appstore") # snapshot gym(scheme: "Docment") # Build your app - more options available deliver(force: true) # frameit end # 你可以定义自己的lane #执行lane成功后的回调 after_all do |lane| # slack( # message: "Successfully deployed new App Update." # ) end # 如果流程发生异常会走这里并终止 error do |lane, exception| # slack( # message: exception.message, # success: false # ) end end 我们也可以定义一个自己的lane: desc "企业版" lane :inHouse do gym(scheme: "XXX", export_method:"enterprise", output_directory "./build", # 打包后的 ipa 文件存放的目录 output_name "XXX" # ipa 文件名 ) end
default_platform :ios platform :ios do lane :prepare do cocoapods match end desc 'fastlane build' 'fastlane build type:adhoc' lane :build do |options| # 调用上面的 prepare 任务 prepare case options[:type] when 'adhoc' adhoc else appstore end end lane : adhoc do ··· end lane : appstore do ··· end end
def prepare_version(options)
increment_version_number(
version_number: options[:version]
)
increment_build_number(
build_number: options[:build]
)
end
lane :appstore do |options| ··· prepare_version(options) ··· end
$ fastlane appstore version:2.4.0 build:2.0
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有