xcode “应用程序安装失败:无法检查应用程序包”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26249441/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 05:48:28  来源:igfitidea点击:

"App installation failed: Could not inspect application package"

iosxcodexcode6

提问by daviesgeek

When doing a Build & Run from Xcode to my iPhone, Xcode continually gives me this error:

在从 Xcode 执行 Build & Run 到我的 iPhone 时,Xcode 不断给我这个错误:

After it gives me the error, there are no console errors and I can run it again; it's fine and deploys to the device without a problem.

在它给我错误之后,没有控制台错误,我可以再次运行它;很好,可以毫无问题地部署到设备上。

I'm at a loss as to how to fix this. I have tried the solutions in the question here, here, hereand here.

我不知道如何解决这个问题。我已经在这里这里这里这里尝试了问题中的解决方案。

I've performed a Clean& a Clean Build Folder. I've removed all the files from the workspace, and re-added them. I have checked the bundle identifier and even tried changing it. I tried re-installing Xcode, deleting the app from the device, restarting my iPhone and re-installing the app.

我已经执行了 a Clean& a Clean Build Folder。我已经从工作区中删除了所有文件,并重新添加了它们。我检查了包标识符,甚至尝试更改它。我尝试重新安装 Xcode,从设备中删除该应用程序,重新启动我的 iPhone 并重新安装该应用程序。

I'm using Xcode 6.0.1 on a MacBook Pro running 10.9.5 with an iPhone 6 running iOS 8.0.2. I am also using CocoaPods version 0.34.1.

我在运行 10.9.5 的 MacBook Pro 和运行 iOS 8.0.2 的 iPhone 6 上使用 Xcode 6.0.1。我也在使用 CocoaPods 0.34.1 版。

Does anyone have any ideas?

有没有人有任何想法?

Here are the logs as suggested. The first one is from a normal build that runs fine; the second throws an error:

以下是建议的日志。第一个来自运行良好的正常构建;第二个抛出错误:

10/8/14 21:56:23.413 Xcode[89196]: AMDeviceSecureInstallApplicationBundle (thread 0x11954a000): ENTRY, options: {
    PackageType = Developer;
    ShadowParentKey = "file:///var/folders/4_/c486ynzs79j339w5fkccjkv00000gn/C/com.apple.DeveloperTools/6.0.1/Xcode/";
}
10/8/14 21:56:23.416 Xcode[89196]: AMDeviceSecureInstallApplicationBundle (thread 0x11954a000): device os is at least 7.0
10/8/14 21:56:23.416 Xcode[89196]: createShadowPath (thread 0x11954a000): ENTRY bundle: /Users/matthewdavies/Library/Developer/Xcode/DerivedData/Le_Camera-bfqfzezscvpmaxdceudixqcuvokd/Build/Products/Debug-iphoneos/Le?? Camera.app
10/8/14 21:56:23.416 Xcode[89196]: create_shadow_dir_path (thread 0x11954a000): bundle: /Users/matthewdavies/Library/Developer/Xcode/DerivedData/Le_Camera-bfqfzezscvpmaxdceudixqcuvokd/Build/Products/Debug-iphoneos/Le?? Camera.app
10/8/14 21:56:23.416 Xcode[89196]: createShadowPath (thread 0x11954a000): returning: /var/folders/4_/c486ynzs79j339w5fkccjkv00000gn/C/com.apple.DeveloperTools/6.0.1/Xcode/a5d81d2c36f0db5ba32cf71be1cf7a86/ae8735d27401ee958a0e977fc19469991b1e08fe/Le?? Camera.app
10/8/14 21:56:23.416 Xcode[89196]: createSiblingInPath (thread 0x11954a000): returning: /var/folders/4_/c486ynzs79j339w5fkccjkv00000gn/C/com.apple.DeveloperTools/6.0.1/Xcode/a5d81d2c36f0db5ba32cf71be1cf7a86/ae8735d27401ee958a0e977fc19469991b1e08fe/ManifestCache.plist
10/8/14 21:56:23.458 Xcode[89196]: createSiblingInPath (thread 0x11954a000): returning: /var/folders/4_/c486ynzs79j339w5fkccjkv00000gn/C/com.apple.DeveloperTools/6.0.1/Xcode/a5d81d2c36f0db5ba32cf71be1cf7a86/ae8735d27401ee958a0e977fc19469991b1e08fe/InstalledAppInfo
10/8/14 21:56:23.459 Xcode[89196]: AMDeviceSecureInstallApplicationBundle (thread 0x11954a000): no old package to delta against, falling back to old skool install
10/8/14 21:56:23.460 Xcode[89196]: AMDeviceSecureInstallApplicationBundle (thread 0x11954a000): Blasting the bundle over to the device in an old skool way
10/8/14 21:56:25.321 Xcode[89196]: _AMDeviceUpdateOldPackage (thread 0x11954a000): copy_new_to_shadow: TRUE
10/8/14 21:56:25.367 Xcode[89196]: _AMDeviceUpdateOldPackage (thread 0x11954a000): copying:
/Users/matthewdavies/Library/Developer/Xcode/DerivedData/Le_Camera-bfqfzezscvpmaxdceudixqcuvokd/Build/Products/Debug-iphoneos/Le?? Camera.app
to
/var/folders/4_/c486ynzs79j339w5fkccjkv00000gn/C/com.apple.DeveloperTools/6.0.1/Xcode/a5d81d2c36f0db5ba32cf71be1cf7a86/ae8735d27401ee958a0e977fc19469991b1e08fe
10/8/14 21:56:25.403 Xcode[89196]: createSiblingInPath (thread 0x11954a000): returning: /var/folders/4_/c486ynzs79j339w5fkccjkv00000gn/C/com.apple.DeveloperTools/6.0.1/Xcode/a5d81d2c36f0db5ba32cf71be1cf7a86/ae8735d27401ee958a0e977fc19469991b1e08fe/InstalledAppInfo
10/8/14 21:56:25.406 Xcode[89196]: writeDictToFile:1258 ==== Successfully wrote Manifest cache to /var/folders/4_/c486ynzs79j339w5fkccjkv00000gn/C/com.apple.DeveloperTools/6.0.1/Xcode/a5d81d2c36f0db5ba32cf71be1cf7a86/ae8735d27401ee958a0e977fc19469991b1e08fe/ManifestCache.plist
10/8/14 21:56:25.407 Xcode[89196]: AMDeviceSecureInstallApplicationBundle (thread 0x11954a000): returning 0x00000000
10/8/14 21:56:27.366 tccd[328]: Unable to verify code signing identity of com.apple.dt.Xcode:  code failed to satisfy specified code requirement(s)

