Debug vs. Release builds in the Android NDK

吃可爱长大的小学妹 提交于 2019-12-02 19:40:22

Do you have different Application.mk files for each target?

No. Separate subdirectories, all with their own Android.mk (shared and static libs) but only one Application.mk for me.

My Application.mk is just:

APP_STL := gnustl_static
APP_OPTIM := debug

I'm still uncertain what the best method is for building Debug vs. Release versions of our .so file. Changing things by hand every time is getting old.

It's a bit spread out, for me at least, using the jni/Android.mk + Application.mk layout.

Application.mk has APP_OPTIM := debug Then in the application element of AndroidManifest.xml I have android:debuggable="true" When you build with ndk-build, it uses this manifest flag to determine optimization (which is useful to turn off or on, off for profiling, etc.)

(A Little Off topic) I recently ran across

https://code.google.com/p/android-ndk-profiler/

Which, when combined with http://code.google.com/p/jrfonseca/wiki/Gprof2Dot

Generates some pretty images to help my little mind grasp how things are running over on the phone itself.

You're not required to use the Android.mk system to build your .so's. Personally, I use my own Makefile's with the targets I need and this allows for very standardized debug vs. release build specification.

I use a single file to build a library for diferent targets. In the Application.mk add this "APP_ABI := armeabi armeabi-v7a" it works for me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!