ios iPhone未连接

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

iPhone not connected

iosiphonexcode

提问by Dani

I have my iPhone connected to Xcode. It used to work just fine recently. I see it in the Devices and Simulators section, but when I try to compile my app, it says D's iPhone 6S is not connected. Xcode will continue when D's iPhone 6S is connected.

我的 iPhone 连接到 Xcode。最近它曾经工作得很好。我在设备和模拟器部分看到它,但是当我尝试编译我的应用程序时,它说D's iPhone 6S is not connected. Xcode will continue when D's iPhone 6S is connected.

In the Devices and Simulators I see it as disconnected. I tried restarting the phone, turning it's wifi on and off. It's connected to the same wifi network, I tried restarting Xcode, nothing. I run Xcode 9, Beta 6 at the moment. Does anyone has similar issue and hopefully know how to solve it?

在设备和模拟器中,我认为它已断开连接。我尝试重新启动手机,打开和关闭它的wifi。它连接到同一个 wifi 网络,我尝试重新启动 Xcode,什么也没有。我目前运行 Xcode 9, Beta 6。有没有人有类似的问题,希望知道如何解决?

采纳答案by Dani

Apparently, more people have this issue. The only "solution" I found was to connect the iphone with a USB, run the app and then try to run it using wifi. This usually solves my problem.

显然,有更多人有这个问题。我发现的唯一“解决方案”是用 USB 连接 iPhone,运行应用程序,然后尝试使用 wifi 运行它。这通常可以解决我的问题。

回答by ScottyBlades

Set up

设置

  1. Window -> Devices and Simulators
  1. 窗口 -> 设备和模拟器

enter image description here

在此处输入图片说明

  1. Choose your device from the list.
  1. 从列表中选择您的设备。

enter image description here

在此处输入图片说明

  1. Tick the box for "connect via network."
  1. 勾选“通过网络连接”框。

enter image description here

在此处输入图片说明

Troubleshooting:

故障排除:

  1. plug in your iPhone.
  2. Open Xcode
  3. go to window-> Devices and Simulators
  4. Right click on your device
  5. click Unpair Deviceand unplug it.
  6. restart Xcode
  7. restart your iPhone.
  8. Connect your iPhone via USB
  9. run your app
  10. then unplug it, and it should run via the wifi again.
  1. 插入你的 iPhone。
  2. 打开 Xcode
  3. window->Devices and Simulators
  4. 右键单击您的设备
  5. 单击Unpair Device并拔下它。
  6. 重启Xcode
  7. 重启你的 iPhone。
  8. 通过 USB 连接您的 iPhone
  9. 运行你的应用
  10. 然后拔掉它,它应该再次通过wifi运行。

回答by Sam H.

In Window > Devices and Simulators, right click on your iPhone and "Connect with IP address", then enter the iPhone IP address and you're connected.

在“窗口”>“设备和模拟器”中,右键单击您的 iPhone 并“使用 IP 地址连接”,然后输入 iPhone IP 地址并连接。

回答by JerryZhou

As Sam H.'s answer, can Connect via IP Address. This is XCode 9 or 9.1's function. And need your device update to iOS11 +

正如Sam H.的回答,可以Connect via IP Address。这是XCode 9 or 9.1的功能。并需要您的设备更新到iOS11 +

enter image description here

在此处输入图片说明

回答by choofie

Turn off WIFIon Mac, and also on your iPhonetoo. Then turn on WIFIagain on both devices.

MaciPhone关闭 WIFI。然后在两台设备再次打开WIFI

I frequently face this issue since I don't use USB cable to build the app to my iPhone. So this is my usual way to resolve the connection problem.

我经常遇到这个问题,因为我不使用 USB 电缆将应用程序构建到我的 iPhone。所以这是我解决连接问题的常用方法。

回答by Steeven Sylveus

You can also connect via IP address

您也可以通过 IP 地址连接

While Xcode is open, go to

当 Xcode 打开时,转到

Windows -> Device and Simulators

Windows -> 设备和模拟器

right click your device and connect via IP address. You can get your phone IP address from settings under wifi and clicking the info button on the network.

右键单击您的设备并通过 IP 地址连接。您可以从 wifi 下的设置中获取您的电话 IP 地址,然后单击网络上的信息按钮。

回答by BuzzLightyear

Restarting the wifi on my Mac worked for me.

在我的 Mac 上重新启动 wifi 对我有用。

回答by Manish Mahajan

Making Cellular data Off solved my problem

关闭蜂窝数据解决了我的问题

回答by Lin May

I'm using Xcode 9.1 and suddenly had this issue.After reading other answers a realized it is a Xcode bug via wifi debug.My solution was to connect the iphone with a USB, then go to the Add Additional Simulators,then come to the interface below,uncheck "connect via network". Problem sovled,and back to debug via a USB.

我正在使用 Xcode 9.1,突然遇到了这个问题。阅读其他答案后,意识到这是通过 wifi 调试的 Xcode 错误。我的解决方案是将 iphone 与 USB 连接,然后转到添加其他模拟器,然后来到下面的界面,取消选中“通过网络连接”。问题已解决,并通过 USB 返回调试。

enter image description here

在此处输入图片说明

回答by Beninho85

I had this issue when I changed my network connection on my Mac and in this case reconnecting the phone with an USB cable doesn't work. I had to restart xCode.

我在 Mac 上更改网络连接时遇到了这个问题,在这种情况下,用 USB 电缆重新连接手机不起作用。我不得不重新启动 xCode。