“Connect via network” wireless debugging not worki

2020-05-19 03:48发布

问题:

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

Connected Network sign is not displaying.

I am using:

macOS Sierra - 10.12.6 (in Mac mini)

Xcode - 9.0 (9A235)

iOS - 11.0

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

Already tried:

  1. Change another network

  2. Restart iPhone and Mac mini twice.

  3. Unpair Device and again pair device.

Am I missing something?

回答1:

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



回答2:

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

  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"

The network symbol appeared and I was good to go.



回答3:

Prerequisites: iOS => 11.0; Xcode 9; Same network for both iOS device and 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.

Sorry this is a hand-waivey answer :/



回答4:

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