更新时间:2023-12-03 20:53:28
Xcode与您的设备配对。如果Xcode可以使用网络连接设备,则左栏中设备旁边会显示一个网络图标。
断开您的设备。
注意:设备需要密码才能启用远程调试。
现在您已准备好通过网络进行调试。
确保您的Mac和Apple TV在同一网络上。
选择窗口>设备和模拟器,然后在窗口中出现,点击设备。
在Apple TV上,打开设置应用,然后选择遥控器和设备>远程应用和设备。
Apple TV搜索可能的设备,包括Mac。 (如果您有任何防火墙或Internet安全性,请禁用/关闭以允许搜索。)
在Mac上,在设备窗格中选择Apple TV。将显示Apple TV的窗格并显示连接请求的当前状态。
在Apple窗口窗格中输入AppleTV上显示的验证码设备并单击连接。
Xcode设置Apple TV进行无线调试并与设备配对。
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?
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.
Choose Window > Devices and Simulators, then in the window that appears, click Devices.
Connect your device to your Mac with a Lightning cable.
In the left column, select the device, and in the detail area, select Connect via network.
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.
Disconnect your device.
Note: Device require a passcode to enable remote debugging.
Now you are ready for debugging over the network.
Make sure your Mac and your Apple TV are on the same network.
Choose Window > Devices and Simulators, then in the window that appears, click Devices.
On your Apple TV, open the Settings app and choose Remotes and Devices > Remote App and Devices.
The Apple TV searches for possible devices including the Mac. (If you have any Firewall or Internet security, disable/turn off to allow searching.)
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.
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.