adb shell uiautomator 命令

adb shell uiautomator 命令

Tags: adb_shell


常用到的命令:

uiautomator dump dump出当前窗口的UI布局信息
uiautomator dump --compressed dump出当前窗口的UI布局简化信息
uiautomator dump file 指定输出文件,默认文件是在/sdcard/window_dump.xml

输出的文件可以用 sdk/tools/uiautomatorviewer.bat 工具打开查看布局

htc_himaulatt:/ $ uiautomator
Usage: uiautomator <subcommand> [options]

Available subcommands:

help: displays help message

runtest: executes UI automation tests
    runtest <class spec> [options]
    <class spec>: <JARS> < -c <CLASSES> | -e class <CLASSES> >
      <JARS>: a list of jar files containing test classes and dependencies. If
        the path is relative, it's assumed to be under /data/local/tmp. Use
        absolute path if the file is elsewhere. Multiple files can be
        specified, separated by space.
      <CLASSES>: a list of test class names to run, separated by comma. To
        a single method, use TestClass#testMethod format. The -e or -c option
        may be repeated. This option is not required and if not provided then
        all the tests in provided jars will be run automatically.
    options:
      --nohup: trap SIG_HUP, so test won't terminate even if parent process
               is terminated, e.g. USB is disconnected.
      -e debug [true|false]: wait for debugger to connect before starting.
      -e runner [CLASS]: use specified test runner class instead. If
        unspecified, framework default runner will be used.
      -e <NAME> <VALUE>: other name-value pairs to be passed to test classes.
        May be repeated.
      -e outputFormat simple | -s: enabled less verbose JUnit style output.

dump: creates an XML dump of current UI hierarchy
    dump [--verbose][file]
      [--compressed]: dumps compressed layout information.
      [file]: the location where the dumped XML should be stored, default is
      /sdcard/window_dump.xml

events: prints out accessibility events until terminated
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 最近看到一些关于adb的相关知识,总结一下,这些常用的命令以后可以直接拿来用~ adb其实就是Android De...
    Mr_冯先生阅读 9,708评论 0 10
  • 获取编译时间cat /proc/version 内核崩溃cat /proc/last_kmsg 获取硬件信息adb...
    慢牛策略阅读 13,051评论 0 14
  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 175,777评论 25 709
  • 手动添加,还有我西。 群里的各位小伙伴。 唉!又长一岁了,有时候希望快快长大,有时候又不想长大,迷迷糊糊中,我就快...
    宁羽阅读 1,105评论 0 0
  • 我们在平时生活中,体会到我们付出时,就会觉得有权利;我们接受时,就会感到有义务。当我们接受后,回赠多些时,就会轻松...
    F公子阅读 4,298评论 0 0