I am working with Corona SDK for some time, and i really like it, but there is one thing, that i cant figure out: How to debug my code on a real device?
At the point, when my code runs great in the simulator, i usually compile it, and try it on the phone. But when there is some error, that doesn't bother the simulator, but pisses the phone off, i simply see an error message:
"This application encountered a Lua error (see logs) etc."
Me and my boss spent a whole day figuring out, that i made a require with a capital instead of lower case.
My question is: How to actually "see" that log? I tried to connect my device to DDMS, but i saw no relevant output. Is there a way to access that log (I'm testing on an android device)? Or is there a way to simulate the EXACT behavior of the phone in the simulator? Usually the phone freaks out because of i/o operations, and when using the wrong case.
The best way to debug on iOS devices is to use XCode's Organizer with your device plugged in via the USB port. On the left hand panel of Organizer, there will be a block for each device that XCode knows about. You may have to click on a button "Use device for debugging" or something similar so XCode can gather all the information it needs.
Once done, then you can use XCode to install the app to the device (you don't need to make an .ipa file, just copy the app to the device via Organizer). In that panel on the left, there is a link for "Console Log", click that and you can your print statements and other errors issued by Corona SDK.
Rob
If you don't have Xcode, you can try iPhone configuration utility. It is more light-weight than the xcode plus you can also use it on a windows machine.
Related
I started messing around with react-native. I've built a small application and it seems to work fine (package.json). I can work on it in Debug or Release mode, using the simulator or my iPhone 6S device, and all is well.
This app is just for me so I don't pay for the Apple Developer thing, and I just run the app in Release mode on my device, and it...seems to be fine? I can quit xcode and go places and the app works fine.
After a week or so, it's hard to tell, the app stops loading. It'll display the splash screen for a split second and then it's gone back to the home screen.
I setup Rollbar, but it doesn't catch anything. I look in the Privacy -> Analytics area and don't see anything there either.
I'm not really looking for an answer to my exact problem since various SO questions and other places suggest it's probably something weird and specific. My main problem is I don't know even where to look/how to debug this kind of thing. If I build the app and run it on device again, it'll run fine. I need to try to debug without loading new code, and have no idea how that works on iOS. I've tried poking around at the Debug -> Attach to Process by Name, but the app never gets far enough to do anything with that.
Alternatively, I throw react-native in the garbage and use something that works...
App provisioning with a free developer license (?) is 7 days. See: Why does my free XCode Provisioning Profile only last 7 days?
You can likely verify this by looking at error messages in the console window. Connect your device, and in Xcode go to Window/Devices and Simulators/Open Console, then launch your app.
I developed an app and already tested it in Xcode and on my physical iPhone device.
After a lot of testing on my iPhone the app quits after starting.
I guess this is because of an empty array, but I am not sure.
Is there a possibility to read the console of my already built app on my iPhone? Because when I am testing the app on Xcode everything works fine - I guess the error occurs in only very specific cases...
I don't want to build the app again on my physical device, because I am pretty sure everything works fine then and I won't be able to recreate the exact situation.
So I would like to connect the phone to my macbook and run the app on my phone in Xcode without rebuilding it first.
Any ideas?
Connect your phone to your system and open Xcode.
The Window menu in Xcode Select Device and Simulators from the
Window menu.
Select your device from the left panel.
The toggle logs button Make sure that the logs are expanded. If they
are not, press the small up arrow in the bottom left corner of the
main pane.
Click the Save Console button (at the bottom right) to save the log
information within the console.
If you use a free Apple Developer account it is normal, it has not crashed.. it simply refuse to run.
Apple has imposed 'new' limitations on the 'free' provisioning profiles, whit this limitations you can run the app on a physical device for 7 days, then you must recreate a new profile with a new deploy on the device.
Even without XCode you can get the logs by using iOS Console which is free and works exactly as XCode's console.
As for starting the app again without rebuilding from XCode, you can use ⌃⌘R to speed up your tests.
So I'm trying to make an application using the DJI SDK. In order for my app to function properly, my iDevice needs to be hooked up to the remote controller of the drone via USB.
This means I can't also run the app via xcode and get console output.
Is there a way of saving console output when using an app on your phone? I am aware of the crash logs, but sadly they don't provide enough info to be useful to me.
This problem started when I got a runtime error only when the device was connected to the remote controller. Therefore there was no way of isolating the problem since I couldn't tell what went wrong.
Another solution would maybe be a 1 female to 2 male usb chord, but I haven't found one online yet and even if I did I don't know if that would work.
Is there a standard way of debugging when using hardware that needs to be connected to the device?
from Xcode, hit window on the tool bar at the top, then Devices. Select the device you want to read the log from. However, this is the log for the entire phone, and you have to be plugged into the mac... so you'll have to run your tests, unplug from the DJI, plug into the mac, go to devices, and scroll through the log until you find the output from your app, and you won't be able to see real time expected outcome.
It's not ideal, but that's the only way I know of to see the apart from building an entire console log into your app yourself.
Newbie here, so apologies if this is stupid question:
Are there any applications or solutions out there that would allow you access to debugging events on an app installed on your iphone? To be clear, this isn't an app I've developed, it's just on my iphone and is used as part of another solution which we are developing. Curious if there's a way to just watch the events on an app to help with debugging process.
Thanks.
If you make an app, and build it with a development release, and development signing, you can select to build+run it on a device. Then, you can use the Xcode debugger to see your logs / errors etc.
Steps:
Plug in iPhone
Start Xcode
Hit Build + run
Watch debugger
Logs are either made by the OS for certain things (NSinconsistency, bad constraints, race conditions in view presentation) or by you with NSLog.
Or did you mean when the app is not tethered to your computer? There are other tools for that - including just plugging the phone back in and downloading the logs off the device.
I have an application built in IPA file by Adobe Flashbuilder (with AIR) the app works smoothly on iPad. Well.. worked smoothly until I had encountered some memory leaks. Is it possible to monitor this application's memory usage with Apple's Instruments?
For now I am deploying this app by dragging IPA file into iTunes and synchronize then.
I need to monitor this app. Is it possible? What should be eventually done to make it working?
Yes. you can analyse using instruments.
Install your app in your device.
Connect your device to your Mac.
Open Instruments and select Leaks (you can select any option infact, like Allocations etc.,) in the dialog that appears.
In the Top Left corner, you will see "Choose Target". the first two options are your device and your Mac. Select your device.
In the same menu, the 5th option is again "Choose Target". There you will see all the installed applications in your device. Select the app you want to analyse.
Finally, Press Record, and you will see your app running in the device and Leaks/Allocations (whatever you have selected) being shown in the instruments.
Hope this helps you.
Try running Instruments and select an installed app on your device, if you get this message, you know what's happening
Target failed to run: Permission to debug com.fantageek.MyApp was
denied. The app must be signed with a development identity (e.g. iOS
Developer).
I believe it's possible through the Xcode organiser. It outputs events happening on the device to a log. Don't quote me on that though