Unity 2019 3.x 命令行 Xcode導(dǎo)出ipa失敗
打包腳本
Xcodebuild -archivePath /build/Abyss\
-project Unity-iPhone.xcodeproj\
-configuration Release\
-scheme Unity-iPhone\
archive\
-sdk iphoneos\
PROVISIONING_PROFILE_SPECIFIER ="your_profile" \
PRODUCT_BUNDLE_IDENTIFIER="your_buind_id”\
CODE_SIGN_IDENTITY="iPhone Developer: you (num)”
Xcodebuild -exportArchieve xxx
失敗提示
xcodebuild[71566:23315429] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/v7/cgfph0sx3bs3l9hvpmhcwgkm0000gn/T/Unity-iPhone_2020-03-27_10-46-05.911.xcdistributionlogs'.
error: exportArchive: UnityFramework.framework does not support provisioning profiles.
Error Domain=IDEProvisioningErrorDomain Code=10 "UnityFramework.framework does not support provisioning profiles." UserInfo={NSLocalizedDescription=UnityFramework.framework does not support provisioning profiles., NSLocalizedRecoverySuggestion=UnityFramework.framework does not support provisioning profiles, but provisioning profile rel_com_seasun_game_abyss has been manually specified. Remove this item from the "provisioningProfiles" dictionary in your Export Options property list.}
失敗原因:
問題出在:PROVISIONING_PROFILE_SPECIFIER 這里,新版的Xcode項(xiàng)目,導(dǎo)出來會有兩個(gè)target, 如圖:
當(dāng)指定 PROVISIONING_PROFILE_SPECIFIER 的時(shí)候,也順帶把unityFramework給指定了,一旦簽名指定,就會使得原來的文件導(dǎo)不出包。
修復(fù)方式:
- 用sed來修改項(xiàng)目配置
cd Unity-iPhone.xcodeproj
sed -i '' 's/PRODUCT_BUNDLE_IDENTIFIER = "com.${PRODUCT_NAME:rfc1123identifier}";/PRODUCT_BUNDLE_IDENTIFIER = "your_bundle_id";/' project.pbxproj
sed -i '' 's/CODE_SIGN_STYLE = Automatic;/CODE_SIGN_STYLE = Manual;/' project.pbxproj
sed -i '' 's/DEVELOPMENT_TEAM = "";/DEVELOPMENT_TEAM =your_team_num;/' project.pbxproj
sed -i '' 's/PROVISIONING_PROFILE_SPECIFIER = "$(PROVISIONING_PROFILE_SPECIFIER_APP)";/PROVISIONING_PROFILE_SPECIFIER = "your_profile";/' project.pbxproj
- 修改打包腳本
Xcodebuild -archivePath /build/Abyss\
-project Unity-iPhone.xcodeproj\
-configuration Release\
-scheme Unity-iPhone\
archive\
-sdk iphoneos
PRODUCT_BUNDLE_IDENTIFIER="your_buind_id”\
CODE_SIGN_IDENTITY="iPhone Developer: you (num)”
還有一個(gè)原因:
UnityFramework的bundleid 和 Unity-iPhone的 bundleid 一致或者為空,就會出現(xiàn),
解決方法是
隨便填個(gè)bundleid在unityFramwork的target上。