“通过网络连接”无线调试不起作用 Xcode 9

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

"Connect via network" wireless debugging not working Xcode 9

iosxcodeios11xcode9

提问by JD.

I am trying to run my iOS app via wifi network. But its not working as I expected.

我正在尝试通过 wifi 网络运行我的 iOS 应用程序。但它不像我预期的那样工作。

Connected Network sign is not displaying.

未显示已连接网络标志

enter image description here

在此处输入图片说明

I am using:

我在用:

macOS Sierra - 10.12.6 (in Mac mini)

macOS Sierra - 10.12.6(在 Mac mini 中)

Xcode - 9.0 (9A235)

Xcode - 9.0 (9A235)

iOS - 11.0

iOS - 11.0

NOTE: Mac mini and iPhone both are connected to same wifi network.

注意:Mac mini 和 iPhone 都连接到同一个 wifi 网络

Already tried:

已经尝试过

  1. Change another network

  2. Restart iPhone and Mac mini twice.

  3. Unpair Device and again pair device.

  1. 换一个网络

  2. 重新启动 iPhone 和 Mac mini 两次。

  3. 取消配对设备并再次配对设备。

Am I missing something?

我错过了什么吗?

回答by Andrew Meyer

I was having the same issue and performed the following steps to get things working:

我遇到了同样的问题并执行了以下步骤来使事情正常进行:

  1. Open "Devices and Simulators"
  2. Connect your device and check the "Connect via network" checkbox
  3. Disconnect your device
  4. Right click listing for your device in the left hand column (Under Disconnected)
  5. Select "Connect via IP Address.." and enter your device's IP address
  1. 打开“设备和模拟器”
  2. 连接您的设备并选中“通过网络连接”复选框
  3. 断开您的设备
  4. 在左侧栏中右键单击您的设备列表(在断开连接下)
  5. 选择“通过 IP 地址连接..”并输入您设备的 IP 地址

enter image description here

在此处输入图片说明

回答by future-adam

After numerous Wi-fi resets and device restarts (for iOS 12, Xcode 10) I found the solution for me was:

在无数次 Wi-fi 重置和设备重新启动(对于 iOS 12、Xcode 10)之后,我找到了适合我的解决方案:

  1. Disconnect iOS device from Mac
  2. Go to Settings -> Develop on the iOS device
  3. Tap "Clear Trusted Computers"
  4. Reconnect iOS device to Mac via cable
  5. On iOS device tap "Trust This Computer" and enter passcode
  6. Go to Device Manager in Xcode and enable "Connect Via Network"
  1. 断开 iOS 设备与 Mac 的连接
  2. 在 iOS 设备上转到“设置”->“开发”
  3. 点击“清除受信任的计算机”
  4. 通过电缆将 iOS 设备重新连接到 Mac
  5. 在 iOS 设备上点击“信任这台电脑”并输入密码
  6. 转到 Xcode 中的设备管理器并启用“通过网络连接”

The network symbol appeared and I was good to go.

网络符号出现了,我很高兴。

回答by Erik Olson

Prerequisites: iOS => 11.0; Xcode 9; Same network for both iOS device and Mac

先决条件:iOS => 11.0;Xcode 9; iOS 设备和 Mac 的同一网络

This worked for me: 1. Plug in iPhone, select "Connect via network" 2. Select you iPhone as the target for debug build. 3. Unplug, build app in that iPhone (it will fail). 4. Plug back in, check for network symbol (it appeared here for me). 5. Unplug and build wirelessly successfully.

这对我有用: 1. 插入 iPhone,选择“通过网络连接” 2. 选择您的 iPhone 作为调试构建的目标。3. 拔掉,在那个 iPhone 上构建应用程序(它会失败)。4.重新插入,检查网络符号(它出现在这里对我来说)。5. 拔下并无线构建成功。

Sorry this is a hand-waivey answer :/

抱歉,这是一个手动回答:/

回答by ToiLaTung

I just figure it out. Plug cable in, run app (must setting connect to network), and stop. Plug cable out, go to Debug > Attach to process (select your app) now its working

我只是想通了。插入电缆,运行应用程序(必须设置连接到网络),然后停止。拔下电缆,转到调试 > 附加到进程(选择您的应用程序)现在可以正常工作了