【发布时间】:2013-11-28 14:03:53
【问题描述】:
我使用了一个持续集成工具,该工具使用分发身份和 Ad Hoc 移动配置来构建应用程序。此应用程序在网站上发送以进行临时部署,并且一切正常。
但现在我想在我的构建工作流程中添加一个步骤来执行 UI 自动化测试。 Instruments 需要一个使用开发人员身份签名的应用程序,因此我希望/需要(实际上是 QA 团队想要)使用开发人员证书对先前创建的 .ipa 进行签名,而不是构建使用开发人员证书签名的应用程序的新版本。我使用以下命令退出应用程序:
unzip "App.ipa"
rm -rf "Payload/App.app/_CodeSignature" "Payload/App.app/CodeResources"
cp "Dev.mobileprovision" "Payload/App.app/embedded.mobileprovision"
/usr/bin/codesign -f -s "iPhone Developer: john doe" --resource-rules "Payload/App.app/ResourceRules.plist" "Payload/App.app"
然后我使用fruitstrap安装“Payload/App.app”(我尝试使用管理器安装它并没有改变任何东西),最后我像这样执行仪器:
instruments -w 5f9...3fd -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate "App" -e UIASCRIPT /Users/../automation-tests-scripts/test-instruments.js -e UIARESULTSPATH /Users/../test-reports/
仪器因以下错误而失败:
2013-11-28 14:32:56.679 instruments[68408:1007] Permission to debug com.company.App was denied. The app must be signed with a development identity (e.g. iOS Developer).
2013-11-28 14:32:56.681 instruments[68408:1007] Recording cancelled : At least one target failed to launch; aborting run
Instruments Trace Error : Error Domain=com.apple.instruments Code=1 "Error Starting Recording" UserInfo=0x7fb15b290560 {NSLocalizedDescription=Error Starting Recording, NSLocalizedRecoverySuggestion=At least one target failed to launch; aborting run}
Instruments Trace Error : Failed to start trace.
这些命令适用于在 iOS 6.x 上运行的 iOS 设备,但仅在 iOS 7.x 上因上一个错误而失败(我尝试了 2 个 iOS 6.x 设备、iPhone 4S 和 5,我还尝试了 4 个正在运行的设备iOS 7.x)。所以这个问题与iOS 7有关。
如果应用程序是直接使用开发人员身份构建的,它运行良好,所以我猜在签名阶段有些事情失败了。我还在辞职的应用程序上做了一个 codesign -d -vvv,它显示了这个输出
Executable=/Users/.../App.app/App Identifier=com.company.App
Format=bundle with Mach-O universal (armv7 armv7s)
CodeDirectory v=20100 size=8547 flags=0x0(none) hashes=420+3 location=embedded
Hash type=sha1 size=20 CDHash=f00fac8eabf174e88042f2b875505a6cacdd6b0a
Signature size=4326
Authority=iPhone Developer: john doe (BXX559V2VW)
Authority=Apple Worldwide Developer Relations Certification Authority
Authority=Apple Root CA
Signed Time=28 nov. 2013 11:56:04
Info.plist entries=27
Sealed Resources version=2 rules=5 files=290
Internal requirements count=2 size=708
我查看了 Xcode 签名过程,它导出了一个“CODESIGN_ALLOCATE”变量,我试过了,但没有取得更大的成功。
PS:我在某处读到了有关“iOS 开发者”的信息,它可能会取代证书标题中的“iPhone 开发者”,但我没有找到有关此的更多信息。
【问题讨论】:
标签: ios instruments code-signing provisioning-profile