Symbian 3rd Debug on Device

Source: Internet
Author: User

Method 1: Debug on Device of carbide C ++ v1.2

The Pro of carbide C ++ 1.2 and later versions support device debugging, which is truly amazing.

It is quite convenient to implement this function. Of course, the premise is that you are using the pro. Or later version of carbide C ++ v1.2.

Write the program in normal mode and get it almost on the simulator. To debug the program on the device, you only need to perform the following steps:
1. First install a software in the device. The installation package is located in the installation directory of carbide. The location on my machine is C:/Nokia/carbide. c ++ v1.2/plugins/COM. nokia. carbide. TRK. support_1.2.0.29/TRK/s60, there are two sisfiles below, because I want to debug on n73, So I select s60_3_0_app_trk_2_7.sisx, And the other 3_1 is used for 3rd. FP1 mobile phone. After installation, there will be a TRK application in the mobile phone.

2. After the installation is successful, start the TRK service on the mobile phone. Because I use a USB cable, change the option to USB and set the port to 1 (this is strange, clearly, my port should be com6 ). After startup, the window displays status: connected.

3. In carbide C ++, configure the compiling output target as phone debug (gcce). This is very important. Only debug is required. Compile the sisx file.

4. Open the debug window (debug...) and create a new project under the first item "Symbian OS app TRK" in the configuration. Shows the input of several windows:



5. Click Apply and debug to start debugging. The rest is the same as debugging in the simulator.

Method 2: Debug using the ECMT tool provided by the s60 SDK

If we use the Express version of carbide C ++ (free version), we cannot perform online device debugging, however, you can use the tool in the SDK to print the debugging information in the program to the console. Brew mainly relies on this method.

Symbian provides a remct for remote debugging. It also provides two tools: ecmtagent_cpp.sis on the mobile phone end and device connection on the PC end.

This method is a little more complex than the previous one because it involves code modifications.

1. Install ecmtagent_cpp.sis on your mobile phone (but 3rd. this item cannot be used in the SDK. It indicates an error such as signature expiration. You can only install 3rd. the same name SIS under the FP1 SDK. Alas, I don't know what Nokia is ).

2. Before debugging, you also need to start the ecmtagent agent on your mobile phone and set it to a USB connection (you do not need to select a port ). Then, the listening window is displayed.

3. Start the device connection on the PC, select com6 to connect it, And the status becomes connected. At this time, the phone also shows connected. The connection is successful. Open the diagnostics tool in device connection. All debugging information is output to its window.

4. the most troublesome thing is to modify the code.

A) modify the MMP 'and add the Lib. That is: Library ecmtclient. Lib

B) add the following to the H file of the class for which debugging information is to be output:

# Ifdef _ debug
# Include <ecmtclient. h>
# Endif

......
Class cdemouiappview: Public ccoecontrol, mbeating {
......
PRIVATE:
# Ifdef _ debug
Recmt iecmt;
# Endif

C) then add an initialization and destruction in CPP.

Void cdemouiappview: constructl (const trect & arect)
...{
Createmediawl ();

......

# Ifdef _ debug
Iecmt. Connect ();
# Endif

}

Cdemouiappview ::~ Cdemouiappview ()
...{
......
# Ifdef _ debug
Iecmt. Close ();
# Endif

}

D) the output is as follows:

Void cdemouiappview: Beat ()
...{
This-> total ++;
If (this-> total> 100)
...{
This-> total = 0;
Iheart-> cancel ();
}
Tbuf <16> Buf;
Buf. Format (kmsgformat, this-> total );
Ilabel-> settextl (BUF );
Drawnow ();

# Ifdef _ debug
Iecmt. writeformat (kformattedtext, this-> total );
# Endif

}

5. Compile the program, which is also the phone debug under gcce. Manually install it on your mobile phone and execute it. Note that the previous ecmtagent is running and you need to switch it to the background (not to close it !!!). The output debugging information is displayed in the diagnostics window.

The last thing I need to add is that when I try these two debugging methods, I often encounter port opening failure or connection failure. Generally, it is normal to restart the mobile phone, I don't know if it is a bug or because I have made two proxies conflict in the mobile phone at the same time. If you find it is not satisfactory during use, restart the mobile phone.

Reference from: http://www.sf.org.cn/Article/lumen/200803/20901.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.