issues with TeamCity, xcrun and single quotes

﹥>﹥吖頭↗ 提交于 2020-01-05 10:31:36

问题


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?


回答1:


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




回答2:


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%"



来源:https://stackoverflow.com/questions/16596614/issues-with-teamcity-xcrun-and-single-quotes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!