How do you perform wireless debugging in Xcode 9 with iOS 11, Apple TV 4K, etc?

iPC picture iPC · Jun 6, 2017 · Viewed 133.9k times · Source

Wireless debugging was recently added as a feature in Xcode 9, iOS 11, and tvOS 11. Apple TV 4K doesn't have a USB port, so it requires wireless debugging. How do you perform this wireless debugging in Xcode?

Answer

Surjeet picture Surjeet · Jun 6, 2017

Set up a device for network debugging

from help.apple.com

NOTE: Mac system and iPhone/iPad should share same network to use wireless debugging.

Debug your app running on an iOS or tvOS device over a WiFi or other network connection.

Note: Network debugging requires Xcode 9.0 or later running on macOS 10.12.4 or later, and on the device, requires iOS 11.0 or later, or tvOS 11.0 or later.

Steps to set up iPhone, iPad, or iPod touch

  1. Choose Window > Devices and Simulators, then in the window that appears, click Devices.

  2. Connect your device to your Mac with a Lightning cable.

  3. Check if passcode enables in your device settings. Enable if not already enabled.
  4. In the left column, select the device, and in the detail area, select Connect via network.

    enter image description here

    Xcode pairs with your device. If Xcode can connect with the device using a network, a network icon appears next to the device in the left column.

    enter image description here

  5. Disconnect your device.

Note: Device require a passcode to enable remote debugging.

Now you are ready for debugging over the network.


Steps to set up Apple TV:

  1. Make sure your Mac and your Apple TV are on the same network.

  2. Choose Window > Devices and Simulators, then in the window that appears, click Devices.

  3. On your Apple TV, open the Settings app and choose Remotes and Devices > Remote App and Devices.

  4. The Apple TV searches for possible devices including the Mac. (If you have any Firewall or Internet security, disable/turn off to allow searching.)

  5. On your Mac, select the Apple TV in the Devices pane. The pane for the Apple TV is displayed and shows the current status of the connection request.

  6. Enter the verification code displayed on your AppleTV into the Device window pane for the device and click Connect.

Xcode sets up the Apple TV for wireless debugging and pairs with the device.

Edit: -------

Sometime pairing doesn't work for wireless debugging, So just restart your device and internet connection. Also if firewall is enabled, you need to turn off Firewall for pairing device.

enter image description here

enter image description here