1 Archive打包ipa
打包ipa准备
首先,工程scheme必须选择iOS Device(真机)或者Build(Any iOS Device(arm64, armv7)),而不能选择iOS Simulators(模拟器),否则Archive按钮一直为灰色不可点击。-
启动打包发布流程
菜单栏Xcode--Product--Archive,然后等编译完成会弹出如下框:
提示:如果之前有启动过该流程,则通过菜单栏Xcode--Window-- Organizer,也会弹出上面的框。
-
点击“Distribute App”,进入打包发布流程
说明:
(1)App Store Connect:发布到Apple Store(具体见下面2)
(2)在账号添加的设备上使用(可以托管到第三方平台,比如蒲公英)
(3)企业账号分发
(4)在账号添加的设备上使用(一般本地使用时用这个)
“在账号添加的设备上使用”:
这个需要登录苹果开发者账号,然后在设备下注册设备的UUID(UDID)。
注册UUID流程:
(1)通过真机调试时使用Xcode来register device,这个过程是自动的(工程运行时Xcode会自动弹出注册弹框)。
(2)在开发者账号下进入Certificates, Identifiers & Profiles devices,然后找到设备列表再添加新的设备,需要提供手机的名称以及设备号(Device ID, UDID)。-
获取iPhone手机UUID(UDID)
(1)可以通过手机浏览器打开蒲公英来获取。
1)在Safari浏览器打开如下网址:
https://jingyan.baidu.com/article/a3a3f81127f0e18da2eb8a14.html
2)然后点击绿色的“获取UDID”按钮,会提示下载一个配置描述文件,点“允许”,然后会跳转到设置-描述文件与设备管理,选择 “蒲公英(PGYER)”,点击进入该选项,然后点击右上角“安装”,输入开机密码,在弹出选项对话框中点击“安装”,安装成功会跳转回浏览器
3)这个时候会在上面浏览器输入的网址里显示:设备信息UDID,如图所示:
4)如果上面网址不好复制,可以通过扫描如下二维码:
(2)可以通过iTools的iPhone的更多信息里找到设备标识,即UDID。
注意:如果未注册设备,一定要先注册再打包版本来安装。不然会报错:
无法安装“xxx应用”
无法安装此App,因为无法验证其完整性。
- 打包ipa包
上面“启动打包发布流程”选择第4个“Development”,然后一路Next,最后一步Export导出到文件夹,就生成ipa了。
2 Archive上架Apple Store
上架准备
上面“启动打包发布流程”选择第1个“App Store Connect”,然后一路Next,最后一步选择“Upload”上传到App Store Connect。-
上架App Store Store
浏览器进入App Store Connect:
点击“iOS App“右侧的”+“号按钮,进入信息填写页面:
注意:新上传的APP版本,首先会在TestFlight下做准备,等TestFlight下准备好了之后,iOS APP审核页面,就可以选择“构建版本”,选择TestFlight里准备好的APP版本了。
填好APP和版本信息之后,再存储,最后点击审核按钮,等审核完就成功上架了。
3 Archive上架Apple Store遇到的问题
- Archive上传问题
App Store Connect Operation Error
could not find the service with interface (com.apple.transporter.osgi.TransporterService)
App Store Connect Operation Error
Resolver: Install error - org.apache.tika.parsers Exception's name: org.osgi.framework.BundleException, Exception's message: An error occurred trying to read the bundle
说明:本地Archive上传APP版本时遇到该问题,在查找资料(见后面参考)会看到有其他的原因。但本地是磁盘容量不足导致的(上面日志显示下载失败),原因是在上传文件时会下载一些文件在如下缓存目录中:
/Users/hh/Library/Caches/com.apple.amp.itmstransporter
- 如上,清理完磁盘,然后上传成功,但警告提示:
App Store Connect Operation Warning
WARNING ITMS-90901: "Missing full-screen support for the latest iPad mini display. The “ios-demo-app.app” bundle includes UIRequiresFullScreen=YES in the Info.plist or supports only a subset of UISupportedInterfaceOrientations, and is built with the 14.2 SDK. To take advantage of the full screen size, recompile with Xcode 13 and the SDK for iPadOS 15 or later."
说明:需要升级xocde,比如从12.x到13.x。
- 升级xocde(从12.x到13.x)后,重新发布APP,报错:
App Store Connect Operation Error
The bundle version, 40132, must be a higher than the previously uploaded version.
说明:原因是前面有版本上传成功,但该版本不符合发布要求,不可发布。但它占用了一个版本号,所以下一次上传时版本号(即versionName和versionCode)需要增大才可以。
Redundant Binary Upload. You've already uploaded a build with build number '40132' for version number '4.1.32'. Make sure you increment the build string before you upload your app to App Store Connect. Learn more in Xcode Help (http://help.apple.com/xcode/mac/current/#/devba7f53ad4).
说明:原因同上。
- 切图icon问题
App Store Connect Operation Error
ERROR ITMS-90717 Invalid App Store Icon. The App Store Icon in the asset catalog in 'app-demo-ios.app' can't be transparent nor contain an alpha channel.
Invalid App Store Icon. The App Store Icon in the asset catalog in 'app-demo-ios.app' can't be transparent nor contain an alpha channel. With error code STATE_ERROR.VALIDATION_ERROR.90717 for id 63645428-e97d-4005-bb75-e68c5948d5cc
原因:图片(即切图icon,包括启动图标和应用商店展示图标)需要去掉透明度
- iPad选项问题:
App Store Connect Operation Error
ERROR ITMS-90101: "This bundle does not support one or more of the devices supported by the previous app version. Your app update must continue to support all devices previously supported. You declare supported devices in Xcode with the Targeted Device Family build setting. Refer to QA1623 for additional information: https://developer.apple.com/library/ios/#qa/qa1623/_index.html"
原因:去掉iPad选项导致的问题。同时修改如下配置(去掉iPad)
"@platforms":["android","iPhone","iPad"]
- 针对文件类型问题:
App Store Connect Operation Error
This bundle is invalid. The value of the CFBundleDocumentTypes key in the Info.plist must be an array of dictionaries, with each dictionary containing at least the CFBundleTypeName key. With error code STATE_ERROR.VALIDATION_ERROR.90149 for id cb33160b-cf26-4475-b7f2-92034c067567
或
App Store Connect Operation Warning
WARNING ITMS-90737: "Missing Document Configuration. By declaring the CFBundleDocumentTypes key in your app, you've indicated that your app is able to open documents. Please set the UISupportsDocumentBrowser key to "YES" if your app uses a UIDocumentBrowserViewController. Otherwise, set the LSSupportsOpeningDocumentsInPlace key in the Info.plist to "YES" (recommended) or "NO" to specify whether the app can open files in place. All document-based apps must include one of these configurations. For more information, visit https://developer.apple.com/document-based-apps/."
"
处理:工程Info.plist文件配置Document Types节点。
- MackBook M2电脑兼容问题
(1)uploading时遇到authenticating with the app store:
uploading authenticating with the app store
这里直接在终端输入命令:
/Applications/Xcode.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/Versions/A/itms/bin/iTMSTransporter
需要等待一会(参考网上资料会下载大概60M-80M的文件)。
(2)uploading package to the app store
uploading package to the app store
遇到这种情况,还是需要等待。并不需要做什么,大概是网络慢点缘故,导致上传时间长了点。
- 参考:
//www.greatytc.com/p/22a15814e5a9
//www.greatytc.com/p/9df7d8930a3e
//www.greatytc.com/p/f5c57ce3031b
https://blog.csdn.net/u012439446/article/details/105484077
//www.greatytc.com/p/e222ff751a97
https://jingyan.baidu.com/article/a3a3f81127f0e18da2eb8a14.html
//www.greatytc.com/p/181cf94b90c1
https://blog.csdn.net/sky_long_fly/article/details/103663032
https://www.cnblogs.com/CH520/p/15712255.html
https://stackoverflow.com/questions/9925613/error-cfbundleversion-must-be-higher-than-the-previously-uploaded-version
//www.greatytc.com/p/1afb47e7fdfc
//www.greatytc.com/p/667257ae79c8
//www.greatytc.com/p/6283eff839b6
https://blog.csdn.net/diaochuanzhi7826/article/details/101967298
https://blog.csdn.net/IDOshi201109/article/details/78337836
https://blog.csdn.net/qq_15023917/article/details/100733524
https://blog.csdn.net/wueasy/article/details/107932302
https://blog.csdn.net/xiaoyeziios/article/details/104681112
//www.greatytc.com/p/1c7f4cee252e
//www.greatytc.com/p/17ec17e4b3a1