Home > Enterprise >  Cannot Xcode Export Adhoch Archive
Cannot Xcode Export Adhoch Archive

Time:01-24

If I run an Xcode build, then export that archive from within Xcode, it works.

If I take the same export options used by that export, and then manually run the following:

xcodebuild -verbose -exportArchive -archivePath build/MyApp.xcarchive -exportPath build -exportOptionsPlist ExportOptions.plist | xcpretty

Then it fails with the following error:

AppThinning.StubError(errorDescription: Optional("ipatool failed"))

I can't see a clear error reason in the detailed logs. There are some warnings, but its not clear if they are the root cause, since it keeps going up until the end, where the above message appears.

How can I troubleshoot this?

The export options are:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>compileBitcode</key>
    <true/>
    <key>destination</key>
    <string>export</string>
    <key>method</key>
    <string>ad-hoc</string>
    <key>provisioningProfiles</key>
    <dict>
        <key>com.foo.myapp</key>
        <string>[redacted]</string>
        <key>com.foo.myapp.OneSignalNotificationServiceExtension</key>
        <string>[redacted]</string>
    </dict>
    <key>signingCertificate</key>
    <string>Apple Distribution</string>
    <key>signingStyle</key>
    <string>manual</string>
    <key>stripSwiftSymbols</key>
    <true/>
    <key>teamID</key>
    <string>[redacted]</string>
    <key>thinning</key>
    <string>&lt;none&gt;</string>
</dict>
</plist>

Edit: Note that the setting for thinning really is correct, as per documentation, and what Xcode (via GUI) uses itself, successfully. (Yeah, Xcode, right?)

CodePudding user response:

I found the issue, buried in the logs.

So the answer to the question above is:

  • Carefully review each of the log output files.

The problem: I was running a Ruby under RVM and some dependencies were fighting. Dropping back to the raw Apple Ruby worked. (Presumably, installing the correct dependencies also could have).

  • Related