美文网首页
Xcode15 archive及apns推送BadDeviceT

Xcode15 archive及apns推送BadDeviceT

作者: 独孤流 | 来源:发表于2023-12-20 00:24 被阅读0次

前言

将mac打包机升级到xcode15后出现一系列莫名其妙的错误,特记录下

一、archive失败

"Provisioning profile "iOS Team Provisioning Profile" doesn't include the currently selected device "xxx's Macmini"
解决方案,在xcodebuild arhive里增加-destination 'generic/platform=iOS',
参考 Apple M1芯片 自动打包问题解决方案 Xcode 12 iOS 打包失败
demo如下:

#### Archive ######
xcodebuild archive -workspace "xxxx" \
-scheme "xxxx" \
-configuration "Release" \
-archivePath "xxxx" -destination 'generic/platform=iOS'

二、xcodebuild -exportArchive失败一直报

No profiles for 'xx.xxx.xxx' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'xx.xxx.xxx'. (in target 'xxxx' from project 'xxxxx') ** BUILD FAILED **

解决方案:
1、检查ExportOptions.plist里的teamIDbundleId对应的账号是否一致,我一开始不一致导致很久才检查到这个问题

image.png

2、在xcodebuild -exportArchive增加参数-allowProvisioningUpdates,可以及时更新描述文件,demo如下

### Export ipa #####
xcodebuild -exportArchive \
-archivePath "xxxx" \
-exportPath "xxxx" \
-exportOptionsPlist "xxxx" \
-allowProvisioningUpdates

还遇到另一个离奇的问题,在使用xcode14打包时,ExportOptions.plist配置的只有一套,method都是development,打出来的包apns推送功能都很正常,但是使用xcode15打出来的包推送时一直报BadDeviceToken, 后来反复比对,发现手动archive并选择adhoc的包推送是正常的,但是使用脚本xcode exportArchive导出的包推送就会报错,然后检查发现是ExportOptions.plistmethod与手动不一致,也需要按adhoc来处理,这个具体应该是adhoc还是development,根据推送的需要来定,但是奇怪的是xcode14没有这个问题

image.png image.png

相关文章

网友评论

      本文标题:Xcode15 archive及apns推送BadDeviceT

      本文链接:https://www.haomeiwen.com/subject/ptjtndtx.html