When Xcode throws an error:

当 Xcode 抛出错误时:

10/8/14 21:56:58.065 Xcode[89196]: AMDeviceSecureInstallApplicationBundle (thread 0x112e35000): ENTRY, options: {
    PackageType = Developer;
    ShadowParentKey = "file:///var/folders/4_/c486ynzs79j339w5fkccjkv00000gn/C/com.apple.DeveloperTools/6.0.1/Xcode/";
}
10/8/14 21:56:58.069 Xcode[89196]: AMDeviceSecureInstallApplicationBundle (thread 0x112e35000): device os is at least 7.0
10/8/14 21:56:58.069 Xcode[89196]: createShadowPath (thread 0x112e35000): ENTRY bundle: /Users/matthewdavies/Library/Developer/Xcode/DerivedData/Le_Camera-bfqfzezscvpmaxdceudixqcuvokd/Build/Products/Debug-iphoneos/Le?? Camera.app
10/8/14 21:56:58.070 Xcode[89196]: create_shadow_dir_path (thread 0x112e35000): bundle: /Users/matthewdavies/Library/Developer/Xcode/DerivedData/Le_Camera-bfqfzezscvpmaxdceudixqcuvokd/Build/Products/Debug-iphoneos/Le?? Camera.app
10/8/14 21:56:58.070 Xcode[89196]: createShadowPath (thread 0x112e35000): returning: /var/folders/4_/c486ynzs79j339w5fkccjkv00000gn/C/com.apple.DeveloperTools/6.0.1/Xcode/a5d81d2c36f0db5ba32cf71be1cf7a86/ae8735d27401ee958a0e977fc19469991b1e08fe/Le?? Camera.app
10/8/14 21:56:58.070 Xcode[89196]: createSiblingInPath (thread 0x112e35000): returning: /var/folders/4_/c486ynzs79j339w5fkccjkv00000gn/C/com.apple.DeveloperTools/6.0.1/Xcode/a5d81d2c36f0db5ba32cf71be1cf7a86/ae8735d27401ee958a0e977fc19469991b1e08fe/ManifestCache.plist
10/8/14 21:56:58.197 Xcode[89196]: createSiblingInPath (thread 0x112e35000): returning: /var/folders/4_/c486ynzs79j339w5fkccjkv00000gn/C/com.apple.DeveloperTools/6.0.1/Xcode/a5d81d2c36f0db5ba32cf71be1cf7a86/ae8735d27401ee958a0e977fc19469991b1e08fe/InstalledAppInfo
10/8/14 21:56:58.198 Xcode[89196]: AMDeviceSecureInstallApplicationBundle (thread 0x112e35000): calling MDMCreateDeltaDirectoryForDevice with (
    "Info.plist",
    "ResourceRules.plist",
    CodeResources,
    "_CodeSignature/CodeResources"
)
10/8/14 21:56:58.198 Xcode[89196]: AMDeviceSecureInstallApplicationBundle (thread 0x112e35000): dst_ipa_container: /var/folders/4_/c486ynzs79j339w5fkccjkv00000gn/C/com.apple.DeveloperTools/6.0.1/Xcode/Le?? Camera.app.KLv2tc
dst_ipa: /var/folders/4_/c486ynzs79j339w5fkccjkv00000gn/C/com.apple.DeveloperTools/6.0.1/Xcode/Le?? Camera.app.KLv2tc/Le?? Camera.app_sparse.ipa
10/8/14 21:56:58.198 Xcode[89196]: AMDeviceSecureInstallApplicationBundle (thread 0x112e35000): diffing /Users/matthewdavies/Library/Developer/Xcode/DerivedData/Le_Camera-bfqfzezscvpmaxdceudixqcuvokd/Build/Products/Debug-iphoneos/Le?? Camera.app
10/8/14 21:56:58.198 Xcode[89196]: MDMCreateDeltaDirectory:1840 calling MDMDirectoryDiff with:
state->old_bundle: /var/folders/4_/c486ynzs79j339w5fkccjkv00000gn/C/com.apple.DeveloperTools/6.0.1/Xcode/a5d81d2c36f0db5ba32cf71be1cf7a86/ae8735d27401ee958a0e977fc19469991b1e08fe/Le?? Camera.app
state->new_bundle: /Users/matthewdavies/Library/Developer/Xcode/DerivedData/Le_Camera-bfqfzezscvpmaxdceudixqcuvokd/Build/Products/Debug-iphoneos/Le?? Camera.app
state->dst_bundle: /var/folders/4_/c486ynzs79j339w5fkccjkv00000gn/C/com.apple.DeveloperTools/6.0.1/Xcode/Le?? Camera.app.KLv2tc/Le?? Camera.app_sparse.ipa/Payload//Le?? Camera.app, binaryDiff flag: FALSE
    dst_ipa: /var/folders/4_/c486ynzs79j339w5fkccjkv00000gn/C/com.apple.DeveloperTools/6.0.1/Xcode/Le?? Camera.app.KLv2tc/Le?? Camera.app_sparse.ipa
