赞
踩
1、启动MTKLogger主界面:
adb shell am start -n com.mediatek.mtklogger/com.mediatek.mtklogger.MainActivity
2、输入ADB命令进入工程模式 的方法:
adb shell am start com.mediatek.engineermode/com.mediatek.engineermode.EngineerMode
3、启动MT8788的工厂测试apk:
adb shell am start com.zelustek.factorytest/com.zelustek.factorytest.MainActivity
4、截屏命令:
adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png
5、录制屏幕操作视频命令:
adb shell screenrecord --time-limit 60 /sdcard/demo.mp4
adb pull /sdcard/demo.mp4
6、启动触摸屏触点调试应用com.onesimplefocus.touchscreentester.apk的命令:
adb shell am start -n com.onesimplefocus.touchscreentester/com.onesimplefocus.touchscreentester.OneSimpleMainActivity
7、启动录音apk
adb shell am start com.android.soundrecorder/com.android.soundrecorder.SoundRecorder
8、启动系统拨号应用(打电话界面)
adb shell am start com.android.dialer/com.android.dialer.DialtactsActivity
9、启动系统设置
adb shell am start com.android.settings/com.android.settings.Settings
10、开关飞行模式
//开启飞行模式
adb shell settings put global airplane_mode_on 1
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true
//关闭飞行模式
adb shell settings put global airplane_mode_on 0
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false
11、这条命令相当于按了设备的Backkey键
adb shell input keyevent 4
12、查看显示屏分辨率和density参数值
adb shell wm density
adb shell wm size
13、设置显示屏分辨率和density值
adb shell wm size 1024x600
adb shell wm density 240
14、网络adb调试方法
先用usb连接adb服务,输入命令
adb tcpip 5555
cmd就会显示
restarting in TCP mode port: 5555
这样,adbd服务就会进入TCP模式,端口5555。
电脑端使用下面的命令连接设备adb服务
adb connect [ANDROID-IP-ADDR]:5555
例子:adb connect 192.168.0.164:5555
断开连接命令为
adb disconnect [ANDROID-IP-ADDR]:5555
例子:adb disconnect 192.168.0.164:5555
15、强制安装APK的命令:
adb install -t app-debug.apk
16、adb提取异常重启分析需要的log:
针对MT8735项目异常重启的DB file系统log存放路径:
/data/vendor/mtklog/aee_exp
例如:
adb pull /data/vendor/mtklog/aee_exp .\aee_exp-0921
17、临时关闭printk
adb shell
# echo 0 > /proc/sys/kernel/printk
18、查看显示相关的数据
adb shell dumpsys SurfaceFlinger
19、查看内存使用情况:
adb shell dumpsys meminfo
20、monkey测试命令:
测试应用的命令举例:
adb shell monkey -p com.my.testapp --ignore-crashes --ignore-timeouts -v -s 500 500000000 > /sdcard/monkeytest/monkey_calendar_log.txt 2>&1 &
21、卡顿或卡死机器需要抓取的log:
adb shell "ps | grep ' Z '" > 20211231/ps_Z.txt
adb shell "ps | grep ' t '" > 20211231/ps_T1.txt
adb shell "ps -t | grep ' D '" > 20211231/ps_t_D.txt
adb shell logcat -v threadtime -d *:v > 20211231/logcat.txt
adb shell logcat -b events -v threadtime -d *:v > 20211231/logcat_events.txt
adb shell dmesg > 20211231/dmesg.txt
adb pull /data/anr ./20211231/anr
adb pull /data/tombstones ./20211231/tombstones
adb pull /data/system/dropbox ./20211231/dropbox
adb shell "ls -lsa /data/anr/" > ./20211231/ll.txt
adb shell "ls -lsa /data/tombstones/" >> ./20211231/ll.txt
adb shell "ls -lsa /data/system/dropbox/" >> ./20211231/ll.txt
adb pull /data/anr ./20211231/anr2
adb shell "echo t > /proc/sysrq-trigger"
adb shell "cat /proc/kmsg" > ./20211231/kmsg_trigger.txt
adb shell dumpstate > ./20211231/dumpstate.txt
adb shell dumpsys > ./20211231/dumpsys.txt
adb pull /system/build.prop ./20211231/build.prop
adb bugreport > ./20211231/bugreport.txt
adb shell dumpsys meminfo > ./20211231/dumpsys_meminfo.txt
adb shell cat proc/meminfo > .\20211231\meminfo.txt
adb pull /data/aee_exp .\20211231\data_aee_exp
adb pull /sdcard/mtklog/aee_exp .\20211231\sdcard_aee_exp
adb pull /data/vendor/mtklog/aee_exp .\20211231\vendor_aee_exp
adb shell procrank > .\20211231\procrank.txt
adb shell dumpsys window > .\20211231\dump_window.txt
adb shell
$ getprop
需要手动停止:
adb shell top -m 10 > .\20211231\top.txt
22、禁用自动旋转
adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0
23、旋转屏幕
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1
i后面跟的不同的值代表旋转为不同的方向,取值范围为0,1,2,3
24、获取当前运行apk的包名(获取当前apk包名)
adb shell dumpsys activity | grep mResumedActivity
25、adb设置串口波特率并接收串口数据
adb shell
microcom -s 38400 /dev/ttyS0
aiv8195p1_64_bsp_k805:/ # microcom --help
microcom --help
usage: microcom [-s SPEED] [-X] DEVICE
Simple serial console.
-s Set baud rate to SPEED
-X Ignore ^@ (send break) and ^] (exit)
26、adb连接遇到多台设备的问题:
C:\Users\Administrator>adb shell
adb.exe: more than one device/emulator
查看当前连接的设备信息:
C:\Users\Administrator>adb devices
List of devices attached
192.168.1.185:5555 device
1234567890ABCDEF device
adb指定连接目标设备:
adb -s 192.168.0.185 shell
或者
adb -s 1234567890ABCDEF shell
以此类推,比如:adb -s 1234567890ABCDEF push; adb -s 1234567890ABCDEF pull 等。
27、查看MTK主控CPU温度:
adb shell
cat /sys/class/thermal/thermal_zone1/temp
循环查看温度指令:
adb shell
while(true);do cat /sys/class/thermal/thermal_zone0/temp;sleep 1;done
将自己的工作总结记录并分享出来,也更好的激励自己前进!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。