你好,游客 登录 注册 搜索
背景:
阅读新闻

Android 基本文件操作命令

[日期:2012-07-11] 来源:Linux社区  作者:Linux [字体:大 中 小]

pm

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

linux
相关资讯       Android命令 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款