3

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?

Community
  • 1
  • 1
dreamzor
  • 5,795
  • 4
  • 41
  • 61

4 Answers4

1

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/

Community
  • 1
  • 1
Renaud Tilte
  • 66
  • 1
  • 3
  • Thanks, I'll try it! However, it's a dirty hack and hopefully some day we will be able to do it the sane way. – dreamzor Sep 24 '15 at 19:08
1

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

Mike Vosseller
  • 4,097
  • 5
  • 26
  • 28
1

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

somedev
  • 791
  • 11
  • 29
  • What difference does it make if you pass this to `xcodebuild` or set it in the project setting / xcconfig? Wouldn't the end result be a `CFBundleResourceSpecification` entry in the app's `info.plist`, which is now disallowed by Apple? – Ohad Schneider Nov 12 '15 at 13:02
0

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"

Nagendra Singh
  • 1,361
  • 1
  • 7
  • 9