Android 基本文件操作命令(4)

usage: pm [list|path|install|uninstall]

pm list packages [-f]

pm list permission-groups

pm list permissions [-g][-f] [-d] [-u] [GROUP]

pm list instrumentation [-f][TARGET-PACKAGE]

pm list features

pm path PACKAGE

pm install [-l] [-r] [-t][-i INSTALLER_PACKAGE_NAME] PATH

pm uninstall [-k] PACKAGE

pm enable PACKAGE_OR_COMPONENT

pm disablePACKAGE_OR_COMPONENT

The list packages command prints all packages.  Options:

-f: see their associated file.

The list permission-groups command prints all known

permission groups.

The list permissions command prints all known

permissions, optionally only those in GROUP.  Options:

-g: organize by group.

-f: print all information.

-s: short summary.

-d: only list dangerouspermissions.

-u: list only the permissionSUSErs will see.

The list instrumentation command prints all instrumentations,

or only those that target a specified package.  Options:

-f: see their associated file.

The list features command prints all features of the system.

The path command prints the path to the .apk of a package.

The install command installs a package to the system.  Options:

-l: install the package withFORWARD_LOCK.

-r: reinstall an exisiting app,keeping its data.

-t: allow test .apks to beinstalled.

-i: specify the installer packagename.

The uninstall command removes a package from the system. Options:

-k: keep the data and cachedirectories around.

after the package removal.

The enable and disable commands change the enabled state of

a given package or component (written as "package/class").

查看stdout 和stderr

在默认状态下,Android系统有stdout 和 stderr (System.out和System.err )输出到/dev/null ,

在运行Dalvik VM的进程中,有一个系统可以备份日志文件。在这种情况下,系统会用stdout 和stderr 和优先级 I.来记录日志信息

通过这种方法指定输出的路径,停止运行的模拟器/设备,然后通过用setprop 命令远程输入日志

$ adb shell stop

$ adb shell setprop log.redirect-stdio true

$ adb shell start系统直到你关闭模拟器/设备前设置会一直保留,可以通过添加/data/local.prop 可以使用模拟器/设备上的默认设置

UI/软件 试验程序 Monkey

当Monkey程序在模拟器或设备运行的时候,如果用户出发了比如点击,触摸,手势或一些系统级别的事件的时候,

它就会产生随机脉冲,所以可以用Monkey用随机重复的方法去负荷测试你开发的软件.

最简单的方法就是用用下面的命令来使用Monkey,这个命令将会启动你的软件并且触发500个事件.

$ adb shell monkey -v -p your.package.name 500

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/pxjdz.html