ios 无法在 Instruments 中启动我的应用程序:至少一个目标未能启动
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18905450/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can't launch my app in Instruments: At least one target failed to launch
提问by Andrew
I have all my code signing entitlements set correctly. Running the app on my phone is fine, but launching it in instruments gives me an error message:
我已正确设置所有代码签名权利。在我的手机上运行该应用程序很好,但在仪器中启动它会给我一条错误消息:
Error Starting Recording
At least one target failed to launch; aborting run
And then:
进而:
Target failed to run. Permisson to debug [app name] was denied. The app must be signed with a development identity (i.e. iOS Developer)
Any ideas how I could stop this from happening? Doesn't happen on my iPad.
有什么想法可以阻止这种情况发生吗?在我的 iPad 上不会发生。
回答by harrywynn
Edit the scheme for your target and under "Profile [App Name]" set the Build Configuration to Debug (it's usually Release by default).
编辑目标的方案,并在“配置文件 [应用程序名称]”下将构建配置设置为调试(默认情况下通常为发布)。
回答by Zoltán Matók
It is saying that you need to sign the app with a developercertificate (not a distributioncertificate).
据说您需要使用开发人员证书(而不是分发证书)对应用程序进行签名。
In Xcode 5 just change the "Provisioning Profile"
field for your "Release"
build in the Build Settingsto your developercertificate instead of your distribution certificate. For the duration of the testing anyway. Xcode doesn't allow you to build with a distribution certificate.
在Xcode中5只改变"Provisioning Profile"
字段中为"Release"
构建在生成设置你的开发者证书,而不是你的分发证书。无论如何,在测试期间。Xcode 不允许您使用分发证书进行构建。
Make sure that the projectbuild settings do not override the targetbuild settingsor make the change in your projectbuild settings.
确保项目构建设置不会覆盖目标构建设置或在项目构建设置中进行更改。
Don't forget to set the profile back after you're donewith the testing.
完成测试后,不要忘记重新设置配置文件。
I do not recommend harrywynn's method, since it is better to profile the release buildbecause then you are taking into account the compiler optimizations, and having the exact experience your users will.
我不推荐 harrywynn 的方法,因为最好对发布版本进行概要分析,因为这样您就会考虑编译器优化,并获得用户的确切体验。
回答by dornad
To add to the previous answers.
添加到以前的答案。
- Instruments is complainingabout the signing identity.
- I believe it is preferable to profilein release mode, for the same reasons given by Zolten. (take into account the compiler optimizations, and have the exact experience your users will, etc...)
- To change your code signing identity for Xcode 6:
- Click on your Project, Select the Target you are Profiling.
- Build Settings -> Code Signing -> Code Signing Identity -> Release
- Select your iOS developer profile.
- Provisioning Profile: Let Xcode pick the correct Provisioning Profile for you, e.g: switch to Automatic
- When you are done with the Profile, switch back to your normal settings.
- 仪器的抱怨有关签署的身份。
- 出于与 Zolten 给出的相同原因,我认为最好在发布模式下进行概要分析。(考虑到编译器优化,并拥有您的用户的确切体验,等等...)
- 要更改Xcode 6 的代码签名标识:
- 单击您的项目,选择您正在分析的目标。
- 构建设置 -> 代码签名 -> 代码签名身份 -> 发布
- 选择您的 iOS 开发人员资料。
- 配置文件:让 Xcode 为您选择正确的配置文件,例如:切换到自动
- 完成配置文件后,切换回正常设置。
Here's a picture for those who are very visual ;)
这是给那些非常直观的人的图片;)
回答by swathy valluri
I was getting the same issue : [INST STDERR] Instruments Trace Error : Target failed to run: Permission to debug was denied. The app must be signed with a development identity (e.g. iOS Developer).
我遇到了同样的问题:[INST STDERR] 仪器跟踪错误:目标无法运行:调试权限被拒绝。应用程序必须使用开发身份(例如 iOS 开发人员)进行签名。
Solution: 1. I archived the the app with Debug Developer Profile in xcode for device. 2. The go to Window -> Organiser -> to see all the list of archieves 3. Now select the archive to wanted to export and open it in finder 4. Right click and show package contents 5. Go to the Products/Applications folder You will see the .app file.
解决方案: 1. 我在设备的 xcode 中使用调试开发人员配置文件归档了应用程序。2. 转到窗口 -> 管理器 -> 查看所有档案列表 3. 现在选择要导出的档案并在 finder 中打开它 4. 右键单击并显示包内容 5. 转到产品/应用程序文件夹您将看到 .app 文件。
Use this instead of the ipa.
用这个代替ipa。
Make sure that the device has been already added to the developer portal and all the certs are installed on it for the above steps to work.
确保设备已添加到开发人员门户,并且所有证书都已安装在设备上以使上述步骤生效。
Once this is in place. Also, make sure you get the ios-webkit-debug-proxy from the link below:
一旦到位。另外,请确保您从以下链接获取 ios-webkit-debug-proxy:
https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/ios-webkit-debug-proxy.md
https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/ios-webkit-debug-proxy.md
Also, enable developer tools on on the device setting. Also, make sure safari webinspector (safari -> Develop) -> Inspector is on Hope it helps:-)
此外,在设备设置上启用开发人员工具。另外,请确保 safari webinspector (safari -> Develop) -> Inspector 正在运行希望它有帮助:-)
NOTE: When you want appium to install the app on the device for you, don't provide Bundle ID.
注意:当您希望 appium 为您在设备上安装应用程序时,请不要提供 Bundle ID。
回答by John Bushnell
None of the other solutions here fixed my problem, but I did determine that it was only a problem for me on the simulator. The device works fine. Perhaps there's an issue with the simulator.
这里的其他解决方案都没有解决我的问题,但我确实确定这只是我在模拟器上的一个问题。该设备工作正常。也许模拟器有问题。
回答by CodeBrew
I encountered this problem with Xcode 9.1 for both simulators and devices, and my running scheme was already set as profiling with "Debug". Finally found this Apple forum discussionvery helpful and got the problem resolved. In short, the solution that worked for me is ... Restart the Mac.
我在 Xcode 9.1 的模拟器和设备上都遇到了这个问题,我的运行方案已经设置为使用“调试”进行分析。终于发现这个 Apple 论坛讨论非常有帮助并解决了问题。简而言之,对我有用的解决方案是...重新启动 Mac。
回答by Sèb
I achieved to solve this issue on my machine by doing this :
我通过这样做在我的机器上解决了这个问题:
- Generate a new Developer Provisioning Profilewith your device in the list or at least make sure that your machine is in the list of the profile's device.
- In Project settings -> Code Signing -> Provisioning Profile -> Debug : Set the newly created profile.
- In Targets settings -> Code Signing -> Provisioning Profile -> Debug ANDRelease : Set the newly created profile.
- 使用列表中的设备生成新的开发人员配置文件,或者至少确保您的机器在配置文件的设备列表中。
- 在 Project settings -> Code Signing -> Provisioning Profile -> Debug 中:设置新创建的配置文件。
- 在 Targets settings -> Code Signing -> Provisioning Profile -> Debug ANDRelease 中:设置新创建的配置文件。
Hope that helps.
希望有帮助。
回答by Matt
I realised what "At least one target failed to launch" means. It appears that boththe development and release schemes (if you have a debug scheme and a release scheme) must have a development identity.
我意识到“至少一个目标未能发射”的意思。看来,双方的开发和发布计划(如果你有一个调试方案和发行方案)必须有一个发展的身份。
I had the debug scheme selected when running the profiler and the message at the top of XCode said "Running debug". However, it seems that this is not sufficient.
我在运行探查器时选择了调试方案,并且 XCode 顶部的消息说“正在运行调试”。然而,这似乎还不够。
I changed my release scheme code-signing identity to be the same as the debug scheme (and also the provisioning profile), and the problem went away.
我将我的发布方案代码签名标识更改为与调试方案(以及配置文件)相同,问题就消失了。
回答by ck8414
it worke.. when i changed my profile schema to debug mode and also made sure, build configs has developer certificate in it. Thanks
它有效......当我将我的配置文件架构更改为调试模式并确保构建配置中有开发人员证书时。谢谢