I'm migrating our build scripts to produce xcarchive files, so we can upload builds right from the Xcode Organizer, however, I'm having trouble getting builds to work over the air now.
I'm building the archive with:
xcodebuild -scheme myScheme \
"CODE_SIGN_IDENTITY[sdk=iphoneos*]=$appstore_identity" \
PROVISIONING_PROFILE=$appstore_profile_id \
-archivePath $outputArchive
archive`
Then I'm trying to export and re-sign using my enterprise distribution profile with:
enterprise_profile_name=`basename $enterprise_profile_file .mobileprovision` \
xcodebuild -exportArchive \
-archivePath "$outputArchive" \
-exportFormat IPA \
-exportProvisioningProfile "$enterprise_profile_name" \
-exportPath "$outputIPA"
The resulting IPA looks correct (contains correct profile, codesign says it's valid, etc), however, when we generate a manifest file so this can be installed over the air things stop working. On iOS 7 devices get into the 'Installing..., Waiting...' loop and the app never get's installed.
Any suggestions?
Update 1
I've also tried exporting an app from the archive and then resigning that with PackageApplication:
xcodebuild -exportArchive \
-archivePath "$outputArchive" \
-exportFormat APP \
-exportWithOriginalSigningIdentity \
-exportPath "$outputApp"
xcrun PackageApplication \
"$outputApp" \
-o "$outputIPA" \
--sign "$enterprise_identity" \
--embed "$enterprise_profile_file"
But the resulting IPA still fails to install OTA and syncing via iTunes.