首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Android NDK发布版本

Android NDK发布版本
EN

Stack Overflow用户
提问于 2013-01-28 23:07:59
回答 1查看 10.4K关注 0票数 15

我尝试在发布模式下构建我的android项目。为了在发布模式下构建我的项目,我需要设置什么优化标志吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-01-29 17:47:56

除非已经在AndroidManifest.xml中创建了Application.mk或将应用程序定义为可调试,否则无需执行任何操作,因为默认情况下,应用程序的模块是由ndk-build脚本以 release 模式进行编译的。

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

代码语言:javascript
运行
复制
APP_OPTIM := debug
APP_PLATFORM := android-14
APP_STL := gnustl_static
APP_ABI := armeabi armeabi-v7a

从android-ndk-r8d/docs/APPLICATION-MK.html文件:

代码语言:javascript
运行
复制
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...
票数 27
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14564918

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档