{{theTime}}

Search This Blog

Total Pageviews

Remote Debugging Setup Using Eclipse

To debug a program remotely, you must be able to launch the program in debug mode on the remote machine so that it will wait for a connection from your debugger. The specific technique for launching the program and connecting the debugger are VM-specific. The basic steps are as follows:
1. Ensure that you are building your Java program with available debug information. (You can control these attributes from the java compiler preference page).
2. After you build your Java program, install it to the target computer. This involves copying the .CLASS files or .JAR files to the appropriate location on the remote computer.
3. Invoke the Java program on the remote computer using the appropriate VM arguments to specify debug mode and a communication port for the debugger.
4. Start the debugger using a remote launch configuration and specify the address and port of the remote computer.
When setting up the remote launch configuration there are a few items to take note of:
• You must ensure you enter the correct hostname i.e. the name of the remote computer where you are currently running your code. The hostname can also be the IP address of the remote machine, for example using 127.0.0.1 instead of localhost.
• The port number must be the number of the port on the remote machine.
Eclipse Setup:
The Remote Java Application launch configuration should be used when debugging an application that is running on a remote VM. Since the application is started on the remote system, the launch configuration does not specify the usual information about the JRE, program arguments, or VM arguments. Instead, information about connecting to the application is supplied.
To create a Remote Java Application launch configuration, do the following:
1. Select Run > Debug from the workbench menu bar (or Debug... from the drop-down menu on the Debug tool bar button) to show the launch configuration dialog.
2. Select the Remote Java Application in the list of configuration types on the left.
3. Click the New toolbar button. A new remote launch configuration is created and three tabs are shown: Connect, Source, and Common.
4. In the Project field of the Connect tab, type or browse to select the project to use as a reference for the launch (for source lookup). A project does not need to be specified.
5. In the Host field of the Connect tab, type the IP address or domain name of the host where the Java program is running.
If the program is running on the same machine as the workbench, type localhost.
6. In the Port field of the Connect tab, type the port where the remote VM is accepting connections. Generally, this port is specified when the remote VM is launched.
7. The Allow termination of remote VM flag is a toggle that determines whether the Terminate command is enabled in the debugger. Select this option if you want to be able to terminate the VM to which you are connecting.
8. Click Debug. The launch attempts to connect to a VM at the specified address and port, and the result is displayed in the Debug view. If the launcher is unable to connect to a VM at the specified address, an error message appears.

No comments:

Could not find method signingConfigs() for arguments

Could not find method signingConfigs() for arguments [build_5dw7nwfc8ibd8sagvx4p79x1u$_run_closure5@13e86039] on root project 'android&#...