10

I downloaded the iOS SDK for the Linea Pro device from their website and have successfully implemented some of it in my App - but I noticed the device never seems to work while its connected to the Mac via the USB cable. I've verified this 100% because as soon as I disconnect the LineaPro sled from the USB cable and run their Apps, it finds the Scanner and works. Otherwise, nothing.

This of course makes debugging near impossible because if you're not connected to Xcode you obviously can't see any output the App may have in Xcode's Console. You can't NSLog anything to the console, you can't put Breakpoints, you can't step-through your code - you pretty much can't do any of the things you'd normally do when developing an App.

I've actually had to resort to creating UITextViews and outputting everything I can to them during runtime ( which of course clutters up the interface big time) but even with that, if the App crashes, you never get to see your TextViews: you're thrown out and back to the iOS home screen, staring at all your little icons.

I've got some other ideas regarding work-arounds - but that's just it: they're all work-arounds. Does anyone out there know if there's any way to use the Linea Pro while its still connected to Xcode?

sirab333
  • 3,662
  • 8
  • 41
  • 54
  • I have a similar issue and I've reached out to the folks over their asking for their insight into testing recommendations because of this situation. I'll let you know what I find out. – Josh Lehman Jul 08 '14 at 22:07
  • I'm also facing the same issue. Please let me know if any of you found any solution.. Thanks! – yuva 443 Aug 05 '14 at 07:04
  • For me this thing happen only in iPod 5. It works perfectly in iPad and iPod 4 if any know the fix please help us! – Peer Mohamed Thabib Dec 08 '14 at 12:50
  • This is a lightning cable limitation and you can enable passthrough charge within the SDK to get this resolved. Please contact Infinite Peripherals and they'll send you the commands. –  May 27 '15 at 18:03

4 Answers4

1

I don't think this is possible. For some reason lightning devices and USB don't seem to work together well.

I would suggest a combination of https://github.com/fpillet/NSLogger for logging and https://github.com/Shopify/superdb for sending messages to your app. You won't get breakpoints but you will have a few more tools at your disposal.

Patrick Tescher
  • 3,387
  • 1
  • 18
  • 31
1

If you are using a device running iOS11 and you are using XCode 9, you no longer need to connect via lightning cable to debug your runtime build. XCode 9 introduced wireless debugging via a network connection:

Wireless Device Pairing Apple Documentation

shirefriendship
  • 1,293
  • 8
  • 18
0

Facing the same problem. I've resorted to using UIAlertViews instead of UITextFields to log messages on screen, but still its a huge pain the the buttocks.

You can also fire up a local server and hit it via localhost:8001?logmessage=myLogMessageWhichCanBeVeryVeryLong and just print these GET requests to the terminal. Not pretty at all but its a workaround that could be of use if you want to get real creative...

noobular
  • 3,257
  • 2
  • 24
  • 19
0

Usually if you have a bug or error in your code it's going to be YOUR code, not the actual scanner or scanner input. So what I do while the app is in testing mode, is to have a button or other UIcontrol wired up to run an action AS IF there was scanner input, and I'll provide a mock string of input in a string (different inputs by incrementing a counter if needed). That way I can test away in the debugger for as long as necessary. Once my code works for me & I'm satisfied, I paste the same code into the scanner function and make the switch to the actual scanner. A little pain but not a big deal.

Chaim Friedman
  • 720
  • 6
  • 24