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?
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.
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
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...
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.
Related
I'm using Xcode 10.1, and I don't have a checkbox whether I want to connect through network or not on my device page (which was there in Xcode 9 and Xcode 10 beta). Search "connect via network xcode" on google images if you don't know what I mean.
However, I must debug the offline flow of my app (which is written in React-Native btw). Not just no-internet-connection, but turning off wifi and mobile-data, which will trigger a status change. By using the developer settings of the iPhone, I can make every call fail (100% loss), but cannot change the internet-status of the phone.
So I want the debugger to stay connected and either be able to:
debug the old-school way through the cable (if I turn off internet now, I get a red error screen and nothing is possible anymore), so I can disable wifi and mobile-data,
or simulating that status change on the phone.
Btw, I cannot use a simulator, since the app requires Bluetooth.
Thanks in advance!
Edit:
The checkbox is not there for older iPhone devices. With iPhone 7s, I do see the checkbox "connect via network". But enabling or disabling does not change the fact that your iPhone needs internet to debug. If I disable internet on the phone I get the following error:
Ok, I've found the problem. We are testing on a iPhone5, which is no longer officially supported by Apple. Which means that Apple has decided to cut features for iPhone5 so you would buy a new one (wonderful strategy =/). Hence debugging with a cable is no longer supported on iPhone5.
We tested with a iPhone6 from a colleague, and everything works fine.
Edit:
Altough the checkbox is there, and I can disable wifi for connection... The moment I turn off internet on the phone, the app crashes and says: "Runtime is not ready for debugging: make sure packager runtime is running"... so no solution yet...
Problem: So I have that website which is developed with Google Web Toolkit (gwt). However, since the recent patch, the application freezes at a certain point for iPhone5 users with Safari. Other iOS-Devices like iPad seem to work fine so far.
My approach:
However, since I do not have an iPhone, I tried various online tools simulating websites on the iPhone but neither of them is having any trouble. Then I tried the Chrome's built-in device emulator which did not cause any trouble, as well.
Question: Is there any way, I can debug this case or at least reproduce it given the fact that I do not have access to an iPhone?
In case the answer is 'no': how can I debug a freezing Safari given the fact that I get access to an iPhone?
Bonus question: Why do the iPhone emulators not freeze? At least I would expect them to behave in a strange way or give me some message, that something might be wrong.
Solved the problem by using browserstack.com, which emulates an OS environment in-browser, where I could use the iPhone-Dev-Tools. Other browser-based emulators did not work as they did not emulate the OS and thus did not recreate the errors described.
Idea: Add a device to Xcode without using a cable.
I often find the need to keep my iPhone5 connected while developing an app is a pain because i cannot easily stand it up due to the cable in the bottom. I know i can jury-rig it up, but wondered about using bluetooth connection instead. I tried, but it never seems to work.
Is this possible does anyone know? If so, any explicit tips, pointers, links? I have not found anything yet..
I want to do this with my app and device:
Connect VGA, DVI, or HDMI monitor to appropriate 30-pin adapter cable
Connect adapter to iPhone4/iPad2
Mirror iDevice screen content on monitor screen.
This all used to "just work" on iOS 5. There's even proof of it working in a YouTube video of our demo from last year (see http://youtu.be/xjKk1EJ1yAI, to skip to the image jump to 1:40 in the video and hit play). All I did was plug in the iPad and voila there it was...
This now seems to "just not work." Do I have to write a whole bunch of code to make this work with every app I build or is there a setting in the Info.plist file that I should set? Should I build for iOS 5.1 to make it work again, even though the device runs iOS 6+?
I will write the code if I have to, but I'd be a lot happier if it just worked again. The "similar questions" feeature on SO was helpful in letting me know that I'm perhaps out of luck and pointing to some solutions, like Rob Terrell's TVOutManager, but I wasn't able to find an answer to this specific question in that list.
EDIT: I only tried this with an iPhone 4 running iOS 6.0.1 and the VGA adapter. I haven't tried again with an iPad (also with iOS 6.0.1), and the video was using the HDMI adapter. I will try those and update accordingly (but probably not until Monday for those updates).
I'm developing a mobile app using Flash Builder 4.6/AIR. I've been able to debug on the device (an iPhone 4s) just fine until now. I connect my iPhone to my mac with the USB corad, and debug.
All of a sudden I'm getting a black screen for close to a minute. Then I see the "Enter ip address or hostname" dialog. If I enter the ip address of my machine it doesn't matter. The window goes away for about 15 seconds, then comes back. Meanwhile, Flash Builder on my mac times out. The only way I can actually see the program running is if I hit 'Cancel' on that dialog. The app then launches, but I cannot set any breakpoints, cannot debug.
Everything I've found on the internet around this issue mentions it in reference to AIR for android -- not iOs. But I'm seeing it with iOs.
Anyone know what's going on here?
Thanks.
To make it easier for future readers, the official answer to this issue;
With the current (official) version of the AIR SKD (3.2) USB debugging is not supported on iOS devices. This is going to change with the future 3.3 release which (amongst others) adds USB debugging support:
"USB debugging for AIR iOS
This new feature allows the iOS developer to connect to the desktop via USB while debugging their mobile applications instead of relying on network connectivity."
With version 3.2, iOS debugging works over the local network, so both devices (the machine the debugger runs on and the iOS device) have to be in the same network so that they can communicate with each other.
See also the reply to What is the address of my Flash debugger?, it really helped me to resolve similar issue. Using 'ios-debug' mode was the way to go.
If you still have this problem using Android with the device connected to same wifi, try checking firewall rules. In my case FlashDevelop was blocked and I didn't suspected because of updates worked perfectly.