A monkeyrunner class that contains static utility methods.
Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
Displays an alert dialog to the process running the current
program.
|
||||||||||
|
Displays a dialog with a list of choices to the process running the current program.
|
||||||||||
|
Displays the monkeyrunner API reference in a style similar to that of Python's
pydoc tool, using the specified format.
|
||||||||||
|
Displays a dialog that accepts input.
|
||||||||||
|
Pauses the current program for the specified number of seconds.
|
||||||||||
MonkeyDevice
|
Tries to make a connection between the
monkeyrunner backend and the
specified device or emulator.
|
Displays an alert dialog to the process running the current program. The dialog is modal, so the program pauses until the user clicks the dialog's button.
message | The message to display in the dialog. |
---|---|
title | The dialog's title. The default value is "Alert". |
okTitle | The text displayed in the dialog button. The default value is "OK". |
Displays a dialog with a list of choices to the process running the current program. The dialog is modal, so the program pauses until the user clicks one of the dialog's buttons.
message | The prompt message displayed in the dialog. |
---|---|
choices | A Python iterable containing one or more objects that are displayed as strings. The recommended form is an array of strings. |
title | The dialog's title. The default is "Input". |
Displays the monkeyrunner API reference in a style similar to that of Python's
pydoc
tool, using the specified format.
format | The markup format to use in the output. The possible values are "text" for plain text or "html" for HTML. |
---|
Displays a dialog that accepts input and returns it to the program. The dialog is modal, so the program pauses until the user clicks one of the dialog's buttons.
The dialog contains two buttons, one of which displays the okTitle value and the other the cancelTitle value. If the user clicks the okTitle button, the current value of the input box is returned. If the user clicks the cancelTitle button, an empty string is returned.
message | The prompt message displayed in the dialog. |
---|---|
initialValue | The initial value to display in the dialog. The default is an empty string. |
title | The dialog's title. The default is "Input". |
okTitle | The text displayed in the okTitle button. The default is "OK". |
cancelTitle | The text displayed in the cancelTitle button. The default is "Cancel". |
Pauses the current program for the specified number of seconds.
seconds | The number of seconds to pause. |
---|
MonkeyDevice
waitForConnection
(float timeout,
string deviceId)
Tries to make a connection between the monkeyrunner
backend and the
specified device or emulator.
timeout | The number of seconds to wait for a connection. The default is to wait forever. |
---|---|
deviceId | A regular expression that specifies the serial number of the device or emulator. See the topic Android Debug Bridge for a description of device and emulator serial numbers. |
MonkeyDevice
instance for the device or emulator. Use this object to control and communicate with the
device or emulator.