简体   繁体   English

Xcode 9 无线调试不起作用

[英]Xcode 9 Wireless debugging not working

For some reason the wireless debugging does not work here.由于某种原因,无线调试在这里不起作用。 Here is what I've done:这是我所做的:

  • Using newest Xcode 9使用最新的 Xcode 9
  • Using newest iOS 11 on my iPhone 7+在我的 iPhone 7+ 上使用最新的 iOS 11
  • Both devices are in the same network两台设备在同一个网络中
  • Connected the iPhone via Lightning, selected "Connect via Network" in the Devices & Simulator menu通过 Lightning 连接 iPhone,在“设备和模拟器”菜单中选择“通过网络连接”
  • Run an app on the iPhone while still connected via Lightning - everything works在 iPhone 上运行应用程序,同时仍然通过 Lightning 连接 - 一切正常

But as soon as I unplug the phone, Xcode is no longer able to connect with the phone.但是一旦我拔掉手机,Xcode 就无法再与手机连接。 I can ping the phone with the Mac, but even the "connect via ip" option in Xcode does not work.我可以用 Mac ping 手机,但即使是 Xcode 中的“通过 ip 连接”选项也不起作用。

Anybody got tips on how to get this working?有没有人有关于如何让这个工作的提示?

I had the same issue, but it was intermittent - ie sometimes the globe would not appear next to the phone name in Xcode Devices and Simulators window and when the phone was disconnected from the lighting cable, I could not debug to it from Xcode.我有同样的问题,但它是间歇性的 - 即有时地球不会出现在 Xcode 设备和模拟器窗口中的电话名称旁边,当电话与照明电缆断开连接时,我无法从 Xcode 调试它。 My fix was much simpler, though - I just turned WiFi on and off both on the Mac and on the phone.不过,我的修复要简单得多 - 我只是在 Mac 和手机上打开和关闭 WiFi。 After the devices reconnected to the network wireless debugging was available again.设备重新连接到网络后,无线调试再次可用。 This seems to be an issue with the network communication (regardless whether the device can be pinged or not).这似乎是网络通信的问题(无论设备是否可以 ping 通)。

Make sure System Preferences->Internet Sharing is enabled using USB ports:确保使用 USB 端口启用系统偏好设置-> Internet 共享

分享是关怀

I was able to find a solution to this on another stack overflow question: How do you perform wireless debugging in Xcode 9 with iOS 11, Apple TV 4K, etc?我能够在另一个堆栈溢出问题上找到解决方案: 如何在 Xcode 9 中使用 iOS 11、Apple TV 4K 等执行无线调试? . .

You can also check this answer: "Connect via network" wireless debugging not working Xcode 9您还可以查看此答案: “通过网络连接”无线调试不起作用 Xcode 9

Near the bottom, from "IOS DEV".靠近底部,来自“IOS DEV”。 Briefly, the solution ended up to be to unpair my phone, disconnect and re-pair.简而言之,解决方案最终是取消我的手机配对,断开连接并重新配对。 After that Xcode automatically added it with the globe.之后 Xcode 自动将其添加到地球上。 As an FYI, I was able to ping my iPhone using the network utility prior to the un-paring but was still unable to get the phone to connect.作为仅供参考,我能够在取消配对之前使用网络实用程序 ping 我的 iPhone,但仍然无法连接手机。 good luck.祝你好运。

重新启动 xcode 是唯一为我解决这个间歇性连接问题的方法。

I realized this can also happen if my Mac is connected to a VPN.我意识到如果我的 Mac 连接到 VPN,也会发生这种情况。 I had to:我不得不:

  1. Kill the VPN connection终止 VPN 连接
  2. Turn the computer's wifi off and back on关闭计算机的 wifi 并重新打开
  3. Open Devices and Simulators开放设备和模拟器
  4. Plug the device in and the globe icon should appear.插入设备,应该会出现地球图标。
  5. Unplug the device and make sure the globe icon is still there.拔下设备并确保地球图标仍然存在。
  6. Run the app via network!通过网络运行应用程序!

Wireless debugging mysteriously stopped working for me until I turned off my VPN client.无线调试神秘地停止了对我的工作,直到我关闭了我的 VPN 客户端。 I now believe that I had the VPN turned off when I was trying it out the first time, but then the VPN auto-connected after my computer restarted sometime later.我现在相信我在第一次尝试时关闭了 VPN,但后来我的计算机重新启动后 VPN 自动连接。

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

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