How to debug Lightning Accessory via Xcode on iOS
Asked Answered
S

4

7

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.

Semiotic answered 24/2, 2015 at 19:45 Comment(0)
I
3

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

Incentive answered 13/8, 2015 at 15:10 Comment(2)
Yes, I am using the same solution (NSLogger connector for CocoaLumberJack). However, this doesn't allow debugging. and sometimes NSLogger becomes flaky (doesn't detect new sessions).Semiotic
I'm right there with you. Unfortunately, it appears this is the best (read: only) solution for the time being. If I come across anything better, I will update my answer.Incentive
R
0

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.

Rheum answered 28/5, 2015 at 19:56 Comment(0)
L
0

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?

Luxemburg answered 13/8, 2015 at 15:20 Comment(1)
This feature has been removed from XCode 4.3 onwards.Semiotic
B
0

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:

Britannic answered 14/6, 2019 at 6:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.