通过一些基础知识可以知道pilot是专门管理testflight打包审核的,但在百度搜索”pilot fastlane“搜不到完整命令如何写的。
所以在这篇进行一个中间人跳转。
https://www.jianshu.com/p/eafa2fa37c1b 《 iOS项目的 fastlane / jenkins 实践》这篇博客里有fastlane上传testflight并提交beta审核的命令。
补充一下文章里面的代码,
自定义文件位置 lane :build_appstore下面添加
output_directory: './testflight',
output_name: 'TestDemo.ipa'
然后 lane :upload_testflight下面的
ipa: "XXX" 改为 ipa: "testflight/TestDemo.ipa"
上传失败的经历:
0.要给终端完全磁盘权限,部分文件夹也需要chmod 777
1.工程的证书配置是测试的,手动设置,fastlane里面是生产的。导致上传失败。
2.fastlane里面没设置版本号,导致在工程里面改了版本号也会被fastlane变成1
3.上传testflight,要把忽略截图写上
4.双重认证设置
5.beta_app_review_info。
value must be a Hash! Found String instead. 去掉这个字段
6.false不要拼错
7
Could not set beta_app_feedback_email and/or beta_app_description: Server error got 504
8.家里的长城宽带,传8次7次503,504。
在公司联通LTE网,不行,等不了200k
在家里联通LTE网慢点,但没报错。
在家里电信4G网快,但经常报错,443或者读取ipa错误。
9.FASTLANE_XCODEBUILD_SETTINGS_RETRIES 设置大点 经常报超时
10.[Transporter Error Output]: An exception has occurred: Broken pipe (Write failed)
最终我完善后的fastlane命令是,可以提交testflight审核,提测,通知测试人员
# -------------- testflight -------------- #
desc "Build and upload a PROD app to TestFlight"
lane :release_testflight do
build_appstore
upload_testflight
end
lane :build_appstore do
increment_build_number_in_plist(
target: '~~~~~',
build_number: '1.0.4.444444'
)
increment_version_number_in_plist(
target: '~~~~~~~',
version_number: '1.0.3'
)
gym(
configuration: "Release",
scheme: "~~~~~~~",
clean: true,
include_bitcode: true,
include_symbols: true,
export_method: 'app-store',
export_xcargs: "-allowProvisioningUpdates",
output_directory: './testflightNew',
output_name: 'TestDemo.ipa'
)
end
lane :upload_testflight do
upload_to_testflight(
beta_app_review_info: {
contact_email: "111@qq.com",
contact_first_name: "ww",
contact_last_name: "分",
contact_phone: "123",
demo_account_name: "123",
demo_account_password: "111",
notes: "适用于fastlane自动打包上传提审等操作 thank you for reviewing"
},
localized_build_info: {
"default": {
whats_new: "适用于fastlane自动打包上传提审等操作",
},
"en-GB": {
whats_new: "适用于fastlane自动打包上传提审等操作",
}
},
# true就不自动提审了
skip_waiting_for_build_processing: false,
skip_submission:false,
username: "123@qq.com",
app_identifier: "com.123",
beta_app_feedback_email:"123@qq.com",
beta_app_description:"适用于fastlane自动打包上传提审等操作",
demo_account_required: true,
#构建是否应该分发给外部测试人员?
distribute_external: true,
notify_external_testers: true,
groups:"122222",
changelog:"适用于fastlane自动打包上传提审等操作",
beta_app_feedback_email:"22222@qq.com",
ipa: "testflightNew/TestDemo.ipa"
)
end
# -------------- testflight -------------- #
在官网有这些字段的介绍
https://docs.fastlane.tools/actions/testflight/
Key
Description
Default
username
Your Apple ID Username
*
app_identifier
The bundle identifier of the app to upload or manage testers (optional)
*
app_platform
The platform to use (optional)
ios
apple_id
Apple ID property in the App Information section in App Store Connect
*
ipa
Path to the ipa file to upload
*
demo_account_required
Do you need a demo account when Apple does review?
false
beta_app_review_info
Beta app review information for contact info and demo account
localized_app_info
Localized beta app test info for description, feedback email, marketing url, and privacy policy
beta_app_description
Provide the 'Beta App Description' when uploading a new build
beta_app_feedback_email
Provide the beta app email when uploading a new build
localized_build_info
Localized beta app test info for what's new
changelog
Provide the 'What to Test' text when uploading a new build. skip_waiting_for_build_processing: false
is required to set the changelog
skip_submission
Skip the distributing action of pilot and only upload the ipa file
false
skip_waiting_for_build_processing
If set to true, the distribute_external
option won't work and no build will be distributed to testers. (You might want to use this option if you are using this action on CI and have to pay for 'minutes used' on your CI plan). If set to true
and a changelog is provided, it will partially wait for the build to appear on AppStore Connect so the changelog can be set, and skip the remaining processing steps
false
update_build_info_on_upload
DEPRECATED! Update build info immediately after validation. This is deprecated and will be removed in a future release. App Store Connect no longer supports setting build info until after build processing has completed, which is when build info is updated by default
false
uses_non_exempt_encryption
Provide the 'Uses Non-Exempt Encryption' for export compliance. This is used if there is 'ITSAppUsesNonExemptEncryption' is not set in the Info.plist
false
distribute_external
Should the build be distributed to external testers?
false
notify_external_testers
Should notify external testers?
true
first_name
The tester's first name
last_name
The tester's last name
email
The tester's email
testers_file_path
Path to a CSV file of testers
./testers.csv
groups
Associate tester to one group or more by group name / group id. E.g. -g "Team 1","Team 2"
team_id
The ID of your App Store Connect team if you're in multiple teams
*
team_name
The name of your App Store Connect team if you're in multiple teams
*
dev_portal_team_id
The short ID of your team in the developer portal, if you're in multiple teams. Different from your iTC team ID!
*
itc_provider
The provider short name to be used with the iTMSTransporter to identify your team. This value will override the automatically detected provider short name. To get provider short name run pathToXcode.app/Contents/Applications/Application\ Loader.app/Contents/itms/bin/iTMSTransporter -m provider -u 'USERNAME' -p 'PASSWORD' -account_type itunes_connect -v off
. The short names of providers should be listed in the second column
wait_processing_interval
Interval in seconds to wait for App Store Connect processing
30
wait_for_uploaded_build
DEPRECATED! No longer needed with the transition over to the App Store Connect API - Use version info from uploaded ipa file to determine what build to use for distribution. If set to false, latest processing or any latest build will be used
false
reject_build_waiting_for_review
Expire previous if it's 'waiting for review'
false
作者:_小呵呵