前言
將mac打包機(jī)升級到xcode15后出現(xiàn)一系列莫名其妙的錯誤,特記錄下
一、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里的teamID與bundleId對應(yīng)的賬號是否一致,我一開始不一致導(dǎo)致很久才檢查到這個問題

2、在xcodebuild -exportArchive增加參數(shù)-allowProvisioningUpdates,可以及時更新描述文件,demo如下
### Export ipa #####
xcodebuild -exportArchive \
-archivePath "xxxx" \
-exportPath "xxxx" \
-exportOptionsPlist "xxxx" \
-allowProvisioningUpdates
還遇到另一個離奇的問題,在使用xcode14打包時,ExportOptions.plist配置的只有一套,method都是development,打出來的包apns推送功能都很正常,但是使用xcode15打出來的包推送時一直報BadDeviceToken, 后來反復(fù)比對,發(fā)現(xiàn)手動archive并選擇adhoc的包推送是正常的,但是使用腳本xcode exportArchive導(dǎo)出的包推送就會報錯,然后檢查發(fā)現(xiàn)是ExportOptions.plist的method與手動不一致,也需要按adhoc來處理,這個具體應(yīng)該是adhoc還是development,根據(jù)推送的需要來定,但是奇怪的是xcode14沒有這個問題