10/8/14 21:56:58.198 Xcode[89196]: createDictFromFile:1303 ==== Successfully read Manifest cache at /var/folders/4_/c486ynzs79j339w5fkccjkv00000gn/C/com.apple.DeveloperTools/6.0.1/Xcode/a5d81d2c36f0db5ba32cf71be1cf7a86/ae8735d27401ee958a0e977fc19469991b1e08fe/ManifestCache.plist
10/8/14 21:56:58.199 Xcode[89196]: __MDMDirectoryDiff_block_invoke29:1414 calling writeDictToFile with: /var/folders/4_/c486ynzs79j339w5fkccjkv00000gn/C/com.apple.DeveloperTools/6.0.1/Xcode/Le?? Camera.app.KLv2tc/Le?? Camera.app_sparse.ipa/ManifestCache.plist
10/8/14 21:56:58.199 Xcode[89196]: writeDictToFile:1258 ==== Successfully wrote Manifest cache to /var/folders/4_/c486ynzs79j339w5fkccjkv00000gn/C/com.apple.DeveloperTools/6.0.1/Xcode/Le?? Camera.app.KLv2tc/Le?? Camera.app_sparse.ipa/ManifestCache.plist
10/8/14 21:56:58.539 Xcode[89196]: AMDErrorForMobileInstallationCallbackDict (thread 0x10c8ce000): GOT AN ERROR 0xe8000051
10/8/14 21:56:58.549 Xcode[89196]: SZConduit: _MonitorResultDispatchFunction:140 (0x0x10c8ce000): Got error from service: InstallationFailed
10/8/14 21:56:58.549 Xcode[89196]: _AMDeviceTransferAndInstall (thread 0x10a081000): SZConduitSendPathWithPreflight failed: 0xe8000051
10/8/14 21:56:58.549 Xcode[89196]: AMDeviceSecureInstallApplicationBundle (thread 0x112e35000): Install failed on device: e8000051, removing shadow directory
10/8/14 21:56:58.556 Xcode[89196]: AMDeviceSecureInstallApplicationBundle (thread 0x112e35000): returning 0xe8000051

UPDATE: I found the Xcode logs in Window > Devices:

更新:我在“窗口”>“设备”中找到了 Xcode 日志:

