1、查看APP占用内存情况
adb shell dumpsys meminfo <package name>
2、Android机器重启
adb reboot
3、启动activity
adb shell am start -n 包名/包名+类名
4、查看log信息
adb logcat -s 标签名
5、返回到home菜单
adb shell input keyevent 3
6、返回键
adb shell input keyevent 4
7、卸载应用程序
adb uninstall <包名>
8、安装应用程序
adb install <应用程序>
9、logcat日志查看
adb logcat -s <日志主要信息>
10、查看应用占用率
top -m(数量) 10 -t(线程) -d(更新时间间隔)
11、获取机器MAC地址
adb shell cat /sys/class/net/wlan0/address
12、获取CPU序列号
adb shell cat /proc/cpuinfo
13、查看Java代码的汇编代码
javap -c -l demo.class
14、清理logcat日志在查看相关日志
adb shell logcat -c
logcat -v time | grep "要查看的日志信息"
15、查看任务栈信息
adb shell dumpsys activity
16、转换.hprof文件
hprof-conv [-z] <infile> <outfile>
17、查看OpenSSL版本号
unzip -p xxx.apk | strings | grep "OpenSSL"
18、查看一个包名中存在的进程信息
adb shell ps | grep <包名>
进入idle模式:
adb shell dumpsys battery unplug
adb shell dumpsys deviceidle step
进入app standby模式:
adb shell dumpsys battery unplug
adb shell am set-inactive com.mico true
Sqlite数据库操作
adb shell
打开数据库:
sqlite3 <数据库名>
显示当前数据库有哪些表:
.table
查看表结构:
pragma table_info(表名);
切换显示模式
.mode line
查询数据
select * from 表名
查询当前数据库中的所有表的建表语句
select * from sqlite_master where name="表名";