1. adb shell wm size
Physical size: 1600x480
2. adb shell wm density
Physical density: 160
3:打开window 动态调试开关
dumpsys window -d enable a
AMS log开关命令:adb shell dumpsys activity log x on user版本请如下打开AMS log开关:/frameworks/base/services/core/java/com/android/server/am/ActivityManagerDebugConfig.javastatic boolean DEBUG_ALL = false; //置为true
4:readelf -t fingerprint.default.so 读取elf文件段信息
readelf --string-dump=".sunwave.version" fingerprint.default.so 从版本段获取版本信息
5:打开与关闭mtklog
adb shell am broadcast -a com.mediatek.mtklogger.ADB_CMD -e cmd_name start --ei cmd_target 7 adb shell am broadcast -a com.mediatek.mtklogger.ADB_CMD -e cmd_name stop --ei cmd_target 7
userdebug 抓systrace, 需要打开mtklog
adb shell aee -d coreon adb shell aee -d directon adb reboot
启动mtklog am start com.mediatek.mtklogger/.MainActivity
启动sprd log am start com.sprd.engineermode/.EngineerModeActivity
外销开机向导是有紧急拨号盘的,进入紧急拨号盘按*#812#可以跳过开机向导,状态栏以及导航键也可以正常使用
am start com.oppo.logkit/.main.OppoLogkitLoggingActivity
*#800#
*#8778# 打开恢复出厂设置
7、参考settings数据库
settings list system|grep bri
8、关闭odex 编译
build/core/dex_preopt.mk # The default value for LOCAL_DEX_PREOPT ifeq ($(TARGET_BUILD_VARIANT),eng) DEX_PREOPT_DEFAULT ?= false else
DEX_PREOPT_DEFAULT ?= true endif
9、打印函数调用堆栈
// Binder.clearCallingIdentity(); Slog.d(TAG, "_callingPid=" + Binder.getCallingPid() + ", " + "callingUid=" + Binder.getCallingUid()); //Binder.getCallingPid(); // Binder.getCallingUid(); // Binder.clearCallingIdentity(); // Binder.restoreCallingIdentity(); Throwable throwable = new Throwable(); StackTraceElement[] stackElements = throwable.getStackTrace(); if (null != stackElements) { for (int i = 0; i < stackElements.length; i++) { String szMethodName = stackElements[i].getMethodName(); Slog.d(TAG, "dual parsePackageSplitNames: szMethodName = " + szMethodName); }
}
Slog.wtf(TAG, "showBouncer ", new Throwable());
Slog.d(TAG,"passwordToHash = " + password + ", caller = " + Debug.getCallers(9));
10、查看event 事件
getevent -l /dev/input/event4
11、列出系统有图标应用
cmd package query-activities -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x00000010
12、截屏
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png
13、Ext4 文件挂载
simg2img $1 $1.ext4
mkdir tmp
sudo mount -t ext4 -o loop $1.ext4 tmp
mount –o remount,rw custpack
14、
adb shell
while true;do date >> /sdcard/mtklog/dumpsys_meminfo.txt;dumpsys meminfo >> /sdcard/mtklog/dumpsys_meminfo.txt;sleep 5;done
14、设置屏幕背光不熄灭的方法
https://blog.csdn.net/lebron_wei/article/details/50523147
15、根据pid 获取进程名
再ams 中增加binder 接口再调用
public String[] getPackagesFromPid(int pid) { ProcessRecord pr = null; synchronized (mPidsSelfLocked) { pr = mPidsSelfLocked.get(pid); } return (pr != null) ? pr.getPackageList() : null; }
14、
netstat -ano | findstr 5037 tasklist | findstr 6560
taskkill /f /t /im process_name taskkill /f /pid 2612
setprop service.adb.tcp.port 5555
adb nodaemon server ####查看5037 是否被占用
15、
打开测试机状态栏上秒的功能
adb shell pm enable com.android.systemui/com.android.systemui.tuner.TunerActivity
adb shell am start -n com.android.systemui/com.android.systemui.tuner.TunerActivity
16、手机解锁:
adb reboot bootloader fastboot flashing unlock fastboot reboot adb root adb disable-verity adb reboot adb root adb remount
13、android 网址
https://developer.android.google.cn -----各个android 版本介绍
https://source.android.google.cn/
https://source.android.com ------源码
14、
google 提交case 查看:
http://code.google.com/p/android/issues/list
google patch 提交查看
https://android-review.googlesource.com