Continuous integration

I'm working on creating a TeamCity continuous integration build agent for my iOS builds, and I came across a small road block.

We are going to create assemblies for different clients with different certificates and mobile device provisioning profiles, so I decided to write a script assembly that will create an unsigned archive and then sign it with the corresponding identifier and mobile view. The xcrun team does not seem to like the .app file to be unsigned and therefore will not sign it.

Am I doing something wrong, or is there some other, more elegant way to accomplish what I'm trying to do?

Next up is Infodump ...


I create an unsigned build with the following command:

xcodebuild -workspace "[workspace].xcworkspace" -scheme "[scheme]" clean archive CODE_SIGN_ENTITY="" CODE_SIGNING_REQUIRED=NO 

Then I try to enter the code and create an IPA using this command:

 APP=[path to .app file in archive] OUT_IPA=[desired location of .ipa] IDENTITY=[CodeSigning Identity] MOBILE_PROVISION=[path to .mobileprovision] xcrun -sdk iphoneos PackageApplication -v "${APP}" -o "${OUT_IPA}" --sign "${IDENTITY}" --embed "${MOBILE_PROVISION}" 

The xcrun command prints a bunch of debugging information, and then copies the files to temporary directories. Then it checks the source application

 ### Checking original app + /usr/bin/codesign --verify -vvvv /Users/jibanez/Library/Developer/Xcode/Archives/2012-09-14/[scheme] 9-14-12 12.02 PM.xcarchive/Products/Applications/[product].app Program /usr/bin/codesign returned 1 : [/Users/jibanez/Library/Developer/Xcode/Archives/2012-09-14/[scheme] 9-14-12 12.02 PM.xcarchive/Products/Applications/[product].app: code object is not signed at all In architecture: armv7 ] Codesign check fails : /Users/jibanez/Library/Developer/Xcode/Archives/2012-09-14/[scheme] 9-14-12 12.02 PM.xcarchive/Products/Applications/[product].app: code object is not signed at all In architecture: armv7 Done checking the original app 

That seems right. In the end, I did not encode the archive code, which xcrun should do. Here, where everything is strange:

 ### Embedding '/Users/jibanez/Documents/[projectdir]/codesign/[scheme]/842F2922-D0CB-46CE-81E5-B7362DD1D960.mobileprovision' + /bin/rm -rf /var/folders/hh/qhf8930s5hg8lwbp2j_zsdm822y1s1/T/NycIiYdEYe/Payload/[product].app/embedded.mobileprovision Program /bin/rm returned 0 : [] + /bin/cp -rp /Users/jibanez/Documents/[projectdir]/codesign/[scheme]/mobileProvision.mobileprovision /var/folders/hh/qhf8930s5hg8lwbp2j_zsdm822y1s1/T/NycIiYdEYe/Payload/[product].app/embedded.mobileprovision Program /bin/cp returned 0 : [] + /usr/bin/codesign -d --entitlements /var/folders/hh/qhf8930s5hg8lwbp2j_zsdm822y1s1/T/NycIiYdEYe/entitlements_rawwAdCadPV /var/folders/hh/qhf8930s5hg8lwbp2j_zsdm822y1s1/T/NycIiYdEYe/Payload/[product].app Program /usr/bin/codesign returned 1 : [/var/folders/hh/qhf8930s5hg8lwbp2j_zsdm822y1s1/T/NycIiYdEYe/Payload/[product].app: code object is not signed at all ] error: Failed to read entitlements from '/var/folders/hh/qhf8930s5hg8lwbp2j_zsdm822y1s1/T/NycIiYdEYe/Payload/[product].app' Failed: PackageApplication 
+4
source share

Source: https://habr.com/ru/post/1434271/


All Articles