Debugging is the process of methodically finding and fixing defects in your application. You typically perform debugging with a specialized debugger tool. Both Nokia IDE for Java ME (Eclipse) and NetBeans provide a debugger that you can use with MIDlets. You can debug a MIDlet in an emulator or on a device. On-device debugging (ODD) is an advanced and precise method for debugging MIDlets directly on a device. The process for on-device debugging is completely different in its setup phase.
On-device debugging is supported on selected Series 40 6th Edition and newer devices.
To debug a MIDlet on a Series 40 device:
Download the Series 40 On-Device Debugger.
Setup the debugger and integrate it with the IDE you use for debugging.
Connect the debugger to the Series 40 device.
Debug the MIDlet using the IDE. You can also retrieve tracing data from the MIDlet.
For detailed instructions, see the Series 40 On-Device Debugger User Guide provided with the debugger.
For Nokia Asha software platform devices, please consult the On-Device Debugger section in the SDK’s documentation.
If you are debugging using NetBeans, follow the steps below:
From the Debug menu, select Attach Debugger.
In the Attach dialog, ensure that the following values are selected/specified and click OK.
Debugger: Java Debugger (JPDA)
Connector: Socket Attach
Transport : dt_socket
Once NetBeans is connected to the port, in the Output-Debugger Console you can see messages like “Attaching to 2INN00315:1234”.
This section explains how to debug your MIDlet. To debug MIDlets using NetBeans / Nokia IDE for Java ME (Eclipse), perform the following steps:
Select Tools ->Debug MIDlet from the SDK Menu, browse to the MIDlet jar path and press Start Debugging button, and insert breakpoints wherever required.
Do attach debugger on NetBeans/Debug configurations on Nokia IDE for Java ME (Eclipse) with the port 1234 for the MIDlet you are debugging.
Set the MIDlet you want to debug as the main project.
From the Run menu, select Debug Configurations.
Right-click on Remote Java Application and select New to create a new configuration.
Select the Connection Type as Standard (Socket Attach).
Specify the Port to debug (which should be same as the port in the run.bat file, example 1234) and click Debug.
Nokia IDE for Java ME ( Eclipse) waits for the connection to be established.