code
.env.iphone
内容:
1 2 3 4 5 6 7 8 9 |
team_id = 'xxx' appleId = 'xxx' keychain_password = 'xxx' scheme_name = 'xxx' xcodeproj_path = 'xxx.xcodeproj' workspace_path = 'xxx.xcworkspace' app_identifier = 'com.xxx.xxx' build_version = '2.1.4' |
fastlane
内容:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# This file contains the fastlane.tools configuration # You can find the documentation at https://docs.fastlane.tools # # For a list of all available actions, check out # # https://docs.fastlane.tools/actions # # Uncomment the line if you want fastlane to automatically update itself # update_fastlane default_platform(:ios) platform :ios do team_id = '' appleId = '' keychain_password = '1' scheme_name = '' xcodeproj_path = '' workspace_path = '' app_identifier = '' build_version = '' before_all do |lane, options| # ENV["SLACK_URL"] = "https://hooks.slack.com/services/..." cocoapods scheme_name = ENV['scheme_name'] xcodeproj_path = ENV['xcodeproj_path'] workspace_path = ENV['workspace_path'] app_identifier = ENV['app_identifier'] build_version = ENV['build_version'] team_id = ENV['team_id'] appleId = ENV['appleId'] keychain_password = ENV['keychain_password'] end lane :adhoc do get_certificates( username: "#{appleId}", keychain_password: "#{keychain_password}", team_id:"#{team_id}", output_path:"./build/conf/cert/" ) get_provisioning_profile( adhoc: true, username: "#{appleId}", app_identifier:"#{app_identifier}", output_path:"./build/conf/sigh/" ) disable_automatic_code_signing( path: "#{xcodeproj_path}" ) build_number = get_info_plist_value(path: "./multi-version-conf/#{scheme_name}/Info.plist", key: "CFBundleVersion").to_i + 1 set_info_plist_value( path: "./multi-version-conf/#{scheme_name}/Info.plist", key: "CFBundleVersion", value: build_number.to_s ) set_info_plist_value( path: "./multi-version-conf/#{scheme_name}/Info.plist", key: "CFBundleShortVersionString", value: build_version ) build_app( workspace: "#{workspace_path}", scheme: "#{scheme_name}", export_team_id:"#{team_id}", export_method:"ad-hoc", output_directory: "./build/output/#{scheme_name}/#{scheme_name}_#{build_number}" ) pgyer(api_key: "xxx", user_key: "xxx") end desc "Push a new release build to the App Store" lane :release do get_certificates( development: false, username: "#{appleId}", keychain_password: "#{keychain_password}", team_id:"#{team_id}", output_path:"./build/conf/cert/" ) get_provisioning_profile( development: false, username: "#{appleId}", app_identifier:"#{app_identifier}", output_path:"./build/conf/sigh/" ) disable_automatic_code_signing( path: "#{xcodeproj_path}" ) build_number = get_info_plist_value(path: "./multi-version-conf/#{scheme_name}/Info.plist", key: "CFBundleVersion").to_i + 1 set_info_plist_value( path: "./multi-version-conf/#{scheme_name}/Info.plist", key: "CFBundleVersion", value: build_number.to_s ) build_app( workspace: "#{workspace_path}", scheme: "#{scheme_name}", export_team_id:"#{team_id}", output_directory: "./build/output/#{scheme_name}/#{scheme_name}_#{build_number}" ) deliver( force: false, submit_for_review: false, username:"#{appleId}", app_identifier:"#{app_identifier}", skip_metadata: true, skip_screenshots: true ) pgyer(api_key: "xxx", user_key: "xxx") end end |
iOS Action
iOS adhoc
1 2 |
fastlane ios adhoc --env iphone |
iOS release
1 2 |
fastlane ios release --env iphone |