Android编译
单独service:
mmm frameworks/base/services/
adb shell rm /system/framework/oat/arm64/services.art
adb shell rm /system/framework/oat/arm64/services.odex
adb shell rm /system/framework/oat/arm64/services.vdex
adb push ./system/framework/services.jar /system/framework
adb root;adb remount ;adb shell rm /system/framework/oat/arm64/services.art;adb shell rm /system/framework/oat/arm64/services.odex ;adb shell rm /system/framework/oat/arm64/services.vdex;adb push ./system/framework/services.jar /system/framework;adb shell sync
单独framework:
inja framework
adb push out/target/product/**/system/framework/framework.jar system/framework/
adb push out/target/product/**/system/framework/arm system/framework/
adb push out/target/product/**/system/framework/arm64 system/framework/
adb push out/target/product/**/system/framework/boot* system/framework/
手机命令
手机截图命令:
screencap -p /data/1.png
内核打印:
cat /dev/kmsg
dmesg
跳过开机向导:
adb shell settings put secure user_setup_complete 1
adb shell settings put global device_provisioned 1
进入9008:
adb reboot edl
fastboot reboot emergency
GPS 数据库:
settings put secure location_providers_allowed :定位方式格式
settings get global assisted_gps_enable :定位功能打开/关闭
sensor:
sns_dsps_tc0001 :查看sensor相关信息
sns_cm_test: 传感器数据
**IP连接QXDM: **
adb shell diag_socket_log -a <Host Computer IP Address> &
刷机
关闭vbmeta校验
fastboot --disable-verity flash vbmeta_a vbmeta.img
锁:
fastboot oem unlock-flash
fastboot oem enable-rooting
fastboot flashing unlock
Linux命令
在不是 dir0* 目录下面找*.txt的文件: find ./ ! -path './dir0*' -name *.txt
查看文件夹大小: du -h --max-depth=1
grep查找时排除out目录和.c文件: grep -rn "BRILLO" --exclude-dir=out --exclude=*.c
第一列含有”modi“则打印相应的第二列:
awk -F ":" '($1 ~/modi/){print $2}'
grep查找两个条件(or):
grep -Ein 'gnss|loc'
find 最大深度查找不区分大小写:
find -iname name -maxdepth 1
du指定深度:
du -h --max-depth=1
时间显示:如下命令显示实例:20190220_16:38:07.18432
date +%Y%m%d_%H:%M:%S.%5N
echo 命令: echo -ne "\r"
-n,不换行;-e和\r配合,光标移至行首
GIT操作命令:
将暂存区的修改回退到本地:git reset HEAD <file>
把本地所有git清理到干净状态:repo forall -c "git clean -fd ;git reset --hard HEAD"
回退到指定时间点:repo forall -c 'commitID=
git log --before “2019-12-02 23:00” -1 --pretty=format:“%H”; git reset --hard $commitID'
手机相关
adb通过ip连接: adb tcpip 5555
vendor.img 镜像解压:
1) 将Android sparse image格式的vendor.imag转换成e普通格式:simg2img vendor.img vendor.img.ext4
2)mount 镜像:sudo mount -t ext4 -o loop vendor.img.ext4 /tmp/vendor/
VTS 环境:
sudo apt-get install python-dev
sudo apt-get install python-protobuf
sudo apt-get install protobuf-compiler
sudo apt-get install python-virtualenv
sudo apt-get install python-pip
pip install protobuf compiler virtualenv
Android 源码网址
android 源码,内容较新但是无内核代码:http://aospxref.com/
Android10.0及以下,kernel4.4及以下: https://androidos.net.cn/sourcecode