I am using xcodebuild
to generate an archive from a workspace. I use the following command:
xcodebuild -workspace MyProject.xcworkspace -scheme "MyProject"
-destination generic/platform=iOS archive
-archivePath "../PathToArchive/MyProject.xcarchive
(I've spaced it out over multiple lines for readability)
This command generates a MyProject.xcarchive
. However it generates a generic "Xcode Archive" rather than an "iOS App Archive." This cannot be submitted to the App Store.
If I archive the exact same workspace and scheme using Xcode.app version 7.0.1 (7A1001) instead of xcodebuild
then I get an "iOS App Archive" which can be submitted to the App Store.
Inspecting the contents of these two xcarchive
s shows the main difference is the bundled Info.plist
file. The one generated by Xcode.app contains an additional ApplicationProperties
dict with versioning and signing details. The one generated by xcodebuild
lacks these details in its Info.plist.
Copying the Xcode.app generated Info.plist into the xcarchive
generated by xcodebuild
"fixes" the archive, and it can be submitted to the App Store. This is not a solution however, as it means I cannot build on the command line.
Note that doing xcodebuild -version
prints:
Xcode 7.0.1
Build version 7A1001
Edit: sometimes xcodebuild
appears to generate a correct iOS App Archive instead of a Generic Archive. I'm not exactly sure why this happens. It's not consistent.