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.