ios Xcode:无法获取进程任务
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18913676/
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 elliotrock
This is for an existing app that compiled and distributed multiple times. Since updating to Xcode 5 I have this error popping.
这是针对多次编译和分发的现有应用程序。自从更新到 Xcode 5 后,我就出现了这个错误。
- I have my developers profile selected in the Code Signing for debug.
- Deleted the Derived Data a few times.
- Quit a few times
- Downloaded and tried to re-add my Developers certificates.
- Reset my computer! And checked updates
- Tried using black magic!
- The Scheme > Build Configuration is set to Debug
- 我在代码签名中选择了我的开发人员配置文件进行调试。
- 删除了几次派生数据。
- 退出几次
- 下载并尝试重新添加我的开发人员证书。
- 重置我的电脑!并检查更新
- 尝试使用黑魔法!
- Scheme > Build Configuration 设置为 Debug
The odd circumstances I am compiling to compile to iOS 6.1 so I can run on my iPhone 3GS - the base is SDK iOS 7? Could this be an issue? I just need to test it before finding a newer phone to before change it to iOS 7.
我正在编译以编译到 iOS 6.1 以便我可以在我的 iPhone 3GS 上运行的奇怪情况 - 基础是 SDK iOS 7?这可能是一个问题吗?我只需要在找到更新的手机之前对其进行测试,然后再将其更改为 iOS 7。
采纳答案by elliotrock
I have not accepted the answers above as there was a chain of issues that I needed to resolve:
我没有接受上面的答案,因为我需要解决一系列问题:
- Third party SDK not set as a distribution.
- Third party SDK not set to arm64, which I think I caused as I in vain to fix the issue compiled to arm64.
- Needed to complete clear out any old certificates and add new ones from Apple. Good thing to do.
- Xcode 5 hides the certs and profiles in preferences now I think, which added frustrations.
- Then making sure the correct provision profiles are selected across the debug and release settings in your Build settings.
- 第三方 SDK 未设置为发行版。
- 第三方 SDK 未设置为 arm64,我认为这是我无法修复编译为 arm64 的问题造成的。
- 需要完成清除所有旧证书并从 Apple 添加新证书。好办法。
- 现在我认为 Xcode 5 在首选项中隐藏了证书和配置文件,这增加了挫败感。
- 然后确保在构建设置中的调试和发布设置中选择了正确的配置文件。
As always thanks for peoples help.
一如既往地感谢人们的帮助。
回答by hasan
This error tends to appear when you pick an ad-hoc provisioning profile. Make sure that your code signing is for development.
当您选择临时配置文件时,往往会出现此错误。确保您的代码签名用于开发。
回答by David Douglas
This error happens if you have used a Distribution Provisioning Profile for debugging to device.
如果您使用分发供应配置文件进行设备调试,则会发生此错误。
Go to Build Settings
> Provisioning Profile
and set to 'None' for Debugging
.
转到Build Settings
>Provisioning Profile
和set to 'None' for Debugging
。
回答by IMT
I finally solved this by remembering to set code signing and provisioning parameters in BOTH project and target tabs...
我终于通过记住在两个项目和目标选项卡中设置代码签名和配置参数来解决这个问题...
回答by Alex Christodoulou
When your device is connected to your computer with a cable and you Build + Run your app, your device will try to debug. Debugging is only permitted for Development profiles.
当您的设备通过电缆连接到您的计算机并且您构建 + 运行您的应用程序时,您的设备将尝试调试。只有开发配置文件才允许调试。
If you build + run with a Development Profile + Development Signing Code, everything will be OK
If you build + run with an AppStore Distribution profile + Distribution Signing Code, the app will not even reach your device. This build is only for uploading to AppStore
If you build + run with an AdHoc Distribution profile + Distribution Signing Code, you'll get the "failed to get the task for process..." error, but the app will get installed in your device. Unplug the device and run the app from your device. It's running in distribution environment. Enjoy :)
如果您使用开发配置文件 + 开发签名代码构建 + 运行,一切都会好起来的
如果您使用 AppStore 分发配置文件 + 分发签名代码构建 + 运行,该应用程序甚至不会到达您的设备。此版本仅用于上传到 AppStore
如果您使用 AdHoc 分发配置文件 + 分发签名代码构建 + 运行,您将收到“无法获取进程任务...”错误,但该应用程序将安装在您的设备中。拔下设备并从您的设备运行应用程序。它在分发环境中运行。享受 :)
回答by Adam
UPDATE:
更新:
Xcode 5.1 appears to fix the dropdown so that it now shows a "(blah blah)" whenever two profiles have the same name. This lets you pick the correct one. Which is much better :)
Xcode 5.1 似乎修复了下拉列表,现在只要两个配置文件具有相同的名称,它就会显示“(blah blah)”。这可以让您选择正确的。哪个好多了:)
Bitten by this a few times. Xcode5 shows "Provisioning Profile" as a single field, WHICH IS ALWAYS INCORRECT and Apple SHOULD NOT have coded their GUI like this (beginner mistake there from Apple).
被这个咬了几次。Xcode5显示“供应配置文件”作为一个单一的领域,这始终是不正确的,苹果应该不会有编码它们的GUI像这样(从苹果初学者的错误那里)。
In Xcode5 (no previous version), you have two values of "Provisioning Profile". This MUST BE set BEFORE you set your "Code Signing Identity". Obviously, since it has to be set FIRST ... Apple placed it SECOND on the list, 3 items BELOW the thing it has to be set "before".
在 Xcode5(没有以前的版本)中,您有两个“Provisioning Profile”值。这必须在您设置“代码签名身份”之前设置。显然,因为它必须被设置为第一......苹果将它放在列表中的第二个,在它必须“之前”设置的东西之下有 3 个项目。
(bonus points for terrible GUI design there...)
(那里可怕的 GUI 设计的加分项......)
It's also broken: if you have two Provisioning Profiles for the same name, Xcode5 will only allow you to select one of them. To work around this, you have to use iPhone Configuration Utility to find the Profile you want, find the 30-digit "Profile Identifier" and copy/paste it into the "Other" value of the Provisioning Profile dropdown.
它也坏了:如果您有两个同名的配置文件,Xcode5 将只允许您选择其中一个。要解决此问题,您必须使用 iPhone 配置实用程序来查找所需的配置文件,找到 30 位“配置文件标识符”并将其复制/粘贴到配置文件下拉列表的“其他”值中。
Your Provisioning Profile MUST have a value for "Debug" and a different value for "Release" (unless you build a custom mega-profile by hand, Apple keeps the two separate).
您的配置文件必须有一个“调试”值和一个不同的“发布”值(除非您手动构建自定义超级配置文件,Apple 将两者分开)。
The Debug profile will often have the same-name bug described above - most people will be using Apple's auto-generated Team Provisioning Profile, which Apple incorrectly always names the same, for all Targets, in all Projects. (another bug in Xcode5).
调试配置文件通常会具有上述相同名称的错误 - 大多数人将使用 Apple 自动生成的团队供应配置文件,Apple 错误地始终将其命名为相同的名称,适用于所有项目中的所有目标。(Xcode5 中的另一个错误)。
Once you've set both values, your "Code Signing Identity" field will finallystart working correctly. In fact, it works nicely: in most previous versions of Xcode, this field was broken, and the "automatic" selection rarely worked. In Xcode5, it can ONLYuse code-signing values found inside the Provisioning Profile you've pre-selected - and so it seems to get it correct 100% of hte time.
一旦您设置了这两个值,您的“代码签名身份”字段将最终开始正常工作。事实上,它工作得很好:在大多数以前的 Xcode 版本中,这个字段被破坏了,“自动”选择很少起作用。在 Xcode5 中,它只能使用在您预先选择的配置文件中找到的代码签名值 - 因此它似乎在 100% 的时间里都正确。
(i.e. you can safely set it to "Automatic". In previous versions of Xcode, Xcode would often "Automatically" use a Distribution profile for a Developer build, and vice-versa, causing lots of problems)
(即,您可以安全地将其设置为“自动”。在以前版本的 Xcode 中,Xcode 通常会“自动”为开发人员构建使用分发配置文件,反之亦然,这会导致很多问题)
回答by windfly2006
Based on my current search, the error "Failed to get the task for process" at xcode 5 could happen for multiple reasons:
根据我当前的搜索,在 xcode 5 中出现“无法获取进程任务”错误的原因可能有多种:
- One is that we are debugging an application which is signed with distribution ad-hoc provision profile.
- Another reason is that somehow xcode5 could not find the correct development provision profile although the coding signing identity has the developer signing identity there.
- 一个是我们正在调试一个应用程序,该应用程序使用分发临时配置文件进行签名。
- 另一个原因是,尽管编码签名身份在那里具有开发人员签名身份,但不知何故 xcode5 无法找到正确的开发条款配置文件。
For me, it is the second case which seems the case as well for this question.
对我来说,对于这个问题,第二种情况似乎也是如此。
I am able to fix this by changing debug provision profile dropdown to the correct development provision profile and then trying to load the app to real device. Xcode would give this below error:
我可以通过将调试配置文件下拉列表更改为正确的开发配置文件,然后尝试将应用程序加载到真实设备来解决此问题。Xcode 会给出以下错误:
click "Fix issue" to continue, xcode 5 would fix the issue. After the issue is fixed, the provision profile for debug is reset to "None" again, not sure why xcode would do that though.
单击“修复问题”继续,xcode 5 将修复该问题。问题修复后,调试的配置文件再次重置为“无”,但不知道为什么 xcode 会这样做。
回答by Frank Yin
Try restarting XCode
尝试重新启动 XCode
After setting Provisioning and Code Signing settings from all these suggestions, a restart was what finally allowed it to run with Provisioning set to none and Code Signing set to iOS Developer (Automatic)
根据所有这些建议设置预配和代码签名设置后,重新启动最终允许它在预配设置为无且代码签名设置为 iOS 开发人员(自动)的情况下运行
回答by superarts.org
It may cased by provisioning profiles. For my case, I tried to run the app on my phone and the provisioning profile was set to adhoc profile (XC Ad Hoc), hence the error. I need to change it to iOS Team profile that's managed by xcode (to avoid manual work on dev center).
它可以通过供应配置文件来区分。就我而言,我尝试在手机上运行该应用程序,并且配置文件设置为临时配置文件 (XC Ad Hoc),因此出现错误。我需要将其更改为由 xcode 管理的 iOS 团队配置文件(以避免在开发中心进行手动工作)。
回答by KodeHyman
I had this issues and as once I had set both the CODE_SIGN_IDENTITYand the PROVISIONING_PROFILEit all work fine,
我遇到了这个问题,一旦我设置了CODE_SIGN_IDENTITY和PROVISIONING_PROFILE,它就一切正常,
Please note this has change in Xcode 5, previous version had no entry for PROVISIONING_PROFILEin build settings
请注意,这在 Xcode 5 中有所更改,以前的版本在构建设置中没有PROVISIONING_PROFILE条目
//:configuration = Adhoc
CODE_SIGN_IDENTITY = iPhone Distribution: orgname
CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Distribution: orgname
Note that here I had to manually write the iphone developer into the second entry as automatic selection didn't seem to work
请注意,这里我必须手动将 iphone 开发人员写入第二个条目,因为自动选择似乎不起作用
//:configuration = Debug
CODE_SIGN_IDENTITY = iPhone Developer: Joe Bloggs (0A0AA00A00)
CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Developer: Joe Bloggs (0A0AA00A00)
//:configuration = Release
CODE_SIGN_IDENTITY = iPhone Distribution: orgname
CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Distribution: orgname
Then update and the provisioning profile settings
然后更新和配置文件设置
add you profile ids 0000 are just for privacy
添加您的个人资料 ID 0000 仅用于隐私
//:configuration = Adhoc
PROVISIONING_PROFILE = 11111111-1111-1111-1111-111111111111
PROVISIONING_PROFILE[sdk=iphoneos*] = 11111111-1111-1111-1111-111111111111
//:configuration = Debug
PROVISIONING_PROFILE = 00000000-0000-0000-0000-000000000000
PROVISIONING_PROFILE[sdk=iphoneos*] = 00000000-0000-0000-0000-000000000000
//:configuration = Release
PROVISIONING_PROFILE = 22222222-2222-2222-2222-222222222222
PROVISIONING_PROFILE[sdk=iphoneos*] = 22222222-2222-2222-2222-222222222222
回答by Steven Li
actually,It's your Provisioning Profile --Debug is incorrect。
实际上,这是您的 Provisioning Profile --Debug 不正确。