GIT
git remote -v 查找远程仓库
ADB
0#####解决adb突然连接不上的问题
1.查找:ps aux |grep adb
huangxi+ 2331142 1.0 0.0 422820 4324 ? Ssl 15:23 0:49 adb -L tcp:5037 fork-server server --reply-fd 4
huangxi+ 2336948 0.0 0.0 12108 2632 pts/27 S+ 16:42 0:00 grep --color=auto adb
2.杀死
kill -9 2331142
3.重启
adb start-server
1#####修改SettingsProvider的数据
adb shell settings get [ global/system/secure ] [ key ]
比如:adb shell settings get system keypad_backlight_duration
adb shell settings put [ global/system/secure ] [ key ] [ value ]
adb shell settings list [ global/system/secure ]
2#####键值对的方式写系统值
adb shell setprop key value
3.#####录制视频
adb shell screenrecord --time-limit 30 /sdcard/test.mp4 //限制30秒
adb pull /sdcard/test.mp4 /data
4.#####屏幕截图
adb shell screencap -p /sdcard/testshot.png
adb pull /sdcard/testshot.png /data
5.#####查找当前设备所在的界面
对于系统应用Settings特别好用
adb shell dumpsys activity top
6.#####查询当前设备的型号
adb shell getprop ro.product.model
其中key "ro.product.model"的值由android.os.Build.MODEL得到
7.#####抓取内存快照文件
adb shell am dumpheap com.android.settings /data/local/tmp/a.hprof
导出文件
adb pull /data/local/tmp/a.hprof ./
/data/local/tmp/a.hprof: 1 file pulled. 3.3 MB/s (109783999 bytes in 31.704s)
8.#####设置字体大小
adb shell settings put system font_scale 1.0
9.#####通过uid查询包名
adb shell pm list packages --uid 10123
10.#####通过pid查询包名
adb shell ps -p 10859
查找相关
1.#####抓取多个关键字的log
adb shell
logcat | grep -i -E “start u0|ActivityTaskManager|WindowManager” --color
2.#####找出包含某个关键字的文件
grep -rl -E “Force peak refresh rate”
或
grep -rn 关键字
3.#####找出包含某个关键字的指定文件类型
grep -rl -E “Force peak refresh rate” --include “*.xml”
4.#####找出包含某个关键字的指定文件类型
grep -r -i -E “android|os” --include “*.java” --color
5.#####查找进程(Window中用findstr,Linux中用grep)
adb shell ps -A |findstr zygote
或者
adb shell
ps -A |grep zygote
6.#####查找系统资源的值
adb shell cmd overlay lookup <package> <package>:<type>/<name>
如:db shell cmd overlay lookup android android:integer/config_doublelineClockDefault
系统应用调试
替换手机里面的apk
例如,替换SystemUI.apk,Settings.apk同理
adb shell pm path com.android.systemui //查找出apk在手机中的路径。
package:/system/priv-app/SystemUI/SystemUI.apk
adb shell
cd /system/priv-app/SystemUI/
/system/priv-app/SystemUI/ # mv SystemUI.apk System.apk.bak // 通过修改后缀名,使其不生效,或者拷贝出去备份一下
// 如果有oat目录,把oat目录删除
adb push SystemUI.apk /system/priv-app/SystemUI/
adb shell pm clear com.android.systemui // 清除应用数据
adb reboot // 重启后,替换的apk才生效
编译相关
1.#####单独编译
source build/envsetup.sh
lunch
cd 对应模块路径
mm
或者
source build/envsetup.sh
lunch
make PermissionController -j8
1.##### ninja快速单编
源码根目录下执行
./prebuilts/build-tools/linux-x86/bin/ninja -f out*/combined*.ninja DKSettings
其中,DKSettings为模块名,如果是MTK平台,则为MtkSettings
619

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



