我使用持续集成工具,该工具使用分发标识和Ad Hoc移动设置构建应用程序。这个应用程序发送到一个网站进行临时部署,一切正常。将iOS应用程序从分发标识移至开发人员标识
但是现在我想在构建工作流程中添加一个步骤来执行UI自动化测试。 Instruments需要一个以开发人员身份签名的应用程序,因此,我希望/需要(Q.A.团队实际需要)使用开发人员证书退出先前创建的.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安装“有效载荷/ 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,并且我尝试了使用运行iOS 7.x的4个设备)。所以这个问题与iOS 7有关。
如果应用程序是直接用开发人员身份构建的,那么效果很好,所以我猜测在签名阶段失败了。我还做了一个协同设计上辞职的应用-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开发者”,但是我没有找到关于这方面的更多信息。
这个entitlements.plist文件位于哪里?我怎么编辑它? –
Xcode为你创建它(在编译期间),除非你自己创建它并将它添加到你的xcode项目 – LiohAu
我得到了Xcode将创建它,但它创建它在哪里,我的意思是我在哪里找到它? –