xcode 无法将应用程序部署到 ios 8 设备
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25999433/
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 deploy app to ios 8 device
提问by Templar
Just updated an iPad Mini to iOS 8 and suddenly can't debug my app on it with XCode 6.0.1.
The error in Xcode is App installation failed
with An unknown error has occurred.
. On the device the app remains greyed out.
刚刚将 iPad Mini 更新到 iOS 8,突然无法使用 XCode 6.0.1 调试我的应用程序。在Xcode的错误是App installation failed
用An unknown error has occurred.
。在设备上,应用程序保持灰色。
Tried to :
试着 :
- delete the app from ipad ( was working before )
- Soft reset and reboot the device
- Delete derived data and clean
- Reboot the mac
- reinstall xcode
- change the bundle id and product name
- Recreate the dev certificates and provisioning profiles
- 从 ipad 中删除应用程序(之前工作过)
- 软复位并重启设备
- 删除派生数据并清理
- 重新启动 Mac
- 重新安装xcode
- 更改捆绑包 ID 和产品名称
- 重新创建开发证书和配置文件
With iOS 6 and iOS 7 devices works fine, also, can debug other projects too, but not this one, so I'm getting desperate.
使用 iOS 6 和 iOS 7 设备工作正常,也可以调试其他项目,但不是这个,所以我很绝望。
Any idea ?
任何的想法 ?
Console log:
控制台日志:
23/09/14 18:24:16,617 Xcode[421]: createShadowPath (thread 0x12a2f6000): returning: /var/folders/lq/1z47wljj77gbhhrhc9z_yylw0000gn/C/com.apple.DeveloperTools/6.0.1/Xcode/942f46185227b6e098ea41a4548a0649/e269ac837383a4b805c1e212d18ffe36483ab24a/TDev.app
23/09/14 18:24:16,617 Xcode[421]: createSiblingInPath (thread 0x12a2f6000): returning: /var/folders/lq/1z47wljj77gbhhrhc9z_yylw0000gn/C/com.apple.DeveloperTools/6.0.1/Xcode/942f46185227b6e098ea41a4548a0649/e269ac837383a4b805c1e212d18ffe36483ab24a/ManifestCache.plist
23/09/14 18:24:16,690 Xcode[421]: _AMDeviceCopyInstalledAppInfo (thread 0x12a2f6000): no app info
23/09/14 18:24:16,693 Xcode[421]: AMDeviceSecureInstallApplicationBundle (thread 0x12a2f6000): unable to get installed app info, falling back to old skool install
23/09/14 18:24:16,693 Xcode[421]: AMDeviceSecureInstallApplicationBundle (thread 0x12a2f6000): Blasting the bundle over to the device in an old skool way
23/09/14 18:24:27,005 Xcode[421]: AMDErrorForMobileInstallationCallbackDict (thread 0x114564000): GOT AN ERROR 0xe800003a
23/09/14 18:24:27,032 Xcode[421]: SZConduit: _MonitorResultDispatchFunction:140 (0x0x114564000): Got error from service: InstallationFailed
23/09/14 18:24:27,033 Xcode[421]: _AMDeviceTransferAndInstall (thread 0x12a2f6000): SZConduitSendPathWithPreflight failed: 0xe8008001
23/09/14 18:24:27,051 Xcode[421]: writeDictToFile:1258 ==== Successfully wrote Manifest cache to /var/folders/lq/1z47wljj77gbhhrhc9z_yylw0000gn/C/com.apple.DeveloperTools/6.0.1/Xcode/942f46185227b6e098ea41a4548a0649/e269ac837383a4b805c1e212d18ffe36483ab24a/ManifestCache.plist
23/09/14 18:24:27,053 Xcode[421]: AMDeviceSecureInstallApplicationBundle (thread 0x12a2f6000): returning 0xe8008001
Edit:
编辑:
It seems that the regeneration of the certificates was the solution but after Clean there was necessary a Clean Build Folder too, which solved the issue (for now at least).
似乎证书的重新生成是解决方案,但在 Clean 之后,也需要一个 Clean Build 文件夹,它解决了这个问题(至少现在是这样)。
回答by tiluki
Just to add (and thanks to everyone for the hints given here) that systematicallyfinding out the cause of this was key for me resolving this.
只是补充一下(并感谢每个人在这里给出的提示),系统地找出原因是我解决这个问题的关键。
Using the “Devices” Window in Xcode6 to then connect to the plugged in iPhone allows you to view the live log - once you have selected the iPhone click on the tiny up-arrow icon at the bottom. In my case the output was as shown below, strongly indicating that “Failed to verify code signature…” of one of my (custom) bundled frameworks was at the crux of the problem.
使用 Xcode6 中的“设备”窗口然后连接到插入的 iPhone 允许您查看实时日志 -一旦您选择了 iPhone,点击底部的向上箭头图标。在我的例子中,输出如下所示,强烈表明我的一个(自定义)捆绑框架的“无法验证代码签名......”是问题的关键。
This lead me to check and find out it was nothing to do with out of date certificates (everything was in date) nor any left-over DerivedData or temp build files (although always good to do a clean!)
这让我检查并发现它与过时的证书无关(所有内容都已过期),也与任何剩余的 DerivedData 或临时构建文件无关(尽管进行清理总是好的!)
It was the fact that my custom framework's “CFBundleExecutable” had a typo - so signing was actually throwing an error. This is not immediately reported in Xcode - even if the tick box is on for your embedded frameworks to "Code sign on copy". Try signing a framework separately on the command line and it will tell you!
事实上,我的自定义框架的“CFBundleExecutable”有一个错字——所以签名实际上是在抛出一个错误。这不会立即在 Xcode 中报告 - 即使您的嵌入式框架勾选了“复制时代码签名”。尝试在命令行上单独签署一个框架,它会告诉你!
Jul 13 09:40:43 Tims-iPhone installd[2302] <Notice>: 0x10048c000 -[MIClientConnection _doBackgroundInstallationForPath:withOptions:completion:]: Install of "/var/mobile/Media/PublicStaging/miin.app" type Developer requested by streaming_zip_conduit (pid 2303)
Jul 13 09:40:43 Tims-iPhone installd[2302] <Notice>: 0x10048c000 -[MIInstaller performInstallationWithError:]: Installing <MIInstallableBundle ID=com.timlukins.miin; Version=1, ShortVersion=1.0>
Jul 13 09:40:44 Tims-iPhone profiled[2107] <Notice>: (Note ) MC: Provisioning profiles changed
Jul 13 09:40:44 Tims-iPhone installd[2302] <Error>: SecTrustEvaluate [leaf CriticalExtensions IssuerCommonName]
Jul 13 09:40:44 Tims-iPhone installd[2302] <Error>: SecTrustEvaluate [leaf CriticalExtensions IssuerCommonName]
Jul 13 09:40:44 Tims-iPhone installd[2302] <Error>: unrecognized status -67049 from codesigning library
Jul 13 09:40:44 Tims-iPhone installd[2302] <Error>: 0x10048c000 -[MICodeSigningVerifier performValidationWithError:]: 188: Failed to verify code signature of <MIExecutableBundle : path = /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.J7tWkl/extracted/miin.app/Frameworks/libmiincore.framework identifier = com.timlukins.libmiincore type = Framework> : 0xe8008001 (Unknown error)
Jul 13 09:40:44 Tims-iPhone installd[2302] <Error>: 0x10048c000 -[MIInstaller performInstallationWithError:]: Verification stage failed
Jul 13 09:40:44 Tims-iPhone streaming_zip_conduit[2303] <Error>: 0x100484000 __MobileInstallationInstallForLaunchServices_block_invoke240: Returned error Error Domain=MIInstallerErrorDomain Code=13 "Failed to verify code signature of <MIExecutableBundle : path = /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.J7tWkl/extracted/miin.app/Frameworks/libmiincore.framework identifier = com.timlukins.libmiincore type = Framework> : 0xe8008001 (Unknown error)" UserInfo=0x12ee1fa30 {LibMISErrorNumber=-402620415, LegacyErrorString=ApplicationVerificationFailed, SourceFileLine=188, FunctionName=-[MICodeSigningVerifier performValidationWithError:], NSLocalizedDescription=Failed to verify code signature of <MIExecutableBundle : path = /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.J7tWkl/extracted/miin.app/Frameworks/libmiincore.framework identifier = com.timlukins.libmiincore type = Framework> : 0xe8008001 (Unknown error)}
Jul 13 09:40:44 Tims-iPhone streaming_zip_conduit[2303] <Warning>: ERROR: MobileInstallationInstallForLaunchServices returned nil
Jul 13 09:40:44 Tims-iPhone streaming_zip_conduit[2303] <Warning>: __dispatch_source_read_socket_block_invoke:203: Failed to install application at file:///var/mobile/Media/PublicStaging/miin.app/ : Error Domain=LaunchServicesError Code=0 "The operation couldn't be completed. (LaunchServicesError error 0.)" UserInfo=0x12ed20140 {Error=ApplicationVerificationFailed, ErrorDetail=-402620415, ErrorDescription=Failed to verify code signature of <MIExecutableBundle : path = /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.J7tWkl/extracted/miin.app/Frameworks/libmiincore.framework identifier = com.timlukins.libmiincore type = Framework> : 0xe8008001 (Unknown error)}
回答by EPage_Ed
I just got hit by this with Xcode 7.2. Looking at the device console log pointed to a 3rd party framework in CocoaPods. Did a "pod update" and all is good now.
我刚刚在 Xcode 7.2 中遇到了这个问题。查看设备控制台日志指向 CocoaPods 中的第 3 方框架。做了一个“吊舱更新”,现在一切都很好。
回答by Stewart
My experience to get a fix for what it's worth... Xcode 7.3
我获得修复它的价值的经验...... Xcode 7.3
I had a very annoying pod that was no longer in use so made sure it was removed from frameworks. Next - CocoaPods complained about the Frameworks in use - so made sure I was running the latest Ruby I have (2.1.2 in my case), then did the following:
我有一个非常烦人的 pod 不再使用,所以确保它从框架中删除。接下来 - CocoaPods 抱怨正在使用的框架 - 所以确保我运行的是我拥有的最新 Ruby(在我的例子中是 2.1.2),然后执行以下操作:
- Updated pods
- 'Product'-> 'Clean'
- Opt 'Product'-> 'Clean'
- Deleted all derived data
- 更新的豆荚
- “产品”->“清洁”
- 选择“产品”->“清洁”
- 删除了所有派生数据
Solution worked - One thing I noticed though - when I tried this first I got a permissions error when trying the Opt 'Product'-> 'Clean'. Hence the 'delete "all" derived data, rather than just the projects...
解决方案奏效了 - 我注意到的一件事 - 当我第一次尝试这个时,我在尝试 Opt 'Product'->'Clean' 时遇到了权限错误。因此,“删除“所有”派生数据,而不仅仅是项目......
No idea why it worked, but thought I'd share in case it helps someone.
不知道它为什么有效,但我想我会分享以防它对某人有帮助。
回答by Leandro
Do you use any external library or SDK? Maybe you have a library that isn't supporting iOS 8.
您是否使用任何外部库或 SDK?也许您有一个不支持 iOS 8 的库。
If I were you, I'd create a new project, just for testing purposes, with a single view and check if it runs in iOS 8 with my Xcode in my computer. If it runs ok, then the problem is just in your actual project.
如果我是你,我会创建一个新项目,仅用于测试目的,使用单个视图并检查它是否在 iOS 8 中使用我的计算机中的 Xcode 运行。如果它运行正常,那么问题就出在您的实际项目中。
回答by ABeanSits
I had the same issue and it was related to the provisioning process. My project was connected to two developer accounts and on one of them had expired certificates.
我有同样的问题,它与配置过程有关。我的项目连接到两个开发人员帐户,其中一个的证书已过期。
To solve the issue I had to remove one of the accounts and chose the specific 'Signing Identity' in 'Build Settings'. I don't know if it's a requirement but during this process I deleted the projects 'Derived Data'.
为了解决这个问题,我必须删除其中一个帐户并在“构建设置”中选择特定的“签名身份”。我不知道这是否是一项要求,但在此过程中我删除了“派生数据”项目。
回答by Yasuo Shimizu
I wasted over 3 days, now I resolve same issue. In my case, my project has 3rd party frameworks (my case is Dropbox).
我浪费了 3 天多,现在我解决了同样的问题。就我而言,我的项目有 3rd 方框架(我的案例是 Dropbox)。
Probably Xcode requires signing to each embedded frameworks at "Build phases/ Copy files". Or embedded code is too old to copy to Xcode build.
Xcode 可能需要在“构建阶段/复制文件”中对每个嵌入式框架进行签名。或者嵌入的代码太旧而无法复制到 Xcode 版本。
回答by dchakarov
In my case the problem was I had no space left on the device. Hope that helps someone else.
就我而言,问题是我的设备上没有剩余空间。希望能帮助别人。
回答by Ghulam Rasool
In my case I just updated cocoa pods and it worked. Please update pods and check again.
就我而言,我刚刚更新了可可豆荚并且它起作用了。请更新 Pod 并再次检查。
回答by derdida
Ill just run "pod update" again when using Cocoapods. Tested with Xcode 7.3.
使用 Cocoapods 时,我会再次运行“pod update”。使用 Xcode 7.3 测试。
回答by Jesus Rodriguez
If there is anyone using the User Notification Extensions or Content in iOS 10and then deleted the folders/files that XCode generates for you. You may get the same error: App installation failed with An unknown error has occurred
如果有人在iOS 10 中使用用户通知扩展或内容,然后删除了 XCode 为您生成的文件夹/文件。您可能会收到相同的错误: 应用程序安装失败,出现未知错误
Then go to your project targets and delete the target that the Extension/Content generates. Sometimes, if you try to do that, XCode will crash. I spend about an hour trying to figure out why... eg: Cleaning build folders and derived data folders. What fixed it was to remove the UserNotification Frameworksthat were linked to that Scheme. Only then, I was able to delete the said scheme.
然后转到您的项目目标并删除扩展/内容生成的目标。有时,如果您尝试这样做,XCode 会崩溃。我花了大约一个小时试图找出原因... 例如:清理构建文件夹和派生数据文件夹。修复它的是删除链接到该方案的UserNotification 框架。只有这样,我才能删除上述方案。
In my case, I only needed the extension, so I deleted the target highlighted with gray.
就我而言,我只需要扩展名,所以我删除了以灰色突出显示的目标。