Question

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.

Was it helpful?

Solution

@MishieMoo and I chatted offline and it seems that what I'm trying to do isn't possible because I am trying to work across teams. I have 2 teams A and B, each with their own identity and provisioning profile. A has a enterprise profile for com.foo.*. B has a regular profile for com.foo.bar.

I was building with B and trying to resign with A. However that isn't working because they are 2 different accounts with 2 different team identifiers.

Result: I need to build twice (once for each account).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top