Oct 11 15:55:46 Matthews-iPhone installd[43] <Error>: 0x100524000 -[MIBundle _validateWithError:]: 28: Failed to load Info.plist from bundle at path /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.uhnTux/extracted/Payload/Le? Camera.app
Oct 11 15:55:46 Matthews-iPhone installd[43] <Error>: 0x100524000 +[MIInstallable installablesAtURL:packageFormat:userOptions:error:]: Failed to create bundle for file:///private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.uhnTux/extracted/Payload/Le%CC%81%20Camera.app/ : Error Domain=MIInstallerErrorDomain Code=35 "Failed to load Info.plist from bundle at path /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.uhnTux/extracted/Payload/Le? Camera.app" UserInfo=0x14fd07380 {LegacyErrorString=PackageInspectionFailed, FunctionName=-[MIBundle _validateWithError:], SourceFileLine=28, NSLocalizedDescription=Failed to load Info.plist from bundle at path /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.uhnTux/extracted/Payload/Le? Camera.app}
Oct 11 15:55:46 Matthews-iPhone streaming_zip_conduit[192] <Error>: 0x100384000 __MobileInstallationInstallForLaunchServices_block_invoke240: Returned error Error Domain=MIInstallerErrorDomain Code=35 "Failed to load Info.plist from bundle at path /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.uhnTux/extracted/Payload/Le? Camera.app" UserInfo=0x157614c30 {LegacyErrorString=PackageInspectionFailed, FunctionName=-[MIBundle _validateWithError:], SourceFileLine=28, NSLocalizedDescription=Failed to load Info.plist from bundle at path /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.uhnTux/extracted/Payload/Le? Camera.app}
Oct 11 15:55:46 Matthews-iPhone streaming_zip_conduit[192] <Warning>: ERROR: MobileInstallationInstallForLaunchServices returned nil
Oct 11 15:55:46 Matthews-iPhone streaming_zip_conduit[192] <Warning>: __dispatch_source_read_socket_block_invoke:203: Failed to install application at file:///var/mobile/Media/PublicStaging/Le%CC%81%20Camera.app_sparse.ipa/ : Error Domain=LaunchServicesError Code=0 "The operation couldn't be completed. (LaunchServicesError error 0.)" UserInfo=0x157611d20 {Error=PackageInspectionFailed, ErrorDescription=Failed to load Info.plist from bundle at path /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.uhnTux/extracted/Payload/Le? Camera.app}
Oct 11 15:55:51 Matthews-iPhone locationd[58] <Notice>: Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0

采纳答案by daviesgeek

Looks like the problem was caused by an "é" character in the name of the app. I changed the name of the app, and that fixed it.

看起来问题是由应用程序名称中的“é”字符引起的。我更改了应用程序的名称,并修复了它。

回答by Shashikant More

Go to Window->Projects (xcode6.3.2) and look for your project and delete 'Derived Data' for all your projects with the same name.

转到 Window->Projects (xcode6.3.2) 并查找您的项目并删除所有同名项目的“派生数据”。

I had the same problem, and it works for me.

我有同样的问题,它对我有用。

If above doesn't work try following:

如果以上不起作用,请尝试以下操作:

  1. Prodct => Clean
  2. Check for your product name. If there are non-latin characters or space then remove it.
  3. If you have moved or copied a folder named resources or resource into your project, try renaming it. Then perform a clean.
  1. 产品 => 清洁
  2. 检查您的产品名称。如果有非拉丁字符或空格,则将其删除。
  3. 如果您已将名为资源或资源的文件夹移动或复制到您的项目中,请尝试重命名它。然后执行清洁。

回答by ThomasW

I just ran into this problem and for me the problem was revealed by the device log I mentioned above. The problem was that I previously had a (pseudo) .framework copied into my application bundle that wasn't necessary and was causing the error. Doing a clean wasn't removing the .framework. Instead going to Windows->Organizer selecting my project and clicking the Delete button for Derived Data fixed the problem.

我刚刚遇到了这个问题,对我来说,问题是由我上面提到的设备日志揭示的。问题是我之前有一个(伪) .framework 复制到我的应用程序包中,这不是必需的,并且导致了错误。进行清理并不是删除 .framework。而不是转到 Windows->Organizer 选择我的项目并单击派生数据的删除按钮修复了问题。

回答by David K. Haas

I think, that problem is with wrong copying the files to the project. Because, when i copied the files to the project and in the navigation menu displays a question mark next to file, run of app displays this error. But when i copy the files correctly and displays something other next to copying files, everything works. But when you have some characters of {ě,?,?,?,?,y,á,í,é,ú,?} in the project name and problem still be, try to rename without these chars and after should be mistake out.

我认为,问题在于将文件错误地复制到项目中。因为,当我将文件复制到项目并在导航菜单中在文件旁边显示一个问号时,应用程序运行会显示此错误。但是当我正确复制文件并在复制文件旁边显示其他内容时,一切正常。但是当您在项目名称中有一些字符 {ě,?,?,?,?,y,á,í,é,ú,?} 并且问题仍然存在时,请尝试在没有这些字符的情况下重命名,之后应该是错误的出去。

回答by nkbit

Faced the same problem, updating project to recommended settings fixed that.

面对同样的问题,将项目更新为推荐的设置解决了这个问题。