如何在带有iOS 11,Apple TV 4K等的Xcode 9中执行无线调试?

本文翻译自:How do you perform wireless debugging in Xcode 9 with iOS 11, Apple TV 4K, etc?

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. Xcode 9,iOS 11和tvOS 11中最近添加了无线调试功能。AppleTV 4K没有USB端口,因此需要无线调试。 How do you perform this wireless debugging in Xcode? 您如何在Xcode中执行此无线调试?


#1楼

参考:https://stackoom.com/question/30E0H/如何在带有iOS-Apple-TV-K等的Xcode-中执行无线调试


#2楼

You can open Xcode Help -> Run and debug -> Network debugging for more info. 您可以打开Xcode帮助->运行和调试->网络调试以获取更多信息。 Hope it helps. 希望能帮助到你。


#3楼

Set up a device for network debugging 设置设备进行网络调试

from help.apple.com 来自help.apple.com

NOTE: Mac system and iPhone/iPad should share same network to use wireless debugging. 注意:Mac系统和iPhone / iPad应该共享同一网络才能使用无线调试。

Debug your app running on an iOS or tvOS device over a WiFi or other network connection. 调试通过WiFi或其他网络连接在iOS或tvOS设备上运行的应用。

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 . 注意:网络调试需要MacOS 10.12.4或更高 版本上运行的Xcode 9.0或更高 版本 ,并且在设备上需要iOS 11.0或更高版本tvOS 11.0或更高版本

Steps to set up iPhone, iPad, or iPod touch 设置iPhone,iPad或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. 使用Lightning电缆将设备连接到Mac。

  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. 在左列中,选择设备,然后在详细信息区域中,选择“通过网络连接”。

    在此处输入图片说明

    Xcode pairs with your device. Xcode与您的设备配对。 If Xcode can connect with the device using a network, a network icon appears next to the device in the left column. 如果Xcode可以使用网络与设备连接,则在左列中设备旁边会出现一个网络图标。

    在此处输入图片说明

  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: 设置Apple TV的步骤:

  1. Make sure your Mac and your Apple TV are on the same network. 确保Mac和Apple TV在同一网络上。

  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. 在Apple TV上,打开“设置”应用程序,然后选择“遥控器和设备”>“远程应用程序和设备”。

  4. The Apple TV searches for possible devices including the Mac. Apple TV搜索可能的设备,包括Mac。 (If you have any Firewall or Internet security, disable/turn off to allow searching.) (如果您具有防火墙或Internet安全性,请禁用/关闭以允许搜索。)

  5. On your Mac, select the Apple TV in the Devices pane. 在Mac上,在“设备”窗格中选择Apple TV。 The pane for the Apple TV is displayed and shows the current status of the connection request. 将显示Apple TV的窗格,并显示连接请求的当前状态。

  6. Enter the verification code displayed on your AppleTV into the Device window pane for the device and click Connect. 在设备的“设备”窗口窗格中输入AppleTV上显示的验证码,然后单击“连接”。

Xcode sets up the Apple TV for wireless debugging and pairs with the device. Xcode设置Apple TV进行无线调试并与设备配对。

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. 另外,如果启用了防火墙,则需要关闭用于配对设备的防火墙。

在此处输入图片说明

在此处输入图片说明


#4楼

In the new Xcode9-beta, we can use wireless debugging as said by Apple : 在新的Xcode9-beta中,我们可以使用Apple所说的 无线调试

Cut the Cord 剪断脐带
Choose any of your iOS or tvOS devices on the local network to install, run, and debug your apps – without a USB cord plugged into your Mac. 选择本地网络上的任何iOS或tvOS设备来安装,运行和调试应用程序-无需在Mac上插入USB线。 Simply click the 'Connect via Network' checkbox the first time you use a new iOS device, and that device will be available over the network from that point forward. 首次使用新的iOS设备时,只需单击“通过网络连接”复选框,此后该设备即可通过网络使用。 Wireless development also works in other apps, including Instruments, Accessibility Inspector, Quicktime Player, and Console. 无线开发还可以在其他应用程序中使用,包括仪器,辅助功能检查器,Quicktime Player和控制台。

Try this! 尝试这个!

If facing disconnection issues , try this: 如果遇到断线问题 ,请尝试以下操作:

Workaround : Enable airplane mode on your device for 10 seconds and then disable airplane mode to re-establish your connection 解决方法 :在设备上启用飞行模式10秒钟,然后禁用飞行模式以重新建立连接


#5楼

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. 网络调试需要在MacOS 10.12.4或更高版本上运行的Xcode 9.0或更高版本,并且在设备上需要iOS 11.0或更高版本或tvOS 11.0或更高版本。

iPhone 苹果手机

iOS 11 won't be available for 32bit devices , ie iPhone 5 and iPhone 5c and below. iOS 11 不适用于32位设备 ,例如iPhone 5和iPhone 5c及更低版本。 The first 64bit iPhone is 5s. 首款64位iPhone为5s。

iPad 的iPad

iPad mini 2 will be the oldest iPad with iOS 11 support. iPad mini 2将是支持iOS 11的最古老的iPad。

iPod iPod

iPod needs to be an iPod 6 to be able to run iOS. iPod必须是iPod 6才能运行iOS。

If you use your devices not only for developing but also for production, be warned that a beta OS is not for the faint hearted ;-) 如果您不仅将设备用于开发,还用于生产,请注意,beta操作系统不适合胆怯的人;-)


#6楼

Prerequisite 先决条件

  • Your Mac Machine should have at least Mac OSX 10.12.4 or later 您的Mac计算机应至少具有Mac OSX 10.12.4或更高版本
  • Your iOS device should have at least iOS 11.0 or later 您的iOS设备应至少具有iOS 11.0或更高版本
  • Both devices should be on same network. 两个设备应该在同一网络上。

Steps to Activate 激活步骤

  • Plug your iOS device with Mac machine from cable. 通过电缆将iOS设备与Mac机连接。

  • Open Xcode then from top menu Window -> Devices and Simulators 打开Xcode,然后从顶部菜单窗口->设备和模拟器

  • Chose Devices segment and chose your desired Device from left device list. 选择设备段,然后从左侧设备列表中选择所需的设备。

  • On right side you can see open Connect via network , enable this option as shown in attached image. 在右侧,您会看到打开“ 通过网络连接” ,启用此选项,如图所示。 通过网络连接

  • After few seconds you can see network sign in front of you device. 几秒钟后,您可以在设备前面看到网络标志。 在此处输入图片说明

  • Unplug your device and use debugging as you're using normally. 拔下设备的电源,然后像往常一样使用调试功能。

Thanks 谢谢

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值