New export options Plist in Xcode 9

Even if Xcode 9 is still in beta, Bitrise already has an Xcode 9 stack, which is used by many of you in experimenting mood. 👨‍🔬

However, several builds fail due to the new export option. We are working on an update for the Xcode Archive step to automatically detect this new option. Until we release the fix, let's see the problem and the solution.

Before Xcode 9

Xcode 7 introduced the exportOptionsPlist flag for xcodebuild command line tool to specify the IPA export parameters. (To see the available IPA export options call: xcodebuild -h and search for Available keys for -exportOptionsPlist: in the command's output.)

Before Xcode 9, the minimal exportOptionsPlist specified the exportMethod:





    
        method
        development
        provisioningProfiles
    


Copy code

These export options are still available and you still have to select these options when you export your IPA in your local Xcode.

  1. When you use the IDE to export your IPA for the first time you need to Select a method for distribution, this choice defines the method key in the exportOptionsPlist. (All the other options can be mapped to the UI options similarly.)
  2. The Xcode Archive for iOS step is able to determine the required export options based on the provisioning profile embedded into the .xcarchive file, if you set Select method for export input to auto-detect.

But with Xcode 9... ⚠

Using Xcode 9's xcodebuild tool you need to be more specific than in previous Xcode versions: if you run the step on Xcode 9.0.x stack using auto-detect export method you will receive the following error message:

"Error Domain=IDEProvisioningErrorDomain Code=9 \"\"ios-simple-objc.app\" requires a provisioning profile.\" UserInfo={NSLocalizedDescription=\"ios-simple-objc.app\" requires a provisioning profile., NSLocalizedRecoverySuggestion=Add a profile to the \"provisioningProfiles\" dictionary in your Export Options property list.}"

It is visible from the log that you need to add the provisioningProfiles key to the exportOptionsPlist file, and this value should describe which bundle id should be signed with which provisioning profile.

The solution for the time being

So you have to let your local Xcode 9 generate the exportOptions file for you, and once your Xcode generated this file, you can configure the Xcode Archive step with these options:

  1. Open your project in your local Xcode 9
  2. Archive the project
  3. Once the archive is done, export the generated .xcarchive file into an IPA file. Xcode will copy the used exportOptionsPlist file next to the generated IPA file
  4. Open this plist file in your favourite text editor and copy its content
  5. Paste its content to the Xcode Archive step's Custom export options plist content input

Tada! 🎉
You can now export your iOS project on the Xcode 9.0.x bitrise stack the same way you would do on your local machine.

Happy coding! 👻

No items found.
The Mobile DevOps Newsletter

Explore more topics

App Development

Learn how to optimize your mobile app deployment processes for iOS, Android, Flutter, ReactNative, and more

Bitrise & Community

Check out the latest from Bitrise and the community. Learn about the upcoming mobile events, employee spotlights, women in tech, and more

Bitrise Insights

Cache | Caching

Mobile App Releases

Learn how to release faster, better apps on the App Store, Google Play Store, Huawei AppGallery, and other app stores

Mobile DevOps

Learn Mobile DevOps best practices such as DevOps for iOS, Android, and industry-specific DevOps tips for mobile engineers

Mobile Testing & Security

Learn how to optimize mobile testing and security — from automated security checks to robust mobile testing and more.

Product Updates

Check out the latest product updates from Bitrise — Build Insights updates, product news, and more.

The Mobile DevOps Newsletter

Join 1000s of your peers. Sign up to receive Mobile DevOps tips, news, and best practice guides once every two weeks.