Android常用命令

setprop ctl.start lcdparamservice
setprop ctl.stop lcdparamservice

getprop |grep cam.hal3.ver

adb shell pkill camera && adb shell pkilll provider
adb logcat|grep "E RkCamera"
adb shell setprop persist.vendor.camera.hal.debug 5


wm density  //查看屏幕密度
wm density 240  //设置屏幕密度
wm size  //查看屏幕分辨率
wm size 1920x1080  //设置屏幕分辨率
wm size reset
wm density reset

获取系统所有支持的features
adb shell pm list features
查询系统所有package
pm list packages

禁用(diable)或启用(enable)package
pm enable com.android.provision


settings list NAMESPACE(system,secure,global)

getevent
power按键
adb shell input keyevent 26
home按键
adb shell input keyevent 3
返回键
input keyevent 4 

public static final int KEYCODE_HOME = 3;
public static final int KEYCODE_BACK = 4;
public static final int KEYCODE_CALL = 5;
public static final int KEYCODE_VOLUME_UP = 24;
public static final int KEYCODE_VOLUME_DOWN = 25;
public static final int KEYCODE_POWER = 26;
public static final int KEYCODE_CAMERA = 27;
public static final int KEYCODE_MENU = 82;
public static final int KEYCODE_APP_SWITCH = 187;


查看上次anr信息
adb shell dumpsys activity lastanr
查看上次anr traces信息
adb shell dumpsys activity lastanr-traces

抓取native进程traces
adb shell debuggerd -b pid

放开权限校验
adb shell setenforce 0
恢复权限校验
adb shell setenforce 1
编译该模块
make selinux_policy -j4

查看apk签名指纹信息
解压apk后获得META-INF/CERT.RSA文件
在linux环境下使用keytool工具查看apk的签名指纹信息
keytool -printcert -file test/CERT.RSA
或者通过签名证书文件获取
keytool -list -v -keystore $keystore_file [-storepass password]

dos2unix

$adb shell dmesg | grep avc > avc_log.txt
$audit2allow -i avc_log.txt -p out/target/product/xxxvendor/etc/selinux/precompiled_sepolicy

WITH_DEXPREOPT := false


ps -T -p pid
getconf LONG_BIT
cat /proc/4044/maps    #查看4044进程的内存映射表
adb shell dumpsys meminfo packagename

你可能感兴趣的:(android技术,android)