Android 编译命令及选项

1 运行 build/envsetup.sh, 该文件提供 m,mm,mmm 等命令

#. ./build/envsetup.sh

注意 : . . 之间是空格

运行之后用 help 查看命令

#help

m 编译整个 android 工程

mm 编译当前目录下的模块

mmm path 编译指定目录下的模块

2 配置参数

#tapas

运行该命令后会出现 :

Build for the simulator or the device?
1. Device
2. Simulator

Which would you like? [1]

Build type choices are:
1. release
2. debug

Which would you like? [1]

Product choices are:
1. emulator
2. generic
3. sim
You can also type the name of a product if you know it.
Which would you like? [generic]

以上产品选项是默认的 , 如果 vendor/ 目录下有产品 , 则会自动扫描进去 .

3 附加 : 如何在 vendor 下添加产品

HTC 为例 :

vendor/htc/dream-open 在配置时会出现如下错误 :

build/core/product_config.mk:173: *** No matches for product "dream-open".

原因是 :

vendor/htc/dream-open/htm_dream.mk PRODUCT_NAME := htc_dream , 所以 dream-open 要改为 htc_dream, 还有文件夹命名不能有 – ( 中间 ), 但可以有 _( 底下 )

dream-open -> htc_dream

PRODUCT_NAME := htc_dream

PRODUCT_DEVICE := htc_dream

更多相关文章

  1. Android(安卓)APP tcpdump抓包方法
  2. android 编译出来的执行文件 not executable: magic 7F45
  3. Error generating final archive: Debug certificate expired on
  4. Android(安卓)4.0 编译全程
  5. Android之解决java.lang.UnsatisfiedLinkError: dlopen failed:
  6. Android(安卓)串口通讯集成
  7. Android开机键失灵启动手机的解决办法
  8. 安卓模拟器Android(安卓)studio中VT-x is disabled in BIOS问题
  9. Android(安卓)Studio下Jni开发配置

随机推荐

  1. 设置Android输入法的回车键
  2. android SAX
  3. Android Gradle版本和Android plugin版本
  4. Android中如何判断是否联网
  5. 通过Intent在Activity|Service之间传递数
  6. android sqlite 中文乱码。。麻烦详细点
  7. Android studio中新建类时自动生成注释的
  8. Android为Menu添加item及响应函数
  9. Android Unable to execute dex: java.ni
  10. Android(安卓)属性动画工作原理