无线调试是最近在Xcode 9、iOS 11和tvOS 11中添加的功能。苹果4K电视没有USB接口,因此需要无线调试。如何在Xcode中进行无线调试?
当前回答
我的问题是关于网络SSID广播。
我尝试了上面所有的解决方案,但仍然无法连接我的设备,我的设备根本没有“地球仪”图标。然后我发现由于某种原因,我的网络关闭了SSID广播(尽管我仍然可以通过手动输入SSID来连接网络)。一旦我打开SSID广播,我就可以通过“通过IP地址连接……”来连接我的设备。
其他回答
对于无线调试,Mac系统和iPhone/Device应该在同一个网络上。 在同一个网络上,你可以做- 你可以在Mac上启动热点,然后在iPhone/设备上连接,反之亦然。
在Mac
OR
在iPhone上,
Xcode►窗口►设备和模拟器►选择设备标签►点击连接 通过网络
https://help.apple.com/xcode/mac/9.0/index.html?localePath=en.lproj#/devbc48d1bad
你可以打开Xcode Help -> Run and debug -> Network debugging获取更多信息。希望能有所帮助。
LOL, I was doing all the steps here - I ended up doing the unpairing/repairing steps from the "given by Surjeet" answer. It didn't work, and then I noticed that when I clicked the "connect via network" button, the same yellow box would pop up that pops up when you repair, saying "busy" - I got frustrated and just started hammering the "connect via network" button, clicking it quickly for probably like 15 - 20 clicks - it started spazzing out, but eventually landed on being able to connect to the network. Before that worked, I also shut my wifi off and turned it on again, as suggested by one of these answers, but clicking the "connect via network" button really fast did the trick...LOL
此外,在我按下按钮之前,我链接了设备支持文件夹,尽管我不确定它是否做了什么:
打开终端
cd /应用程序/ xcode /内容/开发/平台/ iPhoneOS.platform / DeviceSupport Ln -s 13.3 13.4 Ls -l 13.4 重启Xcode并在设备上重试运行
说在这里做- https://forums.developer.apple.com/thread/126940 -我在评论中编辑了文件夹版本,以调整到最新版本的iOS 13.4。
编辑 我相信我找到了我的问题所在,我不得不停止我的小飞贼网络过滤器。此外,在我能够通过敲击按钮连接后,当你在xcode的设备管理器中右键单击设备时,“通过IP地址连接”选项出现在下拉菜单中,在我第一次能够连接超级黑客风格之前,它就不在那里了。如果我连接,然后打开网络过滤器,它就会断开我的手机。
设置网络调试设备
从help.apple.com
通过Wi-Fi或其他网络连接调试在iOS或tvOS设备上运行的应用程序。
设置iPhone、iPad或iPod touch的步骤
检查你的设备是否有密码,如果没有就添加一个。您的设备必须有密码才能启用远程调试 Mac和iPhone/iPad需要在同一个网络上才能使用无线调试。
接下来,在Xcode中
选择窗口>设备和模拟器,然后在出现的窗口中单击设备。 使用Lightning电缆将您的设备连接到Mac。 在左侧列中选择设备,在详细信息区域中选择“通过网络连接”。
Xcode与你的设备配对。如果Xcode可以通过网络连接到设备,则在设备的左列中会出现一个网络图标。
断开设备连接。
现在可以通过网络进行调试了。
有时候行不通。您可能需要重新启动设备或网络连接。
注意:网络调试需要在macOS 10.12.4及以上版本上运行Xcode 9.0及以上版本,在设备上运行iOS 11.0及以上版本,或tvOS 11.0及以上版本。
安装Apple TV的步骤:
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 it 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设置Apple TV进行无线调试,并与设备配对。
在新的Xcode9-beta中,我们可以使用苹果所说的无线调试:
剪断绳索 选择本地网络上的任何iOS或tvOS设备来安装、运行和调试应用程序,而无需将USB线插入Mac。第一次使用新的iOS设备时,只需单击“通过网络连接”复选框,该设备就可以从那时起通过网络使用。无线开发也适用于其他应用程序,包括仪器、辅助功能检查器、Quicktime播放器和控制台。
试试这个!
如果遇到连接中断的问题,试试这个:
解决方法:在设备上开启飞行模式10秒,然后关闭飞行模式,重新建立连接
推荐文章
- iPhone上UIView和UILabels的渐变
- keychain上的分发证书中缺少私钥
- 在实现API时,我如何避免在块中捕获自我?
- Xcode的构建文件夹在哪里?
- 如何创建一个Swift Date对象?
- Xcode 4在目标设备上说“finished running <my app>”——什么都没有发生
- 从另一个应用程序打开设置应用程序
- 快速提取正则表达式匹配
- 如何应用梯度的背景视图的iOS Swift应用程序
- 图书馆吗?静态的?动态吗?或框架?另一个项目中的项目
- 如何用SwiftUI调整图像大小?
- Xcode 6 gitignore文件应该包括什么?
- 如何在iPhone/iOS上删除电话号码的蓝色样式?
- 检测视网膜显示
- 如何在UIImageView中动画图像的变化?