Debugging native libraries for Android OS

前端 未结 2 1533
太阳男子
太阳男子 2020-12-09 00:07

I am to create a shared library for Android OS. Although I have done some Android apps in Eclipse I decided to start my native development with Visual Studio and vs-Android

相关标签:
2条回答
  • 2020-12-09 00:54

    The steps I take to be able to debug using ndk-gdb

    To build

    Set the -g compiler flag in jnk/Android.mk to build the gdb-server

    LOCAL_CFLAGS := -g
    

    Build the native lib for debugging NDK_DEBUG=1

    ndk-build NDK_DEBUG=1
    

    Set the application debuggable in the manifest.

    android:debuggable=true
    

    Open cygwin and cd to the project path. Set the path to adb.

    export PATH=$PATH:/path_to_android_sdk/platform-tools
    

    And then start gdb

    ndk-gdb --verbose --adb=adb.exe
    

    You will have to type continue when you have connected to the gdb-server

    0 讨论(0)
  • 2020-12-09 00:55

    There is a step-by-step tutorial on debugging vs-android projects with Visual Studio here: http://visualgdb.com/tutorials/android/vs-android/

    0 讨论(0)
提交回复
热议问题