的Andr​​oid NDK发布版本 [英] Android NDK release build

查看:194
本文介绍了的Andr​​oid NDK发布版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图建立我在释放模式的Andr​​oid项目。 是否有任何优化旗(县),我需要建立我的项目在释放模式设置?

I trying to build my android project in release mode. Is there any optimization flag(s) I need to set in order to build my project in release mode?

推荐答案

除非您已经创建了Application.mk或定义您的应用程序可调试的Andr​​oidManifest.xml中内你没有做任何事情,因为默认该应用程序的模块中的发布编译的模式的NDK-构建脚本。

Unless you have created the Application.mk or defined your application as debuggable inside the AndroidManifest.xml you don't have to do anything because by default the application's modules are compiled in release mode by the ndk-build script.

否则,您可以使用APP_OPTIM指令的Application.mk文件中:

Otherwise, you can use the APP_OPTIM directive inside the Application.mk file:

APP_OPTIM := debug
APP_PLATFORM := android-14
APP_STL := gnustl_static
APP_ABI := armeabi armeabi-v7a

这是Android的NDK-r8d /文档/应用-MK.html文件:

From android-ndk-r8d/docs/APPLICATION-MK.html file:

APP_OPTIM
    This optional variable can be defined to either 'release' or
    'debug'. This is used to alter the optimization level when
    building your application's modules.

    A 'release' mode is the default, and will generate highly
    optimized binaries. The 'debug' mode will generate un-optimized
    binaries which are much easier to debug.

    Note that if your application is debuggable (i.e. if your manifest
    sets the android:debuggable attribute to "true" in its <application>
    tag), the default will be 'debug' instead of 'release'. This can
    be overridden by setting APP_OPTIM to 'release'.

    Note that it is possible to debug both 'release' and 'debug'
    binaries, but the 'release' builds tend to provide less information
    during debugging sessions: some variables are optimized out and
    can't be inspected, code re-ordering can make stepping through
    the code difficult, stack traces may not be reliable, etc...

这篇关于的Andr​​oid NDK发布版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