I am using Titanium Studio. I build an application, I can debug the application in Android Emulator properly, but in device, it crashes. How can I debug the application in android Device? If any idea then suggest me..! Thanks in advance.
3 Answers
When connecting the device to a computer, check to see if the device is recognized by adb by entering the command adb devices into the terminal or cmd prompt. If an I number is shown than your device is connected. Then you can enter the command adb logcat which will show you the entire log of the device.
One drawback I've found with using Titanium Studio 3's debug mode is that if the Android app crashes, I have to recompile and reinstall my app to restart Titanium's debug server. It's still useful for setting breakpoints in my code and stepping through it.
So my current debug workflow involves a combination of
- in Ti Studio 3, install app in debug mode, use breakpoints and expressions
- in my OSX/Linux command line, using
adb -d logcat | grep -G '\(TiAPI\)\|\(TiApp\)'to view console logging for only the Titanium App- multiple instances of
adb -d logcatcan run at the same time, so I'm experimenting with keeping multiple running with different filters
- multiple instances of
Adb alone is useful when I'm getting closer to a bug and might just need to reproduce it a few more times. The 1 minute recompile/reinstall time is painful in these situations