Pair a wireless device with Xcode (iOS, tvOS)

Before you can launch your app on a wireless device, you must pair the device with Xcode.

Note: Running an app on a network device 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.

A screenshot showing an iPhone selected in the Devices pane of the Devices and Simulators window.

Pair an iOS device with Xcode

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

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

    Note: The first time you connect an iOS device to your Mac, you may need to tap Trust on the device to continue.

  3. In the left column, select the device.

  4. In the detail area, select Connect via network.

    Xcode pairs with the iOS device.

  5. Disconnect the Lightning cable.

In the left column, a device that is connected (using a Lightning cable or over the network) appears under Connected and if a network icon appears next to the device, the device is paired.

A screenshot showing an iPhone with a network icon in the list area of the Devices pane.

Pair an Apple TV with Xcode

  1. Connect the Mac running Xcode and the Apple TV to the same network.

  2. In Xcode, choose Window > Devices and Simulators, then in the window that appears, click Devices.

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

    The Apple TV searches for possible pairing devices including the Mac.

  4. In Xcode, select the Apple TV on the left under Discovered, then click Pair with [Apple TV name] on the right.

  5. Enter the verification code displayed on the Apple TV, then click Connect.

    A screenshot showing entering a verification code on the device pane for an Apple TV in the Devices and Simulators window.

    Xcode pairs with the Apple TV. If successful, a network icon appears next to the Apple TV in the left column and the device details appear on the right.

A screenshot showing an Apple TV with a network icon in the Devices and Simulators window.

Unpair a wireless device

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

  2. In the left column, Control-click the network device.

  3. In the pop-up menu that appears, choose Unpair Device.

Alternatively, on an iOS device, reset network settings including the Wi-Fi settings. Tap Settings, choose General > Reset > Reset Network Settings, then tap Reset Network Settings in the dialog that appears.

See alsoRun an app on a wireless device (iOS, tvOS, watchOS)