ios Xcode:无法获取进程任务
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11601304/
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
Xcode: failed to get the task for process
提问by aneuryzm
I've run in release mode my app on a iPhone with Xcode 4.
我已经在带有 Xcode 4 的 iPhone 上以发布模式运行我的应用程序。
Everything worked great until when I switch to the simulator and I switched back to the iPhone. After switching back, the app is launched on the iPhone, but the home screen is displayed immediately after and in Xcode I get:
一切都很好,直到我切换到模拟器并切换回 iPhone。切换回来后,应用程序在 iPhone 上启动,但主屏幕在 Xcode 之后立即显示,我得到:
failed to get the task for process
I've tried to remove/add Entitlements file, delete app and restart Xcode but nothing to do.
我试图删除/添加授权文件,删除应用程序,并重新启动的Xcode,但没有做到。
回答by borrrden
I am betting that your release mode includes compiling with your distribution certificate, which disallows this behavior (you wouldn't want some random fool hooking into your app after downloading it from the app store). Compile with the development certificate instead. You can change this in the building settings under code signing.
我敢打赌,您的发布模式包括使用您的分发证书进行编译,这不允许这种行为(从应用商店下载应用后,您不希望一些随机的傻瓜挂钩到您的应用中)。而是使用开发证书编译。您可以在代码签名下的构建设置中更改此设置。
回答by Teofilo Israel Vizcaino Rodrig
Change the profile for code signing. Select your project, go to Build Settings > Code Signing Identity. Switch to other developer profile.
更改代码签名的配置文件。选择您的项目,转到 Build Settings > Code Signing Identity。切换到其他开发人员配置文件。
回答by Charlie Scott-Skinner
If anyone is having this issue but is sure they have their certificates and code signing correctly set up, check the capabilities tab when you click on the project (i.e. next to build settings tab, build phases tab, etc).
如果有人遇到此问题但确定他们的证书和代码签名设置正确,请在单击项目时检查功能选项卡(即在构建设置选项卡、构建阶段选项卡等旁边)。
In my case there were broken links for Game Center and In-App Purchases that needed fixing (by clicking the "fix me" buttons) to solve this issue.
就我而言,Game Center 和应用内购买的链接已损坏,需要修复(通过单击“修复我”按钮)来解决此问题。
回答by DamongoCoder
I had a the same issue and after reading the above answers all I had to do was go to Build Settings > Code Signing > Provisioning Profile > None and was able to ran the app on my devices again. Hope this helps someone else out
我遇到了同样的问题,在阅读了上述答案后,我所要做的就是转到 Build Settings > Code Signing > Provisioning Profile > None 并且能够再次在我的设备上运行该应用程序。希望这可以帮助其他人
回答by Aleksander Niedziolko
To anyone who comes across this: After reading this, I attempted to solve the problem by setting the Debug signing to my Development certificate only to find that deployment was still failing.
对于遇到此问题的任何人:阅读本文后,我试图通过将调试签名设置为我的开发证书来解决问题,但发现部署仍然失败。
Turns out my target was Release and therefore still signing with the distribution certificate - either go back to Debug target or change the release signing to Development temporarily.
原来我的目标是发布,因此仍然使用分发证书进行签名 - 返回到调试目标或暂时将发布签名更改为开发。
回答by abiodun ekundayo
I switched back to "Automatic" on the build settings provisioning profile for "Debug" and left the release certificate profile unchanged, mine worked. Tried the other answers. nothing worked. Didn't want to have to reconfigure my certificates. Automatic on the provisioning profile did the trick
我在“调试”的构建设置配置文件上切换回“自动”,并保持发布证书配置文件不变,我的工作正常。尝试了其他答案。没有任何效果。不想重新配置我的证书。自动在配置文件上做到了这一点
回答by Alexej W.
Just get the same problem by installing my app on iPhone 5S with Distribution Profile
通过使用分发配置文件在 iPhone 5S 上安装我的应用程序来解决同样的问题
-> my solution was to activate Capabilities wich are set in Distribution Profile(in my case "Keychain Sharing","In-App Purchase" and "Game Center")
-> 我的解决方案是激活在分发配置文件中设置的功能(在我的情况下是“钥匙串共享”、“应用程序内购买”和“游戏中心”)
Hope this helps someone...
希望这可以帮助某人...
回答by Sea Coast of Tibet
Just had the same problem - app was being installed OK, but won't run from Xcode with the "process launch failed: failed to get the task for process".
刚刚遇到了同样的问题 - 应用程序安装正常,但无法从 Xcode 运行,并显示“进程启动失败:无法获取进程任务”。
Turns out my development certificate expired during the night. Regenerating the certificate and the provisioning profiles solved the problem.
原来我的开发证书在晚上过期了。重新生成证书和配置文件解决了这个问题。
回答by nenchev
If you've set the correct code signing certificate under Build Settings->Code Signing, then make sure you are also using the correct provisioning profile for Debug/Release mode as well.
如果您在Build Settings->Code Signing下设置了正确的代码签名证书,那么请确保您也为调试/发布模式使用了正确的配置文件。
I was having this issue because I was using an Ad-Hocprovisioning profile for both Debug/Release modes, which doesn't allow for a development profile to be used when doing a debug build.
我遇到这个问题是因为我对两种调试/发布模式都使用了Ad-Hoc配置文件,这不允许在进行调试构建时使用开发配置文件。
回答by Sipka
I had this same problem, however in a little bit different situation. One day my application launches fine (using developer provision), then I do some minor editing to my Entitlements file, and after that it stops working. The application installed fine on my device, however every time I tried to launch it, it exited instantly (after the opening animation). (As I made edits to other files too, I did not suspect the following problem)
我遇到了同样的问题,但情况略有不同。有一天,我的应用程序启动正常(使用开发人员配置),然后我对我的权利文件进行了一些小的编辑,之后它停止工作。该应用程序在我的设备上安装得很好,但是每次我尝试启动它时,它都会立即退出(在打开动画之后)。(由于我也对其他文件进行了编辑,所以我没有怀疑以下问题)
The problem was in the Entitlements file format, seems so that the following declarations are not the same:
问题出在权利文件格式中,似乎以下声明不一样:
Correct:
正确的:
<key>get-task-allow</key>
<true/>
Incorrect:
不正确:
<key>get-task-allow</key>
<true />
Altough it's an XML format, do not use spaces in the tagor the Xcode will not be able to connect to the process.
尽管它是一种 XML 格式,但不要在标签中使用空格,否则 Xcode 将无法连接到该进程。
I was using developer provisioning profile all along.
我一直在使用开发人员配置文件。