Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 598
Khan Avatar asked Feb 24 '15 19:02

Khan


1 Answers

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).

like image 109
Blake Merryman Avatar answered Oct 19 '22 12:10

Blake Merryman