简体   繁体   English

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

[英]Xcode Project won't run on iOS Device

Xcode gives me this message every-time I try running my app on my iPhone.每次我尝试在 iPhone 上运行我的应用程序时,Xcode 都会给我这个消息。 (Works fine on the simulator.) (And this occurs in every project I have.) (I also just downloaded Xcode again.) (在模拟器上运行良好。)(这发生在我拥有的每个项目中。)(我也刚刚再次下载了 Xcode。)

This is the message I get.这是我得到的信息。

App Installation Failed.
Unknown Error Occurred.

How do I fix this error?如何修复此错误?

拔掉iOS设备并将其插回来为我修复它。

Alright, it was a simple fix: 好吧,这是一个简单的修复:

  1. Go into Xcode Preferences -> Accounts -> More Info. 进入Xcode首选项 - >帐户 - >更多信息。 Hit the refresh icon. 点击刷新图标。

  2. Clean your project. 清理您的项目。 Project -> Clean. 项目 - >清洁。

  3. Force quit Xcode. 强制退出Xcode。

  4. Reboot Mac and Device. 重新启动Mac和设备。

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

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. 按照这个线程中的建议(重新启动iPhone,清理Xcode项目,退出并重新启动Xcode)和其他人(将Team设置为None然后再回到我的团队)并从我的iPhone 6上拔下并重新插入Lightning连接器我仍然遇到这个问题。 Xcode would even display an error that my iPhone 6 was locked, even though it was not. 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到Lightning线的USB-A连接器然后将其重新插入来修复它。我不知道为什么会有所不同,但很高兴它确实解决了这个烦人的问题。

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). 这里没有提到的一件事是iPhone应该打开,解锁,连接到Mac,然后应该运行应用程序(iPhone解锁)。 Don't lock it! 不要锁定它!

Make sure your device name doesn't have any emoji (Xcode 11.0)确保您的设备名称没有任何表情符号(Xcode 11.0)

if you using vpn services, then you need to turn off vpn.如果您使用 vpn 服务,则需要关闭 vpn。 Works for me为我工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM