Symbian developer community

wiki

Getting Started with Debugging on the Device

From Symbian Developer Community

Jump to: navigation, search

This tutorial is for new C++ developers who want to debug on a production phone.

The emulator can be used for most of your debugging work. However, some situations still require debugging on a real device – for example, when you want to use hardware that isn't supported by the emulator (e.g. the camera or the acceleration sensor). In addition, some defects only show up on real hardware - e.g. those related to the hard memory constraints and speed differences. There is list of differences between the emulator and hardware in the SDK documentation here: » Symbian OS Tools And Utilities  » Emulator  » Emulator guide » Emulator/native platform differences.


Note
This is a short tutorial which discusses the basic steps; A lot more information is available in the Carbide Help (Windows: start | All Programs | Symbian Foundation ADT 1.0 | Carbide.c++ | Carbide.c++ Help) in the section Carbide.c++ User Guide > Debugging projects (especially sub-topics "On-Device Connections Overview" and "Debugging variations").


Contents

Carbide.c++ and Target Configuration

1. Make sure that the Phone Debug build configuration is activated:
2. Next, click on the Debug button to start building and executing your application in debug mode.

3. The first time you are using on-target debugging, Carbide.c++ automatically generates a debug configuration. A wizard guides you through setting up the connection on your phone.

  • In the first step, choose the default Application TRK Launch Configuration:
  • In the following New Connection page, click on New to set up a new on-device debug connection to your phone. Enter a connection name for the phone that you want to use for debugging, and select whether to use USB or Bluetooth. In this example, we’re going to use USB, so make sure that the phone is connected to the PC via the USB cable (setting up a Bluetooth connection is similar to this process).


  • The next step, called USB Settings, allows you to configure and test the connection. A remote agent must first be installed on the device to establish the debug connection between your phone and the device.
  • Switch to the Install remote agents tab and select the appropriate remote agent for your version of S60 – in this case, 5.0.0 for S60 5th Edition.


Note
Installing the remote agent through this dialog only works if the Nokia PC Suite is running and your device is connected. If you do not have the Nokia PC Suite on your PC, install the debug agent manually by clicking on Save. Store the installer file anywhere on your PC and transfer it to your device as described in Symbian C++ Quick Start#Building for the Device.


  • After you have installed the debug agent on the phone, start it from the Application folder of the phone menu. Make sure that the status message from the App TRK application tells you that its status is Connected. You can switch between USB and Bluetooth mode by using the options menu. By default, Bluetooth is activated, so the application asks you to set up a Bluetooth connection when you first start it. If you want to use USB, cancel this request, go to the settings and switch to USB.
  • Now, you should be able to see and select your device from the Serial Port drop-down list. On your PC, the COM port number is likely to be different to the one shown in the screenshot.
  • Next, select the device OS – again, S60 5.0.0 corresponds to Symbian^1 SDK. Click on Initiate service testing to see if the connection is working. If successful, you should see the status message:
  • Click on Next to save your new connection settings. You will then jump back in the previous wizard.

4. Continue to the TRK SIS Selection dialog. If no .sisx file is defined in the SIS File to Install box, click on the dialog's Modify SIS builder settings for build configuration... link to define a new SIS builder configuration (as described in Building a SIS File in Carbide.c++).


5. Click on Finish to start debugging! The application is now built; the resulting .sisx file is silently installed on the phone and launched immediately afterwards. You can set breakpoints in Carbide.c++, debug your application and view memory regions just as when developing on the local PC.


Note
You only have to enter these settings once! Next time you debug your application on the phone, simply start the TRK agent on your phone and establish the USB/Bluetooth connection, then press the debug button on Carbide. Everything else is handled automatically.


Summary

This tutorial explained how you configure your phone and Carbide for on-device debugging.

Related Info

Sign in to comment…