简体   繁体   English

如何在iOS上通过Xcode调试Lightning Accessory

[英]How to debug Lightning Accessory via Xcode on iOS

I am developing an iOS application that talks to a lightning accessory. 我正在开发一个与闪电配件对话的iOS应用程序。 Now, when the accessory is attached, I cannot use the lightning port to debug my application in Xcode. 现在,当连接附件时,我无法使用闪电端口在Xcode中调试我的应用程序。

Is there a way to attach debugger to my application when a lightning accessory is connected to iOS device? 当闪电配件连接到iOS设备时,有没有办法将调试器连接到我的应用程序?

or 要么

Can I somehow attach the lightning accessory to my Mac, and debug it in simulator? 我可以以某种方式将闪电配件连接到我的Mac,并在模拟器中调试吗?

I know some people are talking about WiFi debugging, but that is not supported in Xcode 6. 我知道有些人在谈论WiFi调试,但Xcode 6不支持。

With Lightning accessories, there doesn't appear to be an option for connecting both Xcode & the Accessory at the same time. 使用Lightning配件时,似乎没有可以同时连接Xcode和附件的选项。 I think this has something to do with the way Lightning cables require authentication hardware inside (so nobody has been able to come up with a dongle/splitter). 我认为这与Lightning电缆内部需要认证硬件的方式有关(因此没有人能够提出加密狗/分离器)。 The solution I ended up using was a remote logging tool that sends log messages via network to your Mac. 我最终使用的解决方案是一个远程日志记录工具,它通过网络将日志消息发送到您的Mac。 I use NSLogger but there is also CocoaLumberJack . 我使用NSLogger,但也有CocoaLumberJack

Granted, you have to pepper your code with log messages for this to be useful and there are other limitations, but it is better than nothing. 当然,您必须使用日志消息来处理您的代码,这样才有用,还有其他限制,但总比没有好。 You can also clean up your log messages by using a custom log macro (Objective-C only). 您还可以使用自定义日志宏 (仅限Objective-C)清理日志消息。

I am attempting the same thing. 我正在尝试同样的事情。 I could do it on 30 pin device using the CableJive adapter. 我可以使用CableJive适配器在30针设备上完成。 But there does not appear to be a way to do this with Lightning. 但似乎没有办法用Lightning做到这一点。 I suspect that since lightning connections (including cable) are all secured though embedded serial number chip, it means that the iOS device only allows one authentication chip per lightning connector, which means no splitters / bridges / Y-Connectors or other items unless approved by Apple. 我怀疑由于闪电连接(包括电缆)都是通过嵌入式序列号芯片保护的,这意味着iOS设备每个闪电连接器只允许一个认证芯片,这意味着没有分离器/桥接器/ Y连接器或其他项目,除非得到批准苹果。

Apple does have some magic devices for MFI approved developers, but my MFI approval expired, so not sure what they have now for Lightning device testing. Apple确实为MFI批准的开发人员提供了一些神奇的设备,但我的MFI批准已经过期,因此不确定他们现在拥有的Lightning设备测试。

You may be able to connect to XCode wirelessly and develop with the accessory connected. 您可以无线连接到XCode并使用连接的附件进行开发。 This question may help guide that process. 这个问题可能有助于指导这一过程。

What does the Xcode 4.2 preference "Support Wirelessly Connected Devices" do? Xcode 4.2偏好“支持无线连接设备”有什么作用?

Wireless debugging is now available as of Xcode 9 or later and iOS 11 or later. 从Xcode 9或更高版本以及iOS 11或更高版本开始, 无线调试现已推出。 A nice write-up on how to connect your mobile device to remotely debug are here: 有关如何将移动设备连接到远程调试的详细说明如下:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM