赞
踩
此电脑(右击)→ 属性 → 高级系统设置 → 高级 → 环境变量 → 系统变量 → Path(双击)
→新建添加 adb.exe路径
adb shell pm list packages 列出手机装的所有app的包名
- 查看磁盘内存和运行内存:adb shell free
- 查看内存详细数据adb shell cat /proc/meminfo
- 查看某一个app的内存占用:adb shell dumpsys meminfo <package_name|PID>
- 查看单个进程可用的最大内存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:
<serial> " " <local> " " <remote> "\n"
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
- same as 'adb forward <local> <remote>' but fails
if <local> is already forwarded
reverse specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
- same as 'adb reverse <remote> <local>' but fails
if <remote> is already reversed.
- 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 <path> is a file, the bug report will be saved as that file.
If <path> is a directory, the bug report will be saved in that directory with the name provided by th
e device.
If <path> is omitted, the bug report will be saved in the current directory with the name provided by
the device.
NOTE: if the device does not support zipped bug reports, the bug report will be output on stdout.
adb backup [-f <file>] [-apk|-noapk] [-obb|-noobb] [-shared|-noshared] [-all] [-system|-nosystem] [<packages...>]
- write an archive of the device's data to <file>.
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)
(<packages...> is the list of applications to be backed up. If
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 <file>.pub. Any existing files
are overwritten.
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。