此电脑(右击)→ 属性 → 高级系统设置 → 高级 → 环境变量 → 系统变量 → Path(双击)
→新建添加 adb.exe路径
adb shell pm list packages 列出手机装的所有app的包名
查看磁盘内存和运行内存:adb shell free
查看内存详细数据adb shell cat /proc/meminfo
查看某一个app的内存占用:adb shell dumpsys meminfo
查看单个进程可用的最大内存adb shell getprop dalvik.vm.heapsize //表示不受控情况下的极限堆
查看单个应用程序的最大内存限制:adb shell getprop dalvik.vm.heapgrowthlimit
得到的结果为128M,就是说Dalvik Heap size的最大值超过了128M,就很可能发生OOM
查看设备上进程的cpu和内存占用情况adb shell top
adb shell top >C:\log\sb01.log(将日志输出到本地)
运行远程shell命令 (如果没有给出命令,则使用交互式shell)
(-e: choose escape character, or "none"; default '~')
(-n: don't read from stdin)
(-T: disable PTY allocation)
(-t: force PTY allocation)
(-x: disable remote exit codes and stdout/stderr separation)
the format is a list of lines with the following format:
forward specs are one of:
tcp:
localabstract:
localreserved:
localfilesystem:
dev:
jdwp:
- same as 'adb forward
if
reverse specs are one of:
tcp:
localabstract:
localreserved:
localfilesystem:
- same as 'adb reverse
if
- remove a specific reversed socket connection
把安装包发送到设备并安装
(-l: “L”意味着锁的应用程序)
(-r: “R”意味着重新安装应用程序,保持其数据)
(-t: allow test packages)
(-s: “S”是指安装在SD卡代替内部存储)
(-d: allow version code downgrade (debuggable packages only))
(-g: grant all runtime permissions)
- push this package file to the device and install it
(-l: forward lock application)
(-r: replace existing application)
(-t: allow test packages)
(-s: install application on sdcard)
(-d: allow version code downgrade (debuggable packages only))
(-p: partial application install)
(-g: grant all runtime permissions)
(“K”意味着保持数据和缓存目录)
If
If
e device.
If
the device.
NOTE: if the device does not support zipped bug reports, the bug report will be output on stdout.
adb backup [-f
- write an archive of the device's data to
If no -f option is supplied then the data is written
to "backup.ab" in the current directory.
(-apk|-noapk enable/disable backup of the .apks themselves
in the archive; the default is noapk.)
(-obb|-noobb enable/disable backup of any installed apk expansion
(aka .obb) files associated with each application; the default
is noobb.)
(-shared|-noshared enable/disable backup of the device's
shared storage / SD card contents; the default is noshared.)
(-all means to back up all installed applications)
(-system|-nosystem toggles whether -all automatically includes
system applications; the default is to include system apps)
(
the -all or -shared flags are passed, then the package
list is optional. Applications explicitly given on the
command line will be included even if -nosystem would
ordinarily cause them to be omitted.)
and the public key is stored in
are overwritten.