dreamzor
dreamzor

Reputation: 5925

Build iOS app and distribute .ipa via TestFlight with Jenkins and Xcode 7

Apple has released Xcode 7 update that broke everything again.

Previously, we had to deal with

ResourceRules.plist: cannot read resources

issue by using a hack described, for example, here. Some people wonder why has this even happened in the first place.

However, with Xcode 7 update they forbade the usage of Code Signing Resource Rules Path by giving this error when this option is set:

ERROR ITMS-90339: "This bundle is invalid. The Info.plist contains an invalid key 'CFBundleResourceSpecification' in bundle

This question is exactly about this issue with an answer proposing to delete this option from build settings. Guess what, after deletion the first error pops up, so we find ourselves in the loop.

My question (apart from how come we've ended up in this mess, of course) is:

How do we fix both problems so iOS building works in Jenkins and Xcode 7 with TestFlight uploading afterwards?

Upvotes: 3

Views: 2430

Answers (4)

somedev
somedev

Reputation: 801

I fixed the same issue by changing Jenkins build settings: Go to Configure > Advanced Xcode build options and add to Custom xcodebuild arguments

CODE_SIGN_RESOURCE_RULES_PATH=$(SDKROOT)/ResourceRules.plist

Upvotes: 1

Nagendra Singh
Nagendra Singh

Reputation: 1381

These two commands have worked perfectly for me:

  1. Create an archive: xcodebuild -workspace "/path/to/something.xcworkspace" -scheme "some enterprise" -configuration Release -CODE_SIGN_IDENTITY="your identity" PROVISIONING_PROFILE="61xyz111-22x0-2345-123x-xyxxxxxx" archive -archivePath "/where/you/want/the/archive/xyz.xcarchive"

  2. Generate IPA: xcodebuild -exportArchive -exportFormat IPA -exportProvisioningProfile "Name of your profile" -archivePath "/where/you/saved/the/archive/xyz.xcarchive" -exportPath "/where/you/want/the/IPA/xyz.ipa"

Upvotes: 0

Mike Vosseller
Mike Vosseller

Reputation: 4197

As of Xcode 7 we should use xcodebuild instead of PackageApplication to produce the .ipa file.

xcodebuild has a new -exportArchive option to create an .ipa that works more like Xcode Organizer.

See answer here for details: iOS builds / ipa creation no longer works from the command line

Upvotes: 1

Renaud Tilte
Renaud Tilte

Reputation: 66

Take a look at this: https://stackoverflow.com/a/32762413/5373468

And if you're not sure it's a bug, you can get a confirmation here too: http://cutting.io/posts/packaging-ios-apps-from-the-command-line/

Upvotes: 1

Related Questions