简体   繁体   中英

How to debug Lightning Accessory via Xcode on iOS

I am developing an iOS application that talks to a lightning accessory. Now, when the accessory is attached, I cannot use the lightning port to debug my application in Xcode.

Is there a way to attach debugger to my application when a lightning accessory is connected to iOS device?

or

Can I somehow attach the lightning accessory to my Mac, and debug it in simulator?

I know some people are talking about WiFi debugging, but that is not supported in Xcode 6.

With Lightning accessories, there doesn't appear to be an option for connecting both Xcode & the Accessory at the same time. 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). The solution I ended up using was a remote logging tool that sends log messages via network to your Mac. I use NSLogger but there is also 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).

I am attempting the same thing. I could do it on 30 pin device using the CableJive adapter. But there does not appear to be a way to do this with 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.

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.

You may be able to connect to XCode wirelessly and develop with the accessory connected. This question may help guide that process.

What does the Xcode 4.2 preference "Support Wirelessly Connected Devices" do?

Wireless debugging is now available as of Xcode 9 or later and iOS 11 or later. A nice write-up on how to connect your mobile device to remotely debug are here:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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