Xcode 项目不会在 iOS 设备上运行

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

Xcode Project won't run on iOS Device

xcodexcode6xcode7

提问by Amit Kalra

Xcode gives me this message every-time I try running my app on my iPhone. (Works fine on the simulator.) (And this occurs in every project I have.) (I also just downloaded Xcode again.)

每次我尝试在 iPhone 上运行我的应用程序时,Xcode 都会给我这条消息。(在模拟器上运行良好。)(这发生在我拥有的每个项目中。)(我也刚刚再次下载了 Xcode。)

This is the message I get.

这是我得到的消息。

App Installation Failed.
Unknown Error Occurred.

How do I fix this error?

我该如何解决这个错误?

回答by Oliver S

Unplugging iOS Device and plugging it back it in fixed it for me.

拔下 iOS 设备并将其重新插入为我修复了它。

回答by Amit Kalra

Alright, it was a simple fix:

好吧,这是一个简单的修复:

  1. Go into Xcode Preferences -> Accounts -> More Info. Hit the refresh icon.

  2. Clean your project. Project -> Clean.

  3. Force quit Xcode.

  4. Reboot Mac and Device.

  1. 进入 Xcode Preferences -> Accounts -> More Info。点击刷新图标。

  2. 清理你的项目。项目 -> 清洁。

  3. 强制退出 Xcode。

  4. 重新启动 Mac 和设备。

回答by Lorenzo

If you have the same App but downloaded from AppStore, I suggest to remove the App manually from your device, then try to run the new version with XCode.

如果您有相同的应用程序但从 AppStore 下载,我建议您从您的设备手动删除该应用程序,然后尝试使用 XCode 运行新版本。

回答by Steve Graff

After following the suggestions in this thread (restarting iPhone, cleaning Xcode project, quitting and re-launching Xcode) and others (setting Team to None then back to my Team) and unplugging and replugging Lightning connector from my iPhone 6 I was still experiencing this problem. Xcode would even display an error that my iPhone 6 was locked, even though it was not.

按照此线程中的建议(重新启动 iPhone、清理 Xcode 项目、退出并重新启动 Xcode)和其他人(将 Team 设置为 None 然后回到我的团队)并从我的 iPhone 6 拔下并重新插入 Lightning 连接器后,我仍然遇到这个问题问题。Xcode 甚至会显示我的 iPhone 6 被锁定的错误,即使它没有。

I was able to fix it by unplugging the USB-A connector of the USB to Lightning cable from my MacBook Pro, then plugging it back in. I'm not sure why that made the difference, but glad that it did resolve this annoying problem.

我能够通过从我的 MacBook Pro 上拔下 USB 转闪电连接线的 USB-A 连接器,然后将其重新插入来修复它。我不知道为什么会有所不同,但很高兴它确实解决了这个烦人的问题.

回答by Arthur

I have this issue regularly. There are a number of techniques that help me overcome it, including the classic "turn it off and back on again."

我经常遇到这个问题。有很多技巧可以帮助我克服它,包括经典的“关闭并重新打开”。

One thing that isn't mentioned here is that the iPhone should be switched on, unlocked, connected to the mac and then the app should be run (with the iPhone unlocked). Don't lock it!

这里没有提到的一件事是 iPhone 应该打开、解锁、连接到 Mac,然后应用程序应该运行(iPhone 解锁)。不要锁!

回答by ninahadi

Make sure your device name doesn't have any emoji (Xcode 11.0)

确保您的设备名称没有任何表情符号 (Xcode 11.0)