dalcantara
dalcantara

Reputation: 1611

issues with TeamCity, xcrun and single quotes

I'm using TeamCity with xcrun for CI on an IOS project. I'm currently seeing an issues while trying to execute the following command from a TC build step:

-sdk iphoneos PackageApplication "Build/Release-iphoneos/%Product Name%.app" -o "%system.teamcity.build.checkoutDir%/Build/archive.ipa" --sign "iPhone Distribution: AMERICA'S XXXX" --embed "%Provision File%"

The error I get is:

error: /usr/bin/codesign --force --preserve-metadata=identifier,entitlements,resource-rules --sign "iPhone Distribution: AMERICA'S --resource-rules=/Library/TeamCity/buildAgent/temp/buildTmp/PotQjg91Ef/Payload/ACCU Deposit.app/ResourceRules.plist /Library/TeamCity/buildAgent/temp/buildTmp/PotQjg91Ef/Payload/ACCU Deposit.app failed with error 1. Output: "iPhone Distribution: AMERICA'S: no identity found [2013-05-16 14:58:46,533] err - [2013-05-16 14:58:46,533] out - [2013-05-16 14:58:46,540] out - Process exited with code 1

I think is pretty clear that the issue is the way xcrun handles single quotes. I tried doubling the single quote to "AMERICA''S" but that didn't work. Can someone help me out? Is there a way to escape single quotes in xcrun?

Upvotes: 1

Views: 823

Answers (2)

Xiao
Xiao

Reputation: 12695

You need to quote the sign entity iPhone Distribution: AMERICA'S XXXX to make it as only one argument for --sign, otherwise it would be divided by whitespaces and be recognized only the first part. That's what PackageApplication do to recognize command arguments.

I do not know the grammar of your command, but it seems that you should put iPhone Distribution: AMERICA'S XXXX in a variable like %Sign Entity%. Then the whole command should be like this:

-sdk iphoneos PackageApplication "Build/Release-iphoneos/%Product Name%.app" -o "%system.teamcity.build.checkoutDir%/Build/archive.ipa" --sign "%Sign Entity%" --embed "%Provision File%"

Upvotes: 0

lottscarson
lottscarson

Reputation: 588

Try "iPhone Distribution: AMERICA\'S XXXX".

Upvotes: -1

Related Questions