简体   繁体   中英

How to publish ipa which is produced with xcodebuild build command

I am creating an iOS application and I use xcodebuild build ... to build my project and xcrun -sdk iphoneos PackageApplication ... to create the ipa. When I try to publish the ipa to the App Store i get the following error:

ERROR ITMS-90668: "Invalid Bundle Executable. The executable file 'Project.app/Project' contains incomplete bitcode.

I found that there is a solution for this problem - set Enable Bitcode to No . But this is not what I am looking for because if I create new project to the workspace I need to set this option to No for the new project as well because the default value is Yes .

Is there another solution for this problem?

After some research I found out that when I use xcodebuild build ... and the Enable Bitcode is set to Yes the -fembed-bitcode-marker is added in the OTHER_CFLAGS for the clang. This flag just adds a "bitcode placeholder" instead of the full bitcode. This is done by Apple because the generation of the bitcode could slow down the build. To generate the full bitcode the -fembed-bitcode-marker must be replaced with -fembed-bitcode .

After creating ipa with the full bitcode I was able to publish my application to the App Store.

Another solution to my problem is to use xcodebuild archive ... instead of xcodebuild build ... to build my project and xcodebuild -exportArchive -archivePath <path to the .xcarchive> ... instead of xcrun -sdk iphoneos PackageApplication ... to create my ipa. When using the archive method the -fembed-bitcode-marker is automatically replaced with -fembed-bitcode and my ipa contains binaries with full bitcode.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM