Windows 7 64 Wei Android NDK debugging

Installation Development Environment

SDK: adt-bundle-windows- x86-20131030 Download: HTTP: //dl.google.com/android/adt/adt-bundle-windows-x86-20131030.zip
NDK: Android-ndk-r10e-Windows-x86. exe download: http: //dl.google.com/android/ndk/android-ndk-r10e-windows-x86.exe

SDK comes with API Android 4.4, you can add yourself API Android 2.2 or higher. Download 2.2: http: //dl.google.com/android/repository/android-2.2_r03-linux.zip, decompression, can be copied to the platforms

Look ndk own example

The following assumptions SDK installation to the D: \ adt-bundle-windows-x86-20131030, NDK installed to D: \ android-ndk-r10e


1. Start D: \ adt-bundle-windows-x86-20131030 \ eclipse \ eclipse.exe (need to install jdk environment, JDK6u45 can)

2, introducing D: \ android-ndk-r10e \ samples \ hello-jni

3, the path setting NDK: Windows-> Preferences-> NDK-> D: \ android-ndk-r10e

4, set NDK_Builder, compile jni, how to set the network search, without saying

5, add NDK Debug support for the project: Project Right Android Tools-> Add Native Support, so the file name blank (automatically generated .cpp file, the file name space, you can delete it)

6, by adding the NDK include: Project Right Property -> C / C ++ General -> Paths and Symbols -> Add -> Option D: \ android-ndk-r10e \ platforms \ android-21 \ arch-arm \ usr \ include bar ,or others

7, NDK is compiled in debug information: Project Right Property -> C / C ++ Build -> Build command: ndk-build NDK_DEBUG = 1

8, ignore the version check provided in AndroidManifest.xml: deleting rows <uses-sdk android: minSdkVersion = "8" />

9 until the debugger start: NDK gdbserver debug start wait, wait cycles can be added     
    {
    int I;
    for (I = 0; I == 0;)
    {
        Continue;
    }
    }
The break is set continue, after the operation, so that i = 1 to enter the normal debugging.

10, start the debugger: Perspective-> Java, engineering right -> Debug As -> Android Native Application

Note: Use AVD virtual device debugging is very slow (android 2.2 can not debug at AVD), using the android device debugging normal. (Host i7 2600, Win7 64-bit)





Published 26 original articles · won praise 2 · views 50000 +

Guess you like

Origin blog.csdn.net/lang999888/article/details/55510422