无法在模拟器 xcode 9 beta 中安装应用程序

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

Unable to install app in simulator xcode 9 beta

iosxcodeios-simulatorxcode9-betaxcode9

提问by Akshay Sunderwani

I downloaded Xcode 9 beta recently, and when I tried to run my app in the simulator it is not getting installed. I am getting this error in my Xcode every time I try to run the app.enter image description here

我最近下载了 Xcode 9 beta,当我尝试在模拟器中运行我的应用程序时,它没有被安装。每次尝试运行该应用程序时,我的 Xcode 都会出现此错误。在此处输入图片说明

Any help provided will be appreciated. Thanks in advance.

提供的任何帮助将不胜感激。提前致谢。

P.S: Application used to work in Xcode 8.3.3

PS:应用程序曾经在 Xcode 8.3.3 中工作

回答by Jeremy Huddleston Sequoia

Unfortunately, the error message doesn't explain whythe install failed. You can take a look at ~/Library/Logs/CoreSimulator/CoreSimulator.log to see if the rest of the error message is there with more info. If not, you should check out the sim device's system log:

不幸的是,该错误信息并不能解释为什么在安装失败。您可以查看 ~/Library/Logs/CoreSimulator/CoreSimulator.log 以查看错误消息的其余部分是否包含更多信息。如果没有,您应该查看 SIM 设备的系统日志:

sudo xcode-select -s /Applications/Xcode-beta.app # if you haven't already
xcrun simctl spawn booted log show

You can use --predicateto filter that down a bit.

你可以用它--predicate来过滤一下。

回答by Nitin Gohel

Late answer but might be that can be useful for others. I just get a project with existing watch-kit and custom keyboard code. After change the identifier i got the same error and i spend 1 day to find out why that happens.

迟到的答案,但可能对其他人有用。我刚刚得到一个带有现有手表套件和自定义键盘代码的项目。更改标识符后,我遇到了同样的错误,我花了 1 天时间找出发生这种情况的原因。

I checked everything of bundle id and all version. then i do global search in xcode with old identifier and i found that following.

我检查了 bundle id 和所有版本的所有内容。然后我使用旧标识符在 xcode 中进行全局搜索,我发现以下内容。

enter image description here

在此处输入图片说明

Here in both .plist file have old WKCompanionAppBundleIdentifierso after i update it with new manually application run again.

在这两个 .plist 文件中都有旧的WKCompanionAppBundleIdentifier所以在我用新的手动应用程序更新它之后再次运行。

IMPORTANT NOTE:

重要的提示:

IF YOU ARE JUST CHANGE IDENTIFIER FROM GENERAL TAB THAT DOES NOT MEAN IT UPDATE AT ALL. KINDLY CHECK WITH ALL POSSIBLE PLACES BY SEARCH AND REPLACE IT WITH NEW IDENTIFIER.

如果您只是从通用选项卡更改标识符,那并不意味着它根本没有更新。请通过搜索检查所有可能的位置并将其替换为新的标识符。

XCODE VERSIO: Version 9.0 (9A235)

回答by Frank Tinsley

I ran into this same issue and a quick click on Product > Cleandid the trick for me!

我遇到了同样的问题,快速单击“产品”>“清洁”对我有用!

回答by sebastien

I had a similar issue when installing my App on the IOS simulator (with Xcode 9).

在 IOS 模拟器(使用 Xcode 9)上安装我的应用程序时,我遇到了类似的问题。

I found the issue (at least for my case), it was due to an unauthorized key (Privacy - Location When In Use Usage Description) in the info.plist of the Watch App.

我发现了这个问题(至少在我的情况下),这是由于 Watch 应用程序的 info.plist 中的未授权密钥(隐私 - 使用时的位置使用说明)。

I have moved this key to the info.plist of the WatchKit Extension and now the App installs again.

我已将此键移至 WatchKit 扩展的 info.plist,现在该应用程序再次安装。

I hope it will help others people having the same issue.

我希望它能帮助其他有同样问题的人。

回答by AlexVogel

If you are using CocoaPods in your project please have a look at this answer: https://stackoverflow.com/a/44533287/221194

如果您在项目中使用 CocoaPods,请查看此答案:https://stackoverflow.com/a/44533287/221194

Changing the status of the pods subdirectory helped me with my project.

更改 pods 子目录的状态帮助我完成了我的项目。

回答by Justin Domnitz

I ran into this issue in Xcode 9.0 beta 5 after renaming a project that contained an iOS and watchOS app. To fix, I recreated the iOS target.

在重命名包含 iOS 和 watchOS 应用程序的项目后,我在 Xcode 9.0 beta 5 中遇到了这个问题。为了修复,我重新创建了 iOS 目标。

回答by Bhawin Ranpura

change deployment target as per requirement. select project > GENERAL > DEPLOYMENT TARGETalso check ios version of your device

根据要求更改部署目标。 选择 project > GENERAL > DEPLOYMENT TARGET还要检查您设备的 ios 版本

回答by Bonan

I had the same issue. Log shows it's an error caused by Google Signin:

我遇到过同样的问题。日志显示这是由 Google Signin 引起的错误:

FunctionName=-[MobileInstallationHelperService stageItemAtURL:completion:], SourceFileLine=392, NSUnderlyingError=0x7f891e9a1270 {Error Domain=MIInstallerErrorDomain Code=4 "Failed to remove ACL" UserInfo={NSLocalizedDescription=Failed to remove ACL, FunctionName=-[MIFileManager _removeACLAtPath:isDir:error:]

However it works on iOS 9 & 10 simulator.

但是它适用于 iOS 9 和 10 模拟器。

回答by Libor Zapletal

I got same error and I was using Cocoapods in my project and for me help just update pods.

我遇到了同样的错误,我在我的项目中使用了 Cocoapods,对我来说帮助只是更新 pod。

回答by Jose Reyes

This issue could be triggered by multiple things however if you take a look at the logs at ~/Library/Logs/CoreSimulator/CoreSimulator.logand it states an error that reads :

这个问题可能是由多种原因触发的,但是如果您查看日志~/Library/Logs/CoreSimulator/CoreSimulator.log并指出以下错误:

NSUnderlyingError=0x7fb51c271ee0 Could not hardlink copy /originPath to /destinationPath

NSUnderlyingError=0x7fb51c271ee0 无法将 /originPath 硬链接复制到 /destinationPath

it's possible that your Build number in your Project Target's settings is set to empty.

您的项目目标设置中的内部版本号可能设置为空。

Go to Project Target > Identity > Buildand set a Build number. You'll have to uninstall the the app in the simulator and re-install it before installing updated versions.

转到Project Target > Identity > Build并设置内部版本号。在安装更新版本之前,您必须卸载模拟器中的应用程序并重新安装它。