Android NDK Debug C + + source (GO)

Source: Internet
Author: User

"Original articles, reproduced please retain or indicate the source, http://download.csdn.net/download/bigmaxim/5474055"

1. Related software

Adt-bundle-windows-x86.zip---Eclipse integrated ADT plug-in and requires a networked installation of the appropriate Android SDK.

Jdk-6u43-windows-i586.exe---JDK6 Eclipse runtime requires a Java environment, and a Java compiler is also required for compiling Android apps.

Android-ndk-r8e-windows-x86.zip---ndk r8e, which supports development in the C language for Android applications. Description: Ndk-build can not need Cygwin environment.

Cygwin---Use ndk-gdb debug C source code, need Cygwin environment support.

2. WinXP System environment variable configuration

Adb_path=d:\greenprogram\adt-bundle-windows-x86\sdk\platform-tools

Classpath=.; %java_home%\lib;%java_home\lib\tools.jar

Cygwin_bin=c:\cygwin\bin

Eclipse_path=d:\greenprogram\adt-bundle-windows-x86\eclipse

Java_home=c:\program files\java\jdk1.6.0_43

ndk_root=d:\greenprogram\adt-bundle-windows-x86\android-ndk-r8e

path=%java_home%\bin;%java_home%\jre\bin;%ndk_root%;%adb_path%;%cygwin_bin%;%eclipse_path%

3. Cygwin configuration

In the home directory of the current user. Add the following 2 lines to the end of the Bash_profile

ndk_root=/cygdrive/d/greenprogram/adt-bundle-windows-x86/android-ndk-r8e

Export Ndk_root

To facilitate debugging, you can add the following line. When you start Cygwin, go directly to the project directory.

Cd/cygdrive/f/eclipseworkspace/01_capella/05_test/01_l1test/emvtest

4. Application Engineering Configuration

Add the path to the NDK in the Window–> preferences->android. Ndk.

Debuggable is set to true in the Androidmanifest.xml file.

NDK compilation settings: Ndk-build ndk_debug=1 v=1.

Right-click on an item in Android project and select Add Natie support in Android tools, which will increase the compile Link option for C/R + +.

5. C Source level debugging in native method

5.1. After compiling the application, generate the file.

5.2. Right click on Project->run as->android application.

Download the installation application to the Development Board (or emulator) and launch the application.

Note: This is just to install the generated application to the Development Board (or emulator)

5.3. Launch Cygwin into the current project directory.

Execute command ndk-gdb--force--verbose–start

Quit by typing quit at prompt <gdb>.

4 files were added under directory obj\local\ Armeabi.

5.4. Right click on Project->debug as->android Native application.

Set breakpoints in the location where debugging is required and start C source level debugging.

6. References

http://download.csdn.net/download/bigmaxim/5474055

http://xzhoumin.blog.163.com/blog/static/408811362013230517254/

Android NDK Debug C + + source (GO)

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.