Log in

View Full Version : [FTC]: How to debug the Android platform


mikets
27-09-2015, 12:12
I was playing around with the Robot Controller code and have somehow introduced a run-time exception (null pointer exception). The problem is: I don't know how to debug it. If the phone were connected to the PC, I may be able to do a stack dump and find out where the null pointer exception occurred. But the phone was connected to the robot and all the screen display said was I have a null pointer exception and did not tell me where. I can't run the code when the phone is connected to the PC. How do you debug run-time errors? If I put System.out.print in the code, where does this output to? I know I can do telemetry.addData to send info to the Driver Station but it is not the friendliest way to debug because it is not as flexible as printf and I had to do a format string before calling telemetry.addData.

JohnMMcD
28-09-2015, 12:04
Check out http://ftcforum.usfirst.org/showthread.php?4235-Community-generated-Phone-Setup-vidoes&p=13991&viewfull=1#post13991 for instructions on how to set up Android's Wireless Debug Bridge. See also http://developer.android.com/tools/help/adb.html#wireless