缘由
Xcode更新11之后,不再包含Application Loader
。听说为了更好的支持ipadOS、macOS、iOS统一管理,推荐使用xcodebuild
或 xcrun altool
从Organizer
或命令行上传应用程序。详情见Xcode更新日志(29008875)说明。
本人在更新Xcode11之后使用Organizer
上传应用一直出现失败,于是改用xcrun altool
进行验证和上传应用,用了之后发现 ~真香。。。
如何使用xcrun altool
废话不多说,xcrun altool
之前可以使用开发者账号和密码进行-登录-验证-上传。但听说不行了,现在需要用密钥的方式,用到的2个命令如下:
验证: xcrun altool --validate-app -f xxx.ipa -t ios --apiKey xxx --apiIssuer xxx --verbose
上传: xcrun altool --upload-app -f xxx.ipa -t ios --apiKey xxx --apiIssuer xxx --verbose
2个命令分别对应 验证IPA 和 上传IPA,都需要使用3个参数ipa路径
、apiKey
、apiIssuer
一:路径不用说了,可以使用xcodebuild
打包或用Organizer
Export导出App store包。
二:apiKey
和apiIssuer
需要去开发者官网-用户和访问-密钥-去新增。如下图流程
选择密钥
新增一个密钥,名称和访问者可以自由填写
apiIssuer
,密钥ID就是apiKey
,并且还有一个API密钥可以下载(注意:此秘钥文件只能下载一次,请妥善保存) 三:到这一步先别急执行命令,执行了也会出错,按照xcrun altool
官方文档说明
apiKey. Required for JWT authentication while using validation, upload, and notarization.
This option will search the following directories in sequence for a private key file
with the name of 'AuthKey_.p8': './private_keys', '~/private_keys', '~/.private_keys',and '~/.appstoreconnect/private_keys'.
我们需要把刚才下载好的密钥文件放到这里面的其中一个文件夹里,它会按顺序去查找。我自己是在用户目录下/Users/payne/private_keys
新建了个private_keys文件夹,并把密钥文件放进去的。
四:接下来把参数替换上去,可以尝试进行验证和上传了。
等到提示No errors uploading
时就代表上传成功了,可以去开发者中心-活动里面查看一下是否有构建版本
五:OK,已经有了,到这里就大功告成了。
额外注意,在上传包的时候,我遇到到一种情况。不管是用xcode,还是使用命令xcrun altool上传都会卡主没有反应。因为是高版本xcode 11,已经没有Application Loader了。使用命令
“/Applications/Xcode.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/Versions/A/itms/bin/iTMSTransporter”
也是卡主了。
这时卸载xcode,重新安装,再上传就可以了。。。