文章目录
本文首发地址 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
-

最低0.47元/天 解锁文章
883

被折叠的 条评论
为什么被折叠?



