0

I am trying to archive my Xcode project from command line terminal using xcodebuild and xcrun. To be clear enough, I am doing that from ANT script.

<target name="build">

<exec executable="/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild">
<arg value="-project"/>
<arg value="${local.projectPath}/${app.id}.xcodeproj"/>
<arg value="-scheme"/>
<arg value="${scheme}"/>
<arg value="-configuration"/>
<arg value="${configuration}"/>
<arg value="clean"/>
<arg value="build"/>
</exec>

</target>

<target name="package" depends="build">

<exec executable="xcrun">
<arg value="-sdk"/>
<arg value="iphoneos"/>
<arg value="PackageApplication"/>
<arg value="-v"/>
<arg value="${local.projectPath}/DerivedData/dist/${app.id}/Build/Products/${configuration}-iphoneos/${app.id}.app"/>
<arg value="-o"/>
<arg value="${local.ipaPath}/${app.id}.${appVersion}.b${buildNumber}.${environment}.ipa"/>
<arg value="--sign"/>
<arg value="iPhone Distribution: ${developerName}"/>
<arg value="--embed"/>
<arg value="${provisioningProfile}"/>
</exec>

After upgrading to 6.1 version, I am getting below error.

/var/folders/hk/bg4j097j1kncryfrplv4b3bw0000gp/T/f3UZyfiqbS/Payload/MyApp.app/ResourceRules.plist: cannot read resources

Then, I found the below post.

Xcode - Sharing app - PackageApplication failed with exit code 1

According to that, I added the below in code signing section of build settings.

Code Signing Resource Rules Path: $(SDKROOT)/ResourceRules.plist

That solved my issue though the warning still persisted. But I came across the Apple's technical note @ https://developer.apple.com/library/mac/technotes/tn2206/_index.html#//apple_ref/doc/uid/DTS40007919-CH1-TNTAG401 which states that:

"Systems before OS X Mavericks documented a signing feature (--resource-rules) to control which files in a bundle should be sealed by a code signature. This feature has been obsoleted for Mavericks. Code signatures made in Mavericks and later always seal all files in a bundle; there is no need to specify this explicitly any more. This also means that the Code Signing Resource Rules Path build setting in Xcode should no longer be used and should be left blank. It is thus no longer possible to exclude parts of a bundle from the signature. Bundles should be treated as read-only once they have been signed."

I am totally confused now. If I leave the field blank, I am getting error. And if I include, it violates Apple's guidelines. What should I do now? Any help will be greatly appreciated.

Community
  • 1
  • 1
Rashmi Ranjan mallick
  • 6,390
  • 8
  • 42
  • 59

1 Answers1

1

Check this question: Xcode - Sharing app - PackageApplication failed with exit code 1

Apple states that "there is no need..." it's like being ignored, but you are not violating any rule, I think other platforms that compile this projects that are still taking that field into account, so if you have problems compiling or archiving just add $(SDKROOT)/ResourceRules.plist to Code Signing Resource Rules Path and try again.

Community
  • 1
  • 1
LightMan
  • 3,517
  • 31
  • 31
  • Thanks. Do you mean that I can still add this in my build settings? What is actually violating any rule? – Rashmi Ranjan mallick Mar 22 '15 at 12:22
  • You can write it, and you are not "violating" any rule. Apple says "there is no need to specify", where I understand that you can write or not, but if you do, nothing is going to happen. – LightMan Mar 23 '15 at 12:10