Provides access to state information about the device. You can also use this class to simulate user actions on the device, such as pressing the d-pad or pressing the Home and Menu buttons.
Summary
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
Clears the text from the last UI traversal event.
|
||||||||||
|
Perform a click at arbitrary coordinates specified by the user
|
||||||||||
|
Performs a swipe from one coordinate to another coordinate.
|
||||||||||
|
Helper method used for debugging to dump the current window's layout hierarchy.
|
||||||||||
|
Disables the sensors and freezes the device rotation at its
current rotation state.
|
||||||||||
|
This method is deprecated.
The results returned should be considered unreliable
|
||||||||||
|
Retrieves the name of the last package to report accessibility events.
|
||||||||||
|
Gets the height of the display, in pixels.
|
||||||||||
|
Returns the current rotation of the display, as defined in
Surface
|
||||||||||
|
Returns the display size in dp (device-independent pixel)
The returned display size is adjusted per screen rotation.
|
||||||||||
|
Gets the width of the display, in pixels.
|
||||||||||
|
Retrieves a singleton instance of UiDevice
|
||||||||||
|
Retrieves the text from the last UI traversal event received.
|
||||||||||
|
Retrieves the product name of the device.
|
||||||||||
|
Checks if any registered
UiWatcher
have triggered.
|
||||||||||
|
Checks if a specific registered
UiWatcher
has triggered.
|
||||||||||
|
Check if the device is in its natural orientation.
|
||||||||||
|
Checks the power manager if the screen is ON.
|
||||||||||
|
Opens the notification shade.
|
||||||||||
|
Opens the Quick Settings shade.
|
||||||||||
|
Simulates a short press on the BACK button.
|
||||||||||
|
Simulates a short press on the CENTER button.
|
||||||||||
|
Simulates a short press on the DOWN button.
|
||||||||||
|
Simulates a short press on the LEFT button.
|
||||||||||
|
Simulates a short press on the RIGHT button.
|
||||||||||
|
Simulates a short press on the UP button.
|
||||||||||
|
Simulates a short press on the DELETE key.
|
||||||||||
|
Simulates a short press on the ENTER key.
|
||||||||||
|
Simulates a short press on the HOME button.
|
||||||||||
|
Simulates a short press using a key code.
|
||||||||||
|
Simulates a short press using a key code.
|
||||||||||
|
Simulates a short press on the MENU button.
|
||||||||||
|
Simulates a short press on the Recent Apps button.
|
||||||||||
|
Simulates a short press on the SEARCH button.
|
||||||||||
|
Registers a
UiWatcher
to run automatically when the testing framework is unable to
find a match using a
UiSelector
.
|
||||||||||
|
Removes a previously registered
UiWatcher
.
|
||||||||||
|
Resets a
UiWatcher
that has been triggered.
|
||||||||||
|
This method forces all registered watchers to run.
|
||||||||||
|
Enables or disables layout hierarchy compression.
|
||||||||||
|
Simulates orienting the device to the left and also freezes rotation
by disabling the sensors.
|
||||||||||
|
Simulates orienting the device into its natural orientation and also freezes rotation
by disabling the sensors.
|
||||||||||
|
Simulates orienting the device to the right and also freezes rotation
by disabling the sensors.
|
||||||||||
|
This method simply presses the power button if the screen is ON else
it does nothing if the screen is already OFF.
|
||||||||||
|
Performs a swipe between points in the Point array.
|
||||||||||
|
Performs a swipe from one coordinate to another using the number of steps
to determine smoothness and speed.
|
||||||||||
|
Take a screenshot of current window and store it as PNG
Default scale of 1.0f (original size) and 90% quality is used
The screenshot is adjusted per screen rotation
|
||||||||||
|
Take a screenshot of current window and store it as PNG
The screenshot is adjusted per screen rotation
|
||||||||||
|
Re-enables the sensors and un-freezes the device rotation allowing its contents
to rotate with the device physical rotation.
|
||||||||||
|
Waits for the current application to idle.
|
||||||||||
|
Waits for the current application to idle.
|
||||||||||
|
Waits for a window content update event to occur.
|
||||||||||
|
This method simulates pressing the power button if the screen is OFF else
it does nothing if the screen is already ON.
|
[Expand]
Inherited Methods
|
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|