安卓软件开发常用命令集合

本文首发地址 https://h89.cn/archives/180.html
最新更新地址 https://gitee.com/chenjim/chenjimblog

adb 常用命令

adb 相关命令已经抽离到单独博文 adb常用命令详解–提升开发效率利器


android 源码编译相关命令

## 创建仓库,repo 使用可参考  http://h89.cn/archives/254.html
repo init -u ssh://ha/t700_v5.1/manifest
repo sync
./build/envsetup.sh  #加载编译环境变量
lunch  cm_klimtwifi-userdebug  #设置编译的项目
make -j8    #8 cpu 编译
make otapackage -j8    #ota打包

mmm packages/apps/Browser2/  #编译模块Browser2   
make Browser2  #同上,编译模块Browser2
# 以下命令 参考 build/envsetup.sh
croot: Changes directory to the top of the tree.  
m: Makes from the top of the tree.  
mm: Builds all of the modules in the current directory, and their dependencies.  
mmm: Builds all of the modules in the supplied directories, and their dependencies.  

framework 开发相关

  • 打开 ActivityManager等模块日志
    修改 ActivityManagerDebugConfig.java 中 DEBUG_ALL 为 true
    类似很多 JAVA 和 CPP 文件头都定义了 LOG 开关,可以针对性开启

fastboot下载system.img等

adb reboot bootloader
sudo fastboot flash system '/out_roms/system.img'
sudo fastboot reboot

sideload 刷入OTA升级包

例如 刷入 build-ota—123.zip
adb reboot recovery
设备重启后选择apply update from adb
adb sideload build-ota-123.zip


tar 常用命令

  • tar 分卷压缩
    要将目录logs打包压缩并分割成多个1M的文件,可以用下面的命令
    tar cjf - logs/ |split -b 1m - logs.tar.bz2.
    完成后会产生下列文件
    logs.tar.bz2.aa, logs.tar.bz2.ab, logs.tar.bz2.ac
  • tar 分卷解压
    cat logs.tar.bz2.a* | tar xj
  • 压缩为.tar.gz的包
    tar czf hello.tar.gz hello
  • 解压.tar.gz到已存在的目录
    tar xvzf hello.tar.gz -C out.dir

Android NDK开发Crash错误定位

原文http://blog.youkuaiyun.com/xyang81/article/details/42319789

  • 方式1:使用arm-linux-androideabi-addr2line 定位出错位置
    以arm架构的CPU为例,执行如下命令:
    android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-addr2line -e hello-jni/obj/local/armeabi-v7a/libhello-jni.so 00000cf4 00000d1c
    -

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

清霜辰

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值