MonkeyRunner (三)

本文介绍了如何使用monkeyrunner命令来运行Python脚本或启动交互式会话进行monkeyrunner语句操作。通过指定文件名作为参数,可以将文件内容视为Python程序执行;若未提供文件名,则会打开一个交互式环境。命令语法包括插件jar文件、程序文件名和程序选项。此外,可以通过运行特定命令生成API参考。

Running monkeyrunner


You can either run monkeyrunner programs from a file, or enter monkeyrunner statements in an interactive session. You do both by invoking the monkeyrunner command which is found in the tools/ subdirectory of your SDK directory. If you provide a filename as an argument, the monkeyrunner command runs the file's contents as a Python program; otherwise, it starts an interactive session.

你能用一个代码文件运行monkeyrunner,也能在交互进程中输入monkeyrunner语句运行monkeyrunner.不论使用哪种方式,您都需要调用SDK目录的tools子目录下的monkeyrunner命令。如果你提供了一个文件名作为运行参数,monkeyrunner 将这个文件内容作为python程序并运行,否则它将提供一个交互对话环境.

The syntax of the monkeyrunner command is

monkeyrunner命令语法为:

monkeyrunner -plugin <plugin_jar> <program_filename> <program_options>

  

Table 1 explains the flags and arguments.

表1解释了标志和参数.

Table 1. monkeyrunner flags and arguments.

ArgumentDescription
-plugin <plugin_jar>(Optional) Specifies a .jar file containing a plugin for monkeyrunner. To learn more about monkeyrunner plugins, see Extending monkeyrunner with plugins. To specify more than one file, include the argument multiple times.
<program_filename>If you provide this argument, the monkeyrunner command runs the contents of the file as a Python program. If the argument is not provided, the command starts an interactive session.
<program_options>(Optional) Flags and arguments for the program in <program_file>.
ArgumentDescription
-plugin <plugin_jar>

(可选的)指定一个包含monkeyrunner插件的.jar文件.想了解更多的monkeyrunner插件,看使用插件扩展monkeyrunner.要指定更多的文件,要包含参数很多次.

<program_filename>如果你提供这个参数,monkeyrunner会把文件作为python程序运行.如果参数为提供,命令将开启交互进程
<program_options>(可选的)<程序文件>所需的标志和参数

monkeyrunner Built-in Help


You can generate an API reference for monkeyrunner by running:

你能通过monkeyrunner运行下列语句生成一个API的参考:

monkeyrunner help.py <format><outfile>

The arguments are:

参数是:

  • <format> is either text for plain text output or html for HTML output.
  • <outfile> is a path-qualified name for the output file.

  <format> 可选text或是html, 输出text或是HTML文件.

  <outfile> 是指定输出路径名.

 

转载于:https://www.cnblogs.com/hanxiaocai/p/3746347.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值