xcode 为 iPhone 设备构建应用程序时无法验证应用程序错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/997884/
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
Application could not be verified error when building app for iPhone device
提问by Codebeef
OK, I've just got myself a shiny new MacBook Pro, and having been developing my iPhone app on another MacBook, I wanted to migrate my development to my new computer.
好的,我刚刚给自己买了一台闪亮的新 MacBook Pro,并且一直在另一台 MacBook 上开发我的 iPhone 应用程序,我想将我的开发迁移到我的新电脑上。
I've got to the stage where I can build the app and run it on the simulator no problem, but when it comes to running the app on my iPhone, I keep getting "The application could not be verified". I have installed a new developer certificate, and installed the provisioning profiles (all generated new), but I'm at a loss as to why I should still be getting the error.
我已经到了可以构建应用程序并在模拟器上运行它的阶段,没问题,但是在我的 iPhone 上运行应用程序时,我不断收到“无法验证应用程序”的消息。我已经安装了一个新的开发人员证书,并安装了配置文件(都是新生成的),但我不知道为什么我仍然会收到错误。
Anyone have any ideas as to where I'm going wrong?
任何人对我要去哪里有任何想法?
EDIT
编辑
I've recreated the certificate and profisioning profile, etc... The Build succeeds, and the status at the bottom gets all the way to 'Installing on Device', then two modal dialogs are displayed with the same "Application could not be verified" error message.
我重新创建了证书和配置文件等......构建成功,底部的状态一直到“在设备上安装”,然后两个模态对话框显示相同的“应用程序无法验证“ 错误信息。
Is there any output I can get to that will give me a precise error?
有没有我可以得到的输出会给我一个精确的错误?
EDIT
编辑
OK, I've got the appropriate log from Organizer showing the problem. It looks like I haven't set up the Entitlements.plist, but in xcode, I have. (I've added an Entitlements.plist fole, then unchecked get-task-allow, then added Entitlements.plist to the project settings under Code Signing Entitlements). The log is:
好的,我从 Organizer 获得了显示问题的相应日志。看起来我还没有设置 Entitlements.plist,但在 xcode 中,我有。(我添加了一个 Entitlements.plist 文件,然后取消选中 get-task-allow,然后将 Entitlements.plist 添加到代码签名权利下的项目设置中)。日志是:
Tue Jun 16 07:35:42 unknown mobile_installation_proxy[1162] <Error>: install_embedded_profile: Skipping the installation of the embedded profile
Tue Jun 16 07:35:42 unknown securityd[1158] <Error>: mobile_installat[1162] SecItemCopyMatching: missing entitlement
Tue Jun 16 07:35:42 unknown securityd[1158] <Error>: mobile_installat[1162] SecItemCopyMatching: missing entitlement
Tue Jun 16 07:35:42 unknown securityd[1158] <Error>: mobile_installat[1162] SecItemCopyMatching: missing entitlement
Tue Jun 16 07:35:42 unknown securityd[1158] <Error>: mobile_installat[1162] SecItemCopyMatching: missing entitlement
Tue Jun 16 07:35:43 unknown mobile_installation_proxy[1162] <Error>: entitlement 'get-task-allow' has value not permitted by a provisioning profile
Tue Jun 16 07:35:43 unknown mobile_installation_proxy[1162] <Error>: verify_executable: Could not validate signature: e8008016
Tue Jun 16 07:35:43 unknown mobile_installation_proxy[1162] <Error>: preflight_application_install: Could not verify /var/tmp/install_staging.1WIVsB/BouldrData.app/BouldrData
Tue Jun 16 07:35:43 unknown mobile_installation_proxy[1162] <Error>: install_application: Could not preflight application install
Tue Jun 16 07:35:43 unknown mobile_installation_proxy[1162] <Error>: handle_install: Installation failed
Tue Jun 16 07:51:53 unknown afcd[1181] <Error>: user mobile has uid 501
Tue Jun 16 07:51:53 unknown afcd[1181] <Error>: mode is 0x41e8
Can anyone shed any light on why this isn't working as expected?
任何人都可以解释为什么这不能按预期工作吗?
EDIT
编辑
Got the build working, but I've not accepted an answer yet, as I have no idea as to what's going on. Anyone with any idea as to what is going on?
构建工作正常,但我还没有接受答案,因为我不知道发生了什么。任何人都知道发生了什么?
采纳答案by Codebeef
From this thread on ADC:
get-task-allow, when signed into an application, allows other processes (like the debugger) to attach to your app. Distribution profiles require that this value be turned off, while development profiles require this value to be turned on (otherwise Xcode would never be able to launch and attach to your app).
get-task-allow 在登录应用程序时允许其他进程(如调试器)附加到您的应用程序。分发配置文件要求关闭此值,而开发配置文件要求打开此值(否则 Xcode 将永远无法启动并附加到您的应用程序)。
回答by Ruud Visser
My problem was actually that I already installed the app via a testflight on my phone, after removing the app it worked!
我的问题实际上是我已经通过手机上的 testflight 安装了该应用程序,在删除该应用程序后它可以工作了!
回答by Ali
I got it resolved by deleting already installed build from phone and then reinstall the build.
我通过从手机中删除已安装的构建然后重新安装构建来解决它。
回答by MikZ
Check if your iPhone properly provisioned. You may connect iPhone and launch Organizerfrom XCode (Main Menu -> Window -> Organizer) and then check PROVISIONING PROFILESinformation.
检查您的 iPhone 是否正确配置。您可以连接 iPhone 并从 XCode启动管理器(主菜单 -> 窗口 -> 管理器),然后检查PROVISIONING PROFILES信息。
After that you need to match Bundle Identifier(Project -> Info.plist) and your App ID. You may read this Apple Note Mismatch between App ID and Bundle Identifier
之后,您需要匹配Bundle Identifier(Project -> Info.plist) 和您的 App ID。您可以阅读这篇 Apple Note Mismatch between App ID and Bundle Identifier
I had similar message boxes (two in a row) when my Bundle Identifier was incorrect.
当我的捆绑标识符不正确时,我有类似的消息框(连续两个)。
回答by Jorge Israel Pe?a
Did you remember to expand Targets on the left of the project window, then right click on your app name > get info, then go to the Buildtab and under Code Signing, under Code Signing Identity, change the value of Any iPhone OS Deviceto what applies in your case? Also in the properties tab you should have your identifier set so that it matches the identifier you chose.
您是否记得在项目窗口左侧展开 Targets,然后右键单击您的应用程序名称 > get info,然后转到Build选项卡,在Code Signing下,在Code Signing Identity 下,将Any iPhone OS Device的值更改为什么适用于你的情况?同样在属性选项卡中,您应该设置您的标识符,以便它与您选择的标识符相匹配。
Don't know if that helps, that's the step I found missing in your description though.
不知道这是否有帮助,但我发现您的描述中缺少这一步。
回答by Steve Madsen
I know you've already checked some of this, but just so this answer is complete:
我知道您已经检查了其中的一些内容,但是这个答案是完整的:
- Check that the new provisioning profile and certificate is named at the targetlevel for each build setting you want to install on the device.
- Code Signing Entitlements must also be defined at the targetlevel, not the project.
- Double check your build log, looking for a line that includes CodeSign. Verify it is there and using the certificate you expect.
- If all else fails, remove the code signing identity from your target, clean all targets, delete any build directories from your project, quit and restart Xcode, replace the code signing identity, and try your build again.
- 检查新的配置文件和证书是否在目标级别为要安装在设备上的每个构建设置命名。
- 代码签名权利也必须在目标级别而不是项目级别定义。
- 仔细检查您的构建日志,寻找包含 CodeSign 的行。验证它是否存在并使用您期望的证书。
- 如果所有其他方法都失败了,请从目标中删除代码签名标识,清除所有目标,从项目中删除所有构建目录,退出并重新启动 Xcode,替换代码签名标识,然后再次尝试构建。
回答by Alan
In addition to verifying the code signing, be sure to go to the Build menu and run "Clean all targets". Xcode gets mixed up from time to time.
除了验证代码签名外,请务必转到“构建”菜单并运行“清除所有目标”。Xcode 会时不时地混淆。
回答by Jeff Klein
Problem solved (at least for me!)
问题解决了(至少对我来说!)
Export Developer profile on machine that works, then import on machine with the problem. Done through Preferences/Accounts, Gear icon on the bottom.
在工作的机器上导出开发人员配置文件,然后在有问题的机器上导入。通过首选项/帐户,底部的齿轮图标完成。
回答by nyarasha
Going into Window > Devices and looking at the Installed Apps, I was able to find out that my app was already installed. Select the app and hit '-' to remove it from the device. Try rebuilding your app with that device as the target.
进入窗口 > 设备并查看已安装的应用程序,我能够发现我的应用程序已经安装。选择应用程序并点击“-”将其从设备中删除。尝试以该设备为目标重新构建您的应用程序。
Worked for me, even though from the phone I couldn't find where the app was installed!
对我来说有效,即使在电话中我找不到应用程序的安装位置!
回答by Aks
"The application could not be verified" , in your device there could be already an app installed with the same bundle identifier.
“无法验证应用程序”,您的设备中可能已经安装了具有相同捆绑标识符的应用程序。
I got this issue because my had app from App store& I was testing its update Version from Xcode.& with same identifier as in my live app .
我遇到这个问题是因为我有来自 App Store 的应用程序&我正在从 Xcode.& 测试它的更新版本,其标识符与我的实时应用程序中的标识符相同。
So Simple solution Just delete the App & install again.. ....
如此简单的解决方案只需删除应用程序并重新安装......