diff options
Diffstat (limited to 'docs/html/tools/help')
| -rw-r--r-- | docs/html/tools/help/adb.jd | 1091 | ||||
| -rw-r--r-- | docs/html/tools/help/android.jd | 32 | ||||
| -rw-r--r-- | docs/html/tools/help/jobb.jd | 2 | ||||
| -rw-r--r-- | docs/html/tools/help/proguard.jd | 2 | ||||
| -rw-r--r-- | docs/html/tools/help/sdk-manager.jd | 2 | ||||
| -rw-r--r-- | docs/html/tools/help/uiautomator/IAutomationSupport.jd | 168 | ||||
| -rw-r--r-- | docs/html/tools/help/uiautomator/UiAutomatorTestCase.jd | 1402 | ||||
| -rw-r--r-- | docs/html/tools/help/uiautomator/UiCollection.jd | 1271 | ||||
| -rw-r--r-- | docs/html/tools/help/uiautomator/UiDevice.jd | 3073 | ||||
| -rw-r--r-- | docs/html/tools/help/uiautomator/UiObject.jd | 2687 | ||||
| -rw-r--r-- | docs/html/tools/help/uiautomator/UiObjectNotFoundException.jd | 630 | ||||
| -rw-r--r-- | docs/html/tools/help/uiautomator/UiScrollable.jd | 2914 | ||||
| -rw-r--r-- | docs/html/tools/help/uiautomator/UiSelector.jd | 2088 | ||||
| -rw-r--r-- | docs/html/tools/help/uiautomator/UiWatcher.jd | 78 | ||||
| -rw-r--r-- | docs/html/tools/help/uiautomator/index.jd | 172 |
15 files changed, 15430 insertions, 182 deletions
diff --git a/docs/html/tools/help/adb.jd b/docs/html/tools/help/adb.jd index d44d54b..c8afca5 100644 --- a/docs/html/tools/help/adb.jd +++ b/docs/html/tools/help/adb.jd @@ -5,32 +5,27 @@ parent.link=index.html <div id="qv-wrapper"> <div id="qv"> - <h2>ADB quickview</h2> - <ul> -<li>Manage the state of an emulator or device</li> -<li>Run shell commands on a device</li> -<li>Manage port forwarding on an emulator or device</li> -<li>Copy files to/from an emulator or device</li> - </ul> - <h2>In this document</h2> - <ol> -<li><a href="#issuingcommands">Issuing ADB Commands</a></li> -<li><a href="#devicestatus">Querying for Emulator/Device Instances</a></li> -<li><a href="#directingcommands">Directing Commands to a Specific Emulator/Device Instance</a></li> -<li><a href="#move">Installing an Application</a></li> -<li><a href="#forwardports">Forwarding Ports</a></li> -<li><a href="#copyfiles">Copying Files to or from an Emulator/Device Instance</a></li> -<li><a href="#commandsummary">Listing of adb Commands </a></li> -<li><a href="#shellcommands">Issuing Shell Commands</a></li> -<li><a href="#logcat">Enabling Logcat Logging</a></li> -<li><a href="#stopping">Stopping the adb Server</a></li> - </ol> - - <h2>See also</h2> - <ol> - <li><a href="emulator.html">Emulator</a></li> - </ol> +<ol> + <li><a href="#issuingcommands">Syntax</a></li> + <li><a href="#commandsummary">Commands</a></li> + <li><a href="#devicestatus">Querying for Emulator/Device Instances</a></li> + <li><a href="#directingcommands">Directing Commands to a Specific Emulator/Device Instance</a></li> + <li><a href="#move">Installing an Application</a></li> + <li><a href="#forwardports">Forwarding Ports</a></li> + <li><a href="#copyfiles">Copying Files to or from an Emulator/Device Instance</a></li> + <li><a href="#shellcommands">Issuing Shell Commands</a> + <ol> + <li><a href="#am">Using activity manager (am)</a></li> + <li><a href="#pm">Using package manager (pm)</a></li> + <li><a href="#sqlite">Examining sqlite3 databases from a remote shell</a></li> + <li><a href="#monkey">UI/Application Exerciser Monkey</a></li> + <li><a href="#othershellcommands">Other shell commands</a></li> + </ol> + </li> + <li><a href="#logcat">Enabling logcat logging</a></li> + <li><a href="#stopping">Stopping the adb server</a></li> +</ol> </div> </div> @@ -40,14 +35,20 @@ emulator instance or connected Android-powered device. It is a client-server pro three components: </p> <ul> - <li>A client, which runs on your development machine. You can invoke a client from a shell by issuing an adb command. Other Android tools such as the ADT plugin and DDMS also create adb clients. </li> - <li>A server, which runs as a background process on your development machine. The server manages communication between the client and the adb daemon running on an emulator or device. </li> + <li>A client, which runs on your development machine. You can invoke a client from a shell +by issuing an adb command. Other Android tools such as the ADT plugin and DDMS also create +adb clients. </li> + <li>A server, which runs as a background process on your development machine. The server +manages communication between the client and the adb daemon running on an emulator or device. </li> <li>A daemon, which runs as a background process on each emulator or device instance. </li> </ul> <p>You can find the {@code adb} tool in {@code <sdk>/platform-tools/}.</p> -<p>When you start an adb client, the client first checks whether there is an adb server process already running. If there isn't, it starts the server process. When the server starts, it binds to local TCP port 5037 and listens for commands sent from adb clients—all adb clients use port 5037 to communicate with the adb server. </p> +<p>When you start an adb client, the client first checks whether there is an adb server +process already running. If there isn't, it starts the server process. When the server starts, +it binds to local TCP port 5037 and listens for commands sent from adb clients—all adb +clients use port 5037 to communicate with the adb server. </p> <p>The server then sets up connections to all running emulator/device instances. It locates emulator/device instances by scanning odd-numbered ports in the range 5555 to 5585, the range used by emulators/devices. Where the server finds an adb daemon, it sets up a connection to that port. Note that each emulator/device instance acquires a pair of sequential ports — an even-numbered port for console connections and an odd-numbered port for adb connections. For example: </p> @@ -55,127 +56,49 @@ three components: </p> Emulator 1, console: 5554<br/> Emulator 1, adb: 5555<br> Emulator 2, console: 5556<br> -Emulator 2, adb: 5557 ... +Emulator 2, adb: 5557<br> +and so on... </p> -<p>As shown, the emulator instance connected to adb on port 5555 is the same as the instance whose console listens on port 5554. </p> - -<p>Once the server has set up connections to all emulator instances, you can use adb commands to control and access those instances. Because the server manages connections to emulator/device instances and handles commands from multiple adb clients, you can control any emulator/device instance from any client (or from a script).</p> +<p>As shown, the emulator instance connected to adb on port 5555 is the same as the instance +whose console listens on port 5554. </p> -<p>The sections below describe the commands that you can use to access adb capabilities and manage the state of an emulator/device. Note that if you are developing Android applications in Eclipse and have installed the ADT plugin, you do not need to access adb from the command line. The ADT plugin provides a transparent integration of adb into the Eclipse IDE. However, you can still use adb directly as necessary, such as for debugging.</p> +<p>Once the server has set up connections to all emulator instances, you can use adb commands to +access those instances. Because the server manages connections to emulator/device +instances and handles commands from multiple adb clients, you can control any emulator/device +instance from any client (or from a script).</p> -<a name="issuingcommands"></a> -<h2>Issuing adb Commands</h2> +<p class="note"><strong>Note:</strong> When you connect a device running Android 4.2.2 or higher +to your computer, the system shows a dialog asking whether to accept an RSA key that allows +debugging through this computer. This security mechanism protects user devices because it ensures +that USB debugging and other adb commands cannot be executed unless you're able to unlock the +device and acknowledge the dialog. This requires that you have adb version 1.0.31 (available with +SDK Platform-tools r16.0.1 and higher) in order to debug on a device running Android 4.2.2 or +higher.</p> -<p>You can issue adb commands from a command line on your development machine or from a script. The usage is: </p> - <pre>adb [-d|-e|-s <serialNumber>] <command> </pre> +<h2 id="issuingcommands">Syntax</h2> -<p>When you issue a command, the program invokes an adb client. The client is not specifically associated with any emulator instance, so if multiple emulators/devices are running, you need to use the <code>-d</code> option to specify the target instance to which the command should be directed. For more information about using this option, see <a href="#directingcommands">Directing Commands to a Specific Emulator/Device Instance</a>. </p> +<p>You can issue adb commands from a command line on your development machine or from a script. +The usage is: </p> -<a name="devicestatus"></a> +<pre class="no-pretty-print"> +adb [-d|-e|-s <serialNumber>] <command> +</pre> -<h2>Querying for Emulator/Device Instances</h2> +<p>If there's only one emulator running or only one device connected, the adb command is +sent to that device by default. If multiple emulators are running and/or multiple devices are +attached, you need to use the <code>-d</code>, <code>-e</code>, or <code>-s</code> +option to specify the target device to which the command should be directed. </p> -<p>Before issuing adb commands, it is helpful to know what emulator/device instances are connected to the adb server. You can generate a list of attached emulators/devices using the <code>devices</code> command: </p> - - <pre>adb devices</pre> -<p>In response, adb prints this status information for each instance:</p> -<ul> - <li>Serial number — A string created by adb to uniquely identify an emulator/device instance by its - console port number. The format of the serial number is <code><type>-<consolePort></code>. - Here's an example serial number: <code>emulator-5554</code></li> - <li>State — The connection state of the instance may be one of the following: - <ul> - <li><code>offline</code> — the instance is not connected to adb or is not responding.</li> - <li><code>device</code> — the instance is now connected to the adb server. Note that this state does not - imply that the Android system is fully booted and operational, since the instance connects to adb - while the system is still booting. However, after boot-up, this is the normal operational state of - an emulator/device instance.</li> - <li><code>no device</code> — there is no emulator/device connected. - </ul> - </li> -</ul> - -<p>The output for each instance is formatted like this: </p> - - <pre>[serialNumber] [state]</pre> - -<p>Here's an example showing the <code>devices</code> command and its output:</p> - - <pre>$ adb devices -List of devices attached -emulator-5554 device -emulator-5556 device -emulator-5558 device</pre> - - - -<a name="directingcommands"></a> - -<h2>Directing Commands to a Specific Emulator/Device Instance</h2> - -<p>If multiple emulator/device instances are running, you need to specify a target instance when issuing adb commands. To so so, use the <code>-s</code> option in the commands. The usage for the <code>-s</code> option is:</p> - - <pre>adb -s <serialNumber> <command> </pre> - -<p>As shown, you specify the target instance for a command using its adb-assigned serial number. You can use the <code>devices</code> command to obtain the serial numbers of running emulator/device instances. </p> - -<p>Here is an example: </p> - - <pre>adb -s emulator-5556 install helloWorld.apk</pre> - -<p>Note that, if you issue a command without specifying a target emulator/device instance using <code>-s</code>, adb generates an error. - -<a name="move"></a> - -<h2>Installing an Application</h2> -<p>You can use adb to copy an application from your development computer and install it on an emulator/device instance. To do so, use the <code>install</code> command. With the command, you must specify the path to the .apk file that you want to install:</p> - -<pre>adb install <path_to_apk></pre> - -<p>For more information about how to create an .apk file that you can install on an emulator/device -instance, see <a href="{@docRoot}tools/building/index.html">Building and Running</a></p> - -<p>Note that, if you are using the Eclipse IDE and have the ADT plugin installed, you do not need to use adb (or aapt) directly to install your application on the emulator/device. Instead, the ADT plugin handles the packaging and installation of the application for you. </p> - - -<a name="forwardports"></a> - -<h2>Forwarding Ports</h2> - - <p>You can use the <code>forward</code> command to set up arbitrary port forwarding — forwarding of requests on a specific host port to a different port on an emulator/device instance. Here's how you would set up forwarding of host port 6100 to emulator/device port 7100:</p> -<pre>adb forward tcp:6100 tcp:7100</pre> - <p>You can also use adb to set up forwarding to named abstract UNIX domain sockets, as illustrated here:</p> -<pre>adb forward tcp:6100 local:logd </pre> - -<a name="copyfiles"></a> - -<h2>Copying Files to or from an Emulator/Device Instance</h2> - -<p>You can use the adb commands <code>pull</code> and <code>push</code> to copy files to and from an emulator/device instance's data file. Unlike the <code>install</code> command, which only copies an .apk file to a specific location, the <code>pull</code> and <code>push</code> commands let you copy arbitrary directories and files to any location in an emulator/device instance. </p> - -<p>To copy a file or directory (recursively) <em>from</em> the emulator or device, use</p> -<pre>adb pull <remote> <local></pre> - -<p>To copy a file or directory (recursively) <em>to</em> the emulator or device, use</p> - <pre>adb push <local> <remote></pre> - -<p>In the commands, <code><local></code> and <code><remote></code> refer to the paths to the target files/directory on your development machine (local) and on the emulator/device instance (remote).</p> - -<p>Here's an example: </p> -<pre>adb push foo.txt /sdcard/foo.txt</pre> - -<a name="commandsummary"></a> - -<h2>Listing of adb Commands</h2> +<h2 id="commandsummary">Commands</h2> <p>The table below lists all of the supported adb commands and explains their meaning and usage. </p> - +<p class="table-caption"><strong>Table 1.</strong> Available adb commands</p> <table> <tr> <th>Category</th> @@ -185,7 +108,7 @@ instance, see <a href="{@docRoot}tools/building/index.html">Building and Running </tr> <tr> -<td rowspan="3">Options</td> +<td rowspan="3">Target Device</td> <td><code>-d</code></td> <td>Direct an adb command to the only attached USB device.</td> <td>Returns an error if more than one USB device is attached.</td> @@ -200,7 +123,8 @@ instance, see <a href="{@docRoot}tools/building/index.html">Building and Running <tr> <td><code>-s <serialNumber></code></td> <td>Direct an adb command a specific emulator/device instance, referred to by its adb-assigned serial number (such as "emulator-5556").</td> -<td>If not specified, adb generates an error.</td> +<td>See <a href="#directingcommands">Directing +Commands to a Specific Emulator/Device Instance</a>.</td> </tr> <tr> @@ -224,7 +148,7 @@ instance, see <a href="{@docRoot}tools/building/index.html">Building and Running <tr> <td rowspan="3">Debug</td> -<td ><code>logcat [<option>] [<filter-specs>]</code></td> +<td ><code>logcat [option] [filter-specs]</code></td> <td>Prints log data to the screen. </td> <td> </td> </tr> @@ -247,7 +171,7 @@ instance, see <a href="{@docRoot}tools/building/index.html">Building and Running <tr> <td rowspan=3">Data</td> <td><code>install <path-to-apk></code></td> -<td>Pushes an Android application (specified as a full path to an .apk file) to the data file of an emulator/device. </td> +<td>Pushes an Android application (specified as a full path to an .apk file) to an emulator/device. </td> <td> </td> </tr> @@ -303,11 +227,11 @@ instance, see <a href="{@docRoot}tools/building/index.html">Building and Running <td><code>wait-for-device</code></td> <td>Blocks execution until the device is online — that is, until the instance state is <code>device</code>.</td> <td>You can prepend this command to other adb commands, in which case adb will wait until the emulator/device instance is connected before issuing the other commands. Here's an example: -<pre>adb wait-for-device shell getprop</pre> +<pre class="no-pretty-print">adb wait-for-device shell getprop</pre> Note that this command does <em>not</em> cause adb to wait until the entire system is fully booted. For that reason, you should not prepend it to other commands that require a fully booted system. As an example, the <code>install</code> requires the Android package manager, which is available only after the system is fully booted. A command such as -<pre>adb wait-for-device install <app>.apk</pre> +<pre class="no-pretty-print">adb wait-for-device install <app>.apk</pre> would issue the <code>install</code> command as soon as the emulator or device instance connected to the adb server, but before the Android system was fully booted, so it would result in an error. </td> </tr> @@ -337,40 +261,841 @@ would issue the <code>install</code> command as soon as the emulator or device i </tr> <tr> -<td><code>shell [<shellCommand>]</code></td> +<td><code>shell [shellCommand]</code></td> <td>Issues a shell command in the target emulator/device instance and then exits the remote shell.</td> </tr> </table> -<a name="shellcommands"></a> -<h2>Issuing Shell Commands</h2> -<p>Adb provides an ash shell that you can use to run a variety of commands on an emulator -or device. The command binaries are stored in the file system of the emulator or device, -in this location: </p> -<pre>/system/bin/...</pre> -<p>You can use the <code>shell</code> command to issue commands, with or without entering the adb remote shell on the emulator/device. </p> -<p>To issue a single command without entering a remote shell, use the <code>shell</code> command like this: </p> - <pre>adb [-d|-e|-s {<serialNumber>}] shell <shellCommand></pre> + + +<h2 id="devicestatus">Querying for Emulator/Device Instances</h2> + +<p>Before issuing adb commands, it is helpful to know what emulator/device instances are connected to the adb server. You can generate a list of attached emulators/devices using the <code>devices</code> command: </p> + + <pre class="no-pretty-print">adb devices</pre> + +<p>In response, adb prints this status information for each instance:</p> + +<ul> + <li>Serial number — A string created by adb to uniquely identify an emulator/device instance by its + console port number. The format of the serial number is <code><type>-<consolePort></code>. + Here's an example serial number: <code>emulator-5554</code></li> + <li>State — The connection state of the instance may be one of the following: + <ul> + <li><code>offline</code> — the instance is not connected to adb or is not responding.</li> + <li><code>device</code> — the instance is now connected to the adb server. Note that this state does not + imply that the Android system is fully booted and operational, since the instance connects to adb + while the system is still booting. However, after boot-up, this is the normal operational state of + an emulator/device instance.</li> + <li><code>no device</code> — there is no emulator/device connected. + </ul> + </li> +</ul> + +<p>The output for each instance is formatted like this: </p> + + <pre class="no-pretty-print">[serialNumber] [state]</pre> + +<p>Here's an example showing the <code>devices</code> command and its output:</p> + + <pre class="no-pretty-print">adb devices +List of devices attached +emulator-5554 device +emulator-5556 device +emulator-5558 device</pre> + + + + + + +<h2 id="directingcommands">Directing Commands to a Specific Emulator/Device Instance</h2> + +<p>If multiple emulator/device instances are running, you must specify a target instance +when issuing adb commands. To do so, use the <code>-s</code> option in the commands. The usage +for the <code>-s</code> option is:</p> + + <pre class="no-pretty-print">adb -s <serialNumber> <command> </pre> + +<p>As shown, you specify the target instance for a command using its adb-assigned serial number. +You can use the <code>devices</code> command to obtain the serial numbers of running +emulator/device instances. For example: </p> + + <pre class="no-pretty-print">adb -s emulator-5556 install helloWorld.apk</pre> + +<p>Note that, if you issue a command without specifying a target emulator/device instance +while multiple devices are available, adb generates an error. + +<p>If you have multiple devices available (hardware or emulated), but only one is an emulator, +simply use the {@code -e} option to send commands to the emulator. Likewise if there's multiple +devices but only one hardware device attached, use the {@code -d} option to send commands to +the hardware device. + + + + +<h2 id="move">Installing an Application</h2> +<p>You can use adb to copy an application from your development computer and install it on an emulator/device instance. To do so, use the <code>install</code> command. With the command, you must specify the path to the .apk file that you want to install:</p> + +<pre class="no-pretty-print">adb install <path_to_apk></pre> + +<p>For more information about how to create an .apk file that you can install on an emulator/device +instance, see <a href="{@docRoot}tools/building/index.html">Building and Running</a></p> + +<p>Note that, if you are using the Eclipse IDE and have the ADT plugin installed, you do not need to use adb (or aapt) directly to install your application on the emulator/device. Instead, the ADT plugin handles the packaging and installation of the application for you. </p> + + + + + + +<h2 id="forwardports">Forwarding Ports</h2> + + <p>You can use the <code>forward</code> command to set up arbitrary port forwarding — forwarding of requests on a specific host port to a different port on an emulator/device instance. Here's how you would set up forwarding of host port 6100 to emulator/device port 7100:</p> +<pre class="no-pretty-print">adb forward tcp:6100 tcp:7100</pre> + <p>You can also use adb to set up forwarding to named abstract UNIX domain sockets, as illustrated here:</p> +<pre class="no-pretty-print">adb forward tcp:6100 local:logd </pre> + + + + + +<h2 id="copyfiles">Copying Files to or from an Emulator/Device Instance</h2> + +<p>You can use the adb commands <code>pull</code> and <code>push</code> to copy files to +and from an emulator/device instance. Unlike the <code>install</code> command, +which only copies an APK file to a specific location, the <code>pull</code> and <code>push</code> +commands let you copy arbitrary directories and files to any location in an +emulator/device instance. </p> + +<p>To copy a file or directory (and its sub-directories) <em>from</em> the emulator or device, use</p> +<pre class="no-pretty-print">adb pull <remote> <local></pre> + +<p>To copy a file or directory (and its sub-directories) <em>to</em> the emulator or device, use</p> + <pre class="no-pretty-print">adb push <local> <remote></pre> + +<p>In the commands, <code><local></code> and <code><remote></code> refer to the +paths to the target files/directory on your development machine (local) and on the +emulator/device instance (remote). For example: </p> +<pre class="no-pretty-print">adb push foo.txt /sdcard/foo.txt</pre> + + + + + + + + + +<h2 id="shellcommands">Issuing Shell Commands</h2> + +<p>Adb provides a Unix shell that you can use to run a variety of commands on an emulator +or connected device. The command binaries are stored in the file system of the emulator or device, +at <code>/system/bin/...</code> + +<p>Two of the most common command tools are <a href="#am">activity manager</a> ({@code am}) and +<a href="#pm">package manager</a> ({@code pm}).</p> + +<p>You can use the <code>shell</code> command to issue commands, with or without entering +the adb remote shell on the emulator/device. To issue a single command without entering a +remote shell, use the <code>shell</code> command like this: </p> + + <pre class="no-pretty-print">adb [-d|-e|-s <serialNumber>] shell <shell_command></pre> -<p>To drop into a remote shell on a emulator/device instance, use the <code>shell</code> command like this:</p> +<p>Or enter a remote shell on an emulator/device like this:</p> + + <pre class="no-pretty-print">adb [-d|-e|-s <serialNumber>] shell</pre> + +<p>When you are ready to exit the remote shell, press CTRL+D or type +<code>exit</code>. </p> + + + + + +<h3 id="am">Using activity manager (am)</h3> + +<p>Within an adb shell, you can issue commands with the activity manager ({@code am}) tool to +perform various system actions, such as start an activity, force-stop a process, +broadcast an intent, modify the device screen properties, and more. While in a shell, +the syntax is:</p> +<pre class="no-pretty-print"> +am <command> +</pre> + +<p>You can also issue an activity manager command directly from adb +without entering a remote shell. For example:</p> +<pre class="no-pretty-print"> +adb shell am start -a android.intent.action.VIEW +</pre> + + +<p class="table-caption"><strong>Table 2.</strong> Available activity manager commands</p> +<table> +<tr> + <th>Command</th> + <th>Description</th> +</tr> + +<tr> +<td><code> +start [options] <INTENT> +</code></td> +<td>Start an {@link android.app.Activity} specified by {@code <INTENT>}. <p>See the +<a href="#IntentSpec">Specification for <INTENT> arguments</a>. +<p>Options are: +<ul> + <li>{@code -D}: Enable debugging. + <li>{@code -W}: Wait for launch to complete. + <li>{@code --start-profiler <FILE>}: Start profiler and send results to {@code <FILE>}. + <li>{@code -P <FILE>}: Like <code>--start-profiler</code>, + but profiling stops when the app goes idle. + <li>{@code -R}: Repeat the activity launch {@code <COUNT>} times. Prior to each repeat, + the top activity will be finished. + <li>{@code -S}: Force stop the target app before starting the activity. + <li>{@code --opengl-trace}: Enable tracing of OpenGL functions. + <li>{@code --user <USER_ID> | current}: Specify which user to run as; if not + specified, then run as the current user. +</ul> +</td> +</tr> + +<tr> +<td><code> +startservice [options] <INTENT> +</code></td> +<td>Start the {@link android.app.Service} specified by {@code <INTENT>}. <p>See the +<a href="#IntentSpec">Specification for <INTENT> arguments</a>. +<p>Options are: +<ul> + <li>{@code --user <USER_ID> | current}: Specify which user to run as; if not + specified, then run as the current user. +</ul> +</td> +</tr> + +<tr> +<td><code> +force-stop <PACKAGE> +</code></td> +<td>Force stop everything associated with {@code <PACKAGE>} (the app's package name). +</td> +</tr> + +<tr> +<td><code> +kill [options] <PACKAGE> +</code></td> +<td> Kill all processes associated with {@code <PACKAGE>} + (the app's package name). This command kills only + processes that are safe to kill and that will not impact the user + experience. + <p>Options are: + <ul> + <li>{@code --user <USER_ID> | all | current}: Specify user whose processes to kill; + all users if not specified. + </ul> +</td> +</tr> + +<tr> +<td><code> +kill-all +</code></td> +<td>Kill all background processes. +</td> +</tr> + +<tr> +<td><code> +broadcast [options] <INTENT> +</code></td> +<td>Issue a broadcast intent. <p>See the +<a href="#IntentSpec">Specification for <INTENT> arguments</a>. +<p>Options are: +<ul> + <li>{@code [--user <USER_ID> | all | current]}: Specify which user to send to; if not + specified then send to all users. +</ul> +</td> +</tr> + +<tr> +<td><code> +instrument [options] <COMPONENT> +</code></td> +<td>Start monitoring with an {@link android.app.Instrumentation} instance. + Typically the target {@code <COMPONENT>} + is the form {@code <TEST_PACKAGE>/<RUNNER_CLASS>}. <p>Options are: +<ul> + <li>{@code -r}: Print raw results (otherwise decode + {@code <REPORT_KEY_STREAMRESULT>}). Use with + {@code [-e perf true]} to generate raw output for performance measurements. + + <li>{@code -e <NAME> <VALUE>}: Set argument {@code <NAME>} to {@code <VALUE>}. + For test runners a common form is {@code + -e <testrunner_flag> <value>[,<value>...]}. + + <li>{@code -p <FILE>}: Write profiling data to {@code <FILE>}. + + <li>{@code -w}: Wait for instrumentation to finish before returning. Required for + test runners. + + <li>{@code --no-window-animation}: Turn off window animations while running. + <li>{@code --user <USER_ID> | current}: Specify which user instrumentation runs in; + current user if not specified. +</ul> + +</td> +</tr> + +<tr> +<td><code> +profile start <PROCESS> <FILE> +</code></td> +<td>Start profiler on {@code <PROCESS>}, write results to {@code <FILE>}. +</td> +</tr> + +<tr> +<td><code> +profile stop <PROCESS> +</code></td> +<td>Stop profiler on {@code <PROCESS>}. +</td> +</tr> + +<tr> +<td style="white-space:nowrap"><code> +dumpheap [options] <PROCESS> <FILE> +</code></td> +<td>Dump the heap of {@code <PROCESS>}, write to {@code <FILE>}. <p>Options are: +<ul> + <li>{@code --user [<USER_ID>|current]}: When supplying a process name, + specify user of process to dump; uses current user if not specified. + <li>{@code -n}: Dump native heap instead of managed heap. +</ul> +</td> +</tr> + +<tr> +<td><code> +set-debug-app [options] <PACKAGE> +</code></td> +<td>Set application {@code <PACKAGE>} to debug. <p>Options are: +<ul> + <li>{@code -w}: Wait for debugger when application starts. + <li>{@code --persistent}: Retain this value. +</ul> +</td> +</tr> + +<tr> +<td><code> +clear-debug-app +</code></td> +<td>Clear the package previous set for debugging with {@code set-debug-app}. +</td> +</tr> + +<tr> +<td><code> +monitor [options] +</code></td> +<td>Start monitoring for crashes or ANRs. <p>Options are: +<ul> + <li>{@code --gdb}: Start gdbserv on the given port at crash/ANR. +</ul> +</td> +</tr> + +<tr> +<td><code> +screen-compat [on|off] <PACKAGE> +</code></td> +<td>Control <a href="{@docRoot}guide/practices/screen-compat-mode.html">screen +compatibility</a> mode of {@code <PACKAGE>}.</p> +</td> +</tr> + +<tr> +<td><code> +display-size [reset|<WxH>] +</code></td> +<td>Override emulator/device display size. +This command is helpful for testing your app across different screen sizes by mimicking a small +screen resolution using a device with a large screen, and vice versa. +<p>Example:<br><code>am display-size 1280x800</code> +</td> +</tr> + +<tr> +<td><code> +display-density <dpi> +</code></td> +<td>Override emulator/device display density. +This command is helpful for testing your app across different screen densities on high-density +screen environment using a low density screen, and vice versa. +<p>Example:<br><code>am display-density 480</code> +</td> +</tr> + +<tr> +<td><code> +to-uri <INTENT> +</code></td> +<td>Print the given intent specification as a URI. <p>See the +<a href="#IntentSpec">Specification for <INTENT> arguments</a>. +</td> +</tr> + +<tr> +<td><code> +to-intent-uri <INTENT> +</code></td> +<td>Print the given intent specification as an {@code intent:} URI. <p>See the +<a href="#IntentSpec">Specification for <INTENT> arguments</a>. +</td> +</tr> +</table> + + + + + +<h4 id="IntentSpec"> + <a href="" class="expandable" onclick="toggleExpandable(this,'.intents'); +return false">Specification for <INTENT> arguments</a></h4> + +<div class="intents" style="display:none"> + +<p>For activity manager commands that take a {@code <INTENT>} argument, you can +specify the intent with the following options:</p> + +<dl> + <dt>{@code -a <ACTION>}</dt> + <dd>Specify the intent action, such as "android.intent.action.VIEW". + You can declare this only once. + + <dt>{@code -d <DATA_URI>}</dt> + <dd>Specify the intent data URI, such as "content://contacts/people/1". + You can declare this only once. + + <dt>{@code -t <MIME_TYPE>}</dt> + <dd>Specify the intent MIME type, such as "image/png". + You can declare this only once. + + <dt>{@code -c <CATEGORY>}</dt> + <dd>Specify an intent category, such as "android.intent.category.APP_CONTACTS". + + <dt>{@code -n <COMPONENT>}</dt> + <dd>Specify the component name with package name prefix to create an explicit intent, such + as "com.example.app/.ExampleActivity". + + <dt>{@code -f <FLAGS>}</dt> + <dd>Add flags to the intent, as supported by {@link + android.content.Intent#setFlags setFlags()}. + + <dt>{@code --esn <EXTRA_KEY>}</dt> + <dd>Add a null extra. This option is not supported for URI intents. + + <dt>{@code -e|--es <EXTRA_KEY> <EXTRA_STRING_VALUE>}</dt> + <dd>Add string data as a key-value pair. + + <dt>{@code --ez <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE>}</dt> + <dd>Add boolean data as a key-value pair. + + <dt>{@code --ei <EXTRA_KEY> <EXTRA_INT_VALUE>}</dt> + <dd>Add integer data as a key-value pair. + + <dt>{@code --el <EXTRA_KEY> <EXTRA_LONG_VALUE>}</dt> + <dd>Add long data as a key-value pair. + + <dt>{@code --ef <EXTRA_KEY> <EXTRA_FLOAT_VALUE>}</dt> + <dd>Add float data as a key-value pair. + + <dt>{@code --eu <EXTRA_KEY> <EXTRA_URI_VALUE>}</dt> + <dd>Add URI data as a key-value pair. + + <dt>{@code --ecn <EXTRA_KEY> <EXTRA_COMPONENT_NAME_VALUE>}</dt> + <dd>Add a component name, which is converted and passed as + a {@link android.content.ComponentName} object. + + <dt>{@code --eia <EXTRA_KEY> <EXTRA_INT_VALUE>[,<EXTRA_INT_VALUE...]}</dt> + <dd>Add an array of integers. + + <dt>{@code --ela <EXTRA_KEY> <EXTRA_LONG_VALUE>[,<EXTRA_LONG_VALUE...]}</dt> + <dd>Add an array of longs. + + <dt>{@code --efa <EXTRA_KEY> <EXTRA_FLOAT_VALUE>[,<EXTRA_FLOAT_VALUE...]}</dt> + <dd>Add an array of floats. + + <dt>{@code --grant-read-uri-permission}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_GRANT_READ_URI_PERMISSION}. + + <dt>{@code --grant-write-uri-permission}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_GRANT_WRITE_URI_PERMISSION}. + + <dt>{@code --debug-log-resolution}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_DEBUG_LOG_RESOLUTION}. + + <dt>{@code --exclude-stopped-packages}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_EXCLUDE_STOPPED_PACKAGES}. + + <dt>{@code --include-stopped-packages}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_INCLUDE_STOPPED_PACKAGES}. + + <dt>{@code --activity-brought-to-front}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_BROUGHT_TO_FRONT}. + + <dt>{@code --activity-clear-top}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP}. + + <dt>{@code --activity-clear-when-task-reset}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET}. + + <dt>{@code --activity-exclude-from-recents}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS}. + + <dt>{@code --activity-launched-from-history}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY}. + + <dt>{@code --activity-multiple-task}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_MULTIPLE_TASK}. + + <dt>{@code --activity-no-animation}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_NO_ANIMATION}. + + <dt>{@code --activity-no-history}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_NO_HISTORY}. + + <dt>{@code --activity-no-user-action}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_NO_USER_ACTION}. + + <dt>{@code --activity-previous-is-top}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_PREVIOUS_IS_TOP}. + + <dt>{@code --activity-reorder-to-front}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_REORDER_TO_FRONT}. + + <dt>{@code --activity-reset-task-if-needed}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_RESET_TASK_IF_NEEDED}. + + <dt>{@code --activity-single-top}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_SINGLE_TOP}. + + <dt>{@code --activity-clear-task}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_CLEAR_TASK}. + + <dt>{@code --activity-task-on-home}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_TASK_ON_HOME}. + + <dt>{@code --receiver-registered-only}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_RECEIVER_REGISTERED_ONLY}. + + <dt>{@code --receiver-replace-pending}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_RECEIVER_REPLACE_PENDING}. + + <dt>{@code --selector}</dt> + <dd>Requires the use of {@code -d} and {@code -t} options to set the intent data and type. + + <dt>{@code <URI> <COMPONENT> <PACKAGE>}</dt> + <dd>You can directly specify a URI, package name, and component name when not qualified + by one of the above options. When an argument is unqualified, the tool assumes the argument + is a URI if it contains a ":" (colon); it assumes the argument is a component name if it + contains a "/" (forward-slash); otherwise it assumes the argument is a package name. + +</dl> +</div><!-- end 'intents' --> +<script> + $(window).hashchange( function(){ + if ((location.hash == "#IntentSpec") && !($("#IntentSpec a").hasClass("expanded"))) { + $("#IntentSpec a").click(); + } + }); +</script> + + + +<h3 id="pm">Using package manager (pm)</h3> + +<p>Within an adb shell, you can issue commands with the package manager ({@code pm}) tool to +perform actions and queries on application packages installed on the device. While in a shell, +the syntax is:</p> +<pre class="no-pretty-print"> +pm <command> +</pre> + +<p>You can also issue a package manager command directly from adb +without entering a remote shell. For example:</p> +<pre class="no-pretty-print"> +adb shell pm uninstall com.example.MyApp +</pre> + +<p class="table-caption"><strong>Table 3.</strong> Available package manager commands.</p> +<table> +<tr> + <th>Command</th> + <th>Description</th> +</tr> + +<tr> +<td><code> +list packages [options] <FILTER> +</code></td> +<td>Prints all packages, optionally only + those whose package name contains the text in {@code <FILTER>}. <p>Options: +<ul> + <li>{@code -f}: See their associated file. + <li>{@code -d}: Filter to only show disabled packages. + <li>{@code -e}: Filter to only show enabled packages. + <li>{@code -s}: Filter to only show system packages. + <li>{@code -3}: Filter to only show third party packages. + <li>{@code -i}: See the installer for the packages. + <li>{@code -u}: Also include uninstalled packages. + <li>{@code --user <USER_ID>}: The user space to query. +</ul> +</td> +</tr> + +<tr> +<td><code> +list permission-groups +</code></td> +<td>Prints all known permission groups. +</td> +</tr> + +<tr> +<td><code> +list permissions [options] <GROUP> +</code></td> +<td>Prints all known permissions, optionally only + those in {@code <GROUP>}. <p>Options: +<ul> + <li>{@code -g}: Organize by group. + <li>{@code -f}: Print all information. + <li>{@code -s}: Short summary. + <li>{@code -d}: Only list dangerous permissions. + <li>{@code -u}: List only the permissions users will see. +</ul> +</td> +</tr> - <pre>adb [-d|-e|-s {<serialNumber>}] shell</pre> +<tr> +<td><code> +list instrumentation +</code></td> +<td>List all test packages. <p>Options: + <ul> + <li>{@code -f}: List the APK file for the test package. + <li>{@code <TARGET_PACKAGE>}: List test packages for only this app. + </ul> +</td> +</tr> -<p>When you are ready to exit the remote shell, use <code>CTRL+D</code> or <code>exit</code> to end the shell session. </p> +<tr> +<td><code> +list features +</code></td> +<td>Prints all features of the system. +</td> +</tr> -<p>The sections below provide more information about shell commands that you can use.</p> - -<a name="sqlite" id="sqlite"></a> +<tr> +<td><code> +list libraries +</code></td> +<td>Prints all the libraries supported by the current device. +</td> +</tr> -<h3>Examining sqlite3 Databases from a Remote Shell</h3> +<tr> +<td><code> +list users +</code></td> +<td>Prints all users on the system. +</td> +</tr> + +<tr> +<td><code> +path <PACKAGE> +</code></td> +<td>Print the path to the APK of the given {@code <PACKAGE>}. +</td> +</tr> + +<tr> +<td><code> +install [options] <PATH> +</code></td> +<td>Installs a package (specified by {@code <PATH>}) to the system. <p>Options: + <ul> + <li>{@code -l}: Install the package with forward lock. + <li>{@code -r}: Reinstall an exisiting app, keeping its data. + <li>{@code -t}: Allow test APKs to be installed. + <li>{@code -i <INSTALLER_PACKAGE_NAME>}: Specify the installer package name. + <li>{@code -s}: Install package on the shared mass storage (such as sdcard). + <li>{@code -f}: Install package on the internal system memory. + <li>{@code -d}: Allow version code downgrade. + </ul> +</td> +</tr> + +<tr> +<td><code> +uninstall [options] <PACKAGE> +</code></td> +<td>Removes a package from the system. <p>Options: + <ul> + <li>{@code -k}: Keep the data and cache directories around after package removal. + </ul> +</td> +</tr> + +<tr> +<td><code> +clear <PACKAGE> +</code></td> +<td>Deletes all data associated with a package. +</td> +</tr> + +<tr> +<td><code> +enable <PACKAGE_OR_COMPONENT> +</code></td> +<td>Enable the given package or component (written as "package/class"). +</td> +</tr> + +<tr> +<td><code> +disable <PACKAGE_OR_COMPONENT> +</code></td> +<td>Disable the given package or component (written as "package/class"). +</td> +</tr> + +<tr> +<td style="white-space:nowrap"><code> +disable-user [options] <PACKAGE_OR_COMPONENT> +</code></td> +<td><p>Options: + <ul> + <li>{@code --user <USER_ID>}: The user to disable. + </ul> +</td> +</tr> + +<tr> +<td><code> +grant <PACKAGE_PERMISSION> +</code></td> +<td>Grant permissions + to applications. Only optional permissions the application has + declared can be granted. +</td> +</tr> + +<tr> +<td><code> +revoke <PACKAGE_PERMISSION> +</code></td> +<td>Revoke permissions + to applications. Only optional permissions the application has + declared can be revoked. +</td> +</tr> + +<tr> +<td><code> +set-install-location <LOCATION> +</code></td> +<td>Changes the default install location. Location values: +<ul> + <li>{@code 0}: Auto—Let system decide the best location. + <li>{@code 1}: Internal—install on internal device storage. + <li>{@code 2}: External—install on external media. +</ul> +<p class="note"><strong>Note:</strong> This is only intended for debugging; using this can cause + applications to break and other undesireable behavior.</p> +</td> +</tr> + +<tr> +<td><code> +get-install-location +</code></td> +<td>Returns the current install location. Return values: +<ul> + <li>{@code 0 [auto]}: Lets system decide the best location + <li>{@code 1 [internal]}: Installs on internal device storage + <li>{@code 2 [external]}: Installs on external media +</ul> +</td> +</tr> + +<tr> +<td><code> +set-permission-enforced <PERMISSION> [true|false] +</code></td> +<td>Specifies whether the given permission should be enforced. +</td> +</tr> + +<tr> +<td><code> +trim-caches <DESIRED_FREE_SPACE> +</code></td> +<td>Trim cache files to reach the given free space. +</td> +</tr> + +<tr> +<td><code> +create-user <USER_NAME> +</code></td> +<td>Create a new user with the given {@code <USER_NAME>}, + printing the new user identifier of the user. +</td> +</tr> + +<tr> +<td><code> +remove-user <USER_ID> +</code></td> +<td>Remove the user with the given {@code <USER_IDENTIFIER>}, + deleting all data associated with that user +</td> +</tr> + +<tr> +<td><code> +get-max-users +</code></td> +<td>Prints the maximum number of users supported by the device. +</td> +</tr> + +</table> + + + + + + + +<h3 id="sqlite">Examining sqlite3 databases from a remote shell</h3> <p>From an adb remote shell, you can use the <a href="http://www.sqlite.org/sqlite.html">sqlite3</a> command-line program to @@ -384,7 +1109,7 @@ The tool also gives you the ability to execute SQLite commands on the fly.</p> <p>Here's an example: </p> -<pre>$ adb -s emulator-5554 shell +<pre class="no-pretty-print">adb -s emulator-5554 shell # sqlite3 /data/data/com.example.google.rss.rssexample/databases/rssitems.db SQLite version 3.3.12 Enter ".help" for instructions @@ -394,34 +1119,40 @@ sqlite> .exit </pre> <p>Once you've invoked <code>sqlite3</code>, you can issue <code>sqlite3</code> commands in the shell. To exit and return to the adb remote shell, use <code>exit</code> or <code>CTRL+D</code>. -<a name="monkey"></a> -<h3>UI/Application Exerciser Monkey</h3> + + + +<h3 id="monkey">UI/Application Exerciser Monkey</h3> <p>The Monkey is a program that runs on your emulator or device and generates pseudo-random streams of user events such as clicks, touches, or gestures, as well as a number of system-level events. You can use the Monkey to stress-test applications that you are developing, in a random yet repeatable manner.</p> -<p>The simplest way to use the monkey is with the following command, which will launch your -application and send 500 pseudo-random events to it.</p> +<p>The simplest way to use the monkey is with the following command, which launches your +application and sends 500 pseudo-random events to it.</p> -<pre>$ adb shell monkey -v -p your.package.name 500</pre> +<pre class="no-pretty-print">adb shell monkey -v -p your.package.name 500</pre> <p>For more information about command options for Monkey, see the complete <a href="{@docRoot}tools/help/monkey.html" title="monkey">UI/Application Exerciser Monkey</a> documentation page.</p> -<a name="othershellcommands"></a> -<h3>Other Shell Commands</h3> -<p>The table below lists several of the adb shell commands available. For a complete list of commands and programs, start an emulator instance and use the <code>adb -help</code> command. </p> -<pre>adb shell ls /system/bin</pre> +<h3 id="othershellcommands">Other shell commands</h3> + +<p>For a list of all the available shell programs, use the following command:</p> + +<pre class="no-pretty-print">adb shell ls /system/bin</pre> <p>Help is available for most of the commands. </p> +<p>Table 4 lists some of the more common adb shell commands.</p> + +<p class="table-caption"><strong>Table 4.</strong> Some other adb shell commands</p> <table> <tr> <th>Shell Command</th> @@ -442,8 +1173,8 @@ application and send 500 pseudo-random events to it.</p> </tr> <tr> -<td><code>logcat [<option>]... [<filter-spec>]...</code></td> -<td>Enables radio logging and prints output to the screen. </td> +<td><code>logcat [option]... [filter-spec]...</code></td> +<td>Enables system and app logging and prints output to the screen. </td> </tr> <tr> @@ -464,39 +1195,47 @@ application and send 500 pseudo-random events to it.</p> </tr> </table> + + + + + + + <a name="stdout"></a> <a name="usinglogcat"></a> <a name="outputformat"></a> <a name="filteringoutput"></a> <a name="stdout"></a> <a name="logcatoptions"></a> -<a name="logcat"></a> -<h2>Enabling logcat Logging</h2> +<h2 id="logcat">Enabling logcat logging</h2> <p>The Android logging system provides a mechanism for collecting and viewing system debug output. Logs from various applications and portions of the system are collected in a series of circular buffers, which then can be viewed and filtered by the <code>logcat</code> command.</p> <p>You can use the <code>logcat</code> command to view and follow the contents of the system's log buffers. The general usage is:</p> -<pre>[adb] logcat [<option>] ... [<filter-spec>] ...</pre> +<pre class="no-pretty-print">[adb] logcat [option] ... [filter-spec] ...</pre> <p>You can use the <code>logcat</code> command from your development computer or from a remote adb shell in an emulator/device instance. To view log output in your development computer, you use</p> -<pre>$ adb logcat</pre> +<pre class="no-pretty-print">adb logcat</pre> <p>and from a remote adb shell you use</p> -<pre># logcat</pre> +<pre class="no-pretty-print">logcat</pre> <p>See <a href="{@docRoot}tools/debugging/debugging-log.html">Reading and Writing Logs</a> for complete information about logcat commend options and filter specifications.</p> -<a name="stopping"></a> -<h2>Stopping the adb Server</h2> + + +<h2 id="stopping">Stopping the adb server</h2> <p>In some cases, you might need to terminate the adb server process and then restart it. For example, if adb does not respond to a command, you can terminate the server and restart it and that may resolve the problem. </p> -<p>To stop the adb server, use the <code>kill-server</code>. You can then restart the server by issuing any adb command. </p> +<p>To stop the adb server, use the <code>kill-server</code> command. +You can then restart the server by issuing any other adb command. </p> diff --git a/docs/html/tools/help/android.jd b/docs/html/tools/help/android.jd index 282c791..19891e8 100644 --- a/docs/html/tools/help/android.jd +++ b/docs/html/tools/help/android.jd @@ -280,7 +280,7 @@ and may be out of date. For the most current list of options, execute <code>andr </tr> <tr> - <td rowspan="3"><code>create-test-project</code></td> + <td rowspan="3"><code>create test-project</code></td> <td><code>-n <name></code></td> @@ -306,7 +306,7 @@ and may be out of date. For the most current list of options, execute <code>andr </tr> <tr> - <td rowspan="2"><code>update-test-project</code></td> + <td rowspan="2"><code>update test-project</code></td> <td><code>-p <path></code></td> @@ -324,7 +324,7 @@ and may be out of date. For the most current list of options, execute <code>andr </tr> <tr> - <td rowspan="4"><code>create-lib-project</code></td> + <td rowspan="4"><code>create lib-project</code></td> <td><code>-k <packageName></code></td> @@ -358,7 +358,7 @@ and may be out of date. For the most current list of options, execute <code>andr </tr> <tr> - <td rowspan="3"><code>update-lib-project</code></td> + <td rowspan="3"><code>update lib-project</code></td> <td><code>-p <path></code></td> @@ -382,6 +382,30 @@ and may be out of date. For the most current list of options, execute <code>andr <td></td> </tr> + + <tr> + <td rowspan="3"><code>create uitest-project</code></td> + <td><code>-n <name></code></td> + <td>The name of the UI test project</td> + <td></td> + </tr> + + <tr> + <td><code>-t <name></code></td> + + <td>Target ID of the UI test project</td> + + <td>Required</td> + </tr> + + <tr> + <td><code>-p <path></code></td> + + <td>Location path of the UI test project</td> + + <td>Required</td> + </tr> + </table> <h3>Update actions</h3> diff --git a/docs/html/tools/help/jobb.jd b/docs/html/tools/help/jobb.jd index d390ac9..97f0942 100644 --- a/docs/html/tools/help/jobb.jd +++ b/docs/html/tools/help/jobb.jd @@ -8,7 +8,7 @@ page.title=JOBB Level 9) or higher. OBB files are used to provide additional file assets for Android applications (such as graphics, sounds and video), separate from an application's APK file. For more information on using expansion files, see - <a href="{@docRoot}guide/google/play/expansion-files.html">APK Expansion Files</a>.</p> + <a href="{@docRoot}google/play/expansion-files.html">APK Expansion Files</a>.</p> <h2 id="usage">Usage</h2> diff --git a/docs/html/tools/help/proguard.jd b/docs/html/tools/help/proguard.jd index 1da94ba..be0b8dc 100644 --- a/docs/html/tools/help/proguard.jd +++ b/docs/html/tools/help/proguard.jd @@ -39,7 +39,7 @@ parent.link=index.html sized <code>.apk</code> file that is more difficult to reverse engineer. Because ProGuard makes your application harder to reverse engineer, it is important that you use it when your application utilizes features that are sensitive to security like when you are - <a href="{@docRoot}guide/google/play/licensing/index.html">Licensing Your Applications</a>.</p> + <a href="{@docRoot}google/play/licensing/index.html">Licensing Your Applications</a>.</p> <p>ProGuard is integrated into the Android build system, so you do not have to invoke it manually. ProGuard runs only when you build your application in release mode, so you do not diff --git a/docs/html/tools/help/sdk-manager.jd b/docs/html/tools/help/sdk-manager.jd index 4852b21..215ce6f 100644 --- a/docs/html/tools/help/sdk-manager.jd +++ b/docs/html/tools/help/sdk-manager.jd @@ -7,6 +7,8 @@ page.title=SDK Manager <p>You can launch the SDK Manager in one of the following ways:</p> <ul> + <li>From Eclipse (with <a href="{@docRoot}tools/help/adt.html">ADT</a>), + select <strong>Window</strong> > <strong>Android SDK Manager</strong>.</li> <li>On Windows, double-click the <code>SDK Manager.exe</code> file at the root of the Android SDK directory.</li> <li>On Mac or Linux, open a terminal and navigate to the <code>tools/</code> directory in the diff --git a/docs/html/tools/help/uiautomator/IAutomationSupport.jd b/docs/html/tools/help/uiautomator/IAutomationSupport.jd new file mode 100644 index 0000000..4120f2b --- /dev/null +++ b/docs/html/tools/help/uiautomator/IAutomationSupport.jd @@ -0,0 +1,168 @@ +page.title=IAutomationSupport +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> + +<h2>Class Overview</h2> +<p>Provides auxiliary support for running test cases + +</p> + + + + + +</div><!-- jd-descr --> + + + + + + + + + + + + + + + + +<div class="jd-descr"> + + +<h2>Summary</h2> + + + + + + + + + + + + + + + + + + + + + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + abstract + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#sendStatus(int, android.os.Bundle)">sendStatus</a></span>(int resultCode, Bundle status) + + <div class="jd-descrdiv">Allows the running test cases to send out interim status</div> + + </td></tr> + + + +</table> + + + + + + + +</div><!-- jd-descr (summary) --> + +<!-- Details --> + + + + + + + + +<!-- XML Attributes --> + + +<!-- Enum Values --> + + +<!-- Constants --> + + +<!-- Fields --> + + +<!-- Public ctors --> + + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<!-- Protected ctors --> + + + +<!-- ========= METHOD DETAIL ======== --> +<!-- Public methdos --> + +<h2>Public Methods</h2> + + + +<a id="sendStatus(int, android.os.Bundle)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + abstract + + void + </span> + <span class="sympad">sendStatus</span> + <span class="normal">(int resultCode, Bundle status)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Allows the running test cases to send out interim status</p></div> + + </div> +</div> + + + diff --git a/docs/html/tools/help/uiautomator/UiAutomatorTestCase.jd b/docs/html/tools/help/uiautomator/UiAutomatorTestCase.jd new file mode 100644 index 0000000..48c63ba --- /dev/null +++ b/docs/html/tools/help/uiautomator/UiAutomatorTestCase.jd @@ -0,0 +1,1402 @@ +page.title=UiAutomatorTestCase +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> +<h2>Class Overview</h2> +<p>UI automation tests should extend this class. This class provides access + to the following: +<ul> +<li><code><a href="UiDevice.html">UiDevice</a></code> instance</li> +<li>Bundle for command line parameters</li> +</ul> +</p> + + + + + +</div><!-- jd-descr --> + + + + + + + + + + + + + + + + +<div class="jd-descr"> + + +<h2>Summary</h2> + + + + + + + + + + + + + + + + + + + + + + + +<!-- ======== CONSTRUCTOR SUMMARY ======== --> +<table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#UiAutomatorTestCase()">UiAutomatorTestCase</a></span>() + + </td></tr> + + + +</table> + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="IAutomationSupport.html">IAutomationSupport</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getAutomationSupport()">getAutomationSupport</a></span>() + + <div class="jd-descrdiv">Provides support for running tests to report interim status</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + Bundle + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getParams()">getParams</a></span>() + + <div class="jd-descrdiv">Get command line parameters.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiDevice.html">UiDevice</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getUiDevice()">getUiDevice</a></span>() + + <div class="jd-descrdiv">Get current instance of <code><a href="UiDevice.html">UiDevice</a></code>.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#sleep(long)">sleep</a></span>(long ms) + + <div class="jd-descrdiv">Calls <code><a href="null#sleep(long)">sleep(long)</a></code> to sleep</div> + + </td></tr> + + + +</table> + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="inhmethods" class="jd-sumtable"><tr><th> + <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a> + <div style="clear:left;">Inherited Methods</div></th></tr> + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-junit.framework.TestCase" class="jd-expando-trigger closed" + ><img id="inherited-methods-junit.framework.TestCase-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + junit.framework.TestCase + +<div id="inherited-methods-junit.framework.TestCase"> + <div id="inherited-methods-junit.framework.TestCase-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-junit.framework.TestCase-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">countTestCases</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getName</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + TestResult + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">run</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">run</span>(TestResult arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">runBare</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">setName</span>(String arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-junit.framework.Assert" class="jd-expando-trigger closed" + ><img id="inherited-methods-junit.framework.Assert-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + junit.framework.Assert + +<div id="inherited-methods-junit.framework.Assert"> + <div id="inherited-methods-junit.framework.Assert-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-junit.framework.Assert-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(short arg0, short arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, int arg1, int arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, short arg1, short arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(char arg0, char arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, String arg1, String arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(int arg0, int arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, double arg1, double arg2, double arg3) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, long arg1, long arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(byte arg0, byte arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(Object arg0, Object arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(boolean arg0, boolean arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, float arg1, float arg2, float arg3) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, boolean arg1, boolean arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, String arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(float arg0, float arg1, float arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, byte arg1, byte arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(double arg0, double arg1, double arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, char arg1, char arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, Object arg1, Object arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(long arg0, long arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertFalse</span>(String arg0, boolean arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertFalse</span>(boolean arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertNotNull</span>(String arg0, Object arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertNotNull</span>(Object arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertNotSame</span>(Object arg0, Object arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertNotSame</span>(String arg0, Object arg1, Object arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertNull</span>(Object arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertNull</span>(String arg0, Object arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertSame</span>(Object arg0, Object arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertSame</span>(String arg0, Object arg1, Object arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertTrue</span>(String arg0, boolean arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertTrue</span>(boolean arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">fail</span>(String arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">fail</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">failNotEquals</span>(String arg0, Object arg1, Object arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">failNotSame</span>(String arg0, Object arg1, Object arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">failSame</span>(String arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">format</span>(String arg0, Object arg1, Object arg2) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" + ><img id="inherited-methods-java.lang.Object-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + java.lang.Object + +<div id="inherited-methods-java.lang.Object"> + <div id="inherited-methods-java.lang.Object-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">equals</span>(Object arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + Class<?> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getClass</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">hashCode</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notify</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notifyAll</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0, int arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-junit.framework.Test" class="jd-expando-trigger closed" + ><img id="inherited-methods-junit.framework.Test-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From interface + + junit.framework.Test + +<div id="inherited-methods-junit.framework.Test"> + <div id="inherited-methods-junit.framework.Test-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-junit.framework.Test-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + abstract + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">countTestCases</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + abstract + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">run</span>(TestResult arg0) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + +</table> + + +</div><!-- jd-descr (summary) --> + +<!-- Details --> + + + + + + + + +<!-- XML Attributes --> + + +<!-- Enum Values --> + + +<!-- Constants --> + + +<!-- Fields --> + + +<!-- Public ctors --> + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<h2>Public Constructors</h2> + + + +<a id="UiAutomatorTestCase()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + + </span> + <span class="sympad">UiAutomatorTestCase</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p></p></div> + + </div> +</div> + + + + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<!-- Protected ctors --> + + + +<!-- ========= METHOD DETAIL ======== --> +<!-- Public methdos --> + +<h2>Public Methods</h2> + + + +<a id="getAutomationSupport()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="IAutomationSupport.html">IAutomationSupport</a> + </span> + <span class="sympad">getAutomationSupport</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Provides support for running tests to report interim status</p></div> + + </div> +</div> + + +<a id="getParams()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + Bundle + </span> + <span class="sympad">getParams</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Get command line parameters. On the command line when passing <code>-e key value</code> + pairs, the Bundle will have the key value pairs conveniently available to the + tests. +</p></div> + + </div> +</div> + + +<a id="getUiDevice()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiDevice.html">UiDevice</a> + </span> + <span class="sympad">getUiDevice</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Get current instance of <code><a href="UiDevice.html">UiDevice</a></code>. Works similar to calling the static + <code><a href="UiDevice.html#getInstance()">getInstance()</a></code> from anywhere in the test classes. +</p></div> + + </div> +</div> + + +<a id="sleep(long)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">sleep</span> + <span class="normal">(long ms)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Calls <code><a href="null#sleep(long)">sleep(long)</a></code> to sleep</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>ms</th> + <td>is in milliseconds. +</td> + </tr> + </table> + </div> + + </div> +</div> + diff --git a/docs/html/tools/help/uiautomator/UiCollection.jd b/docs/html/tools/help/uiautomator/UiCollection.jd new file mode 100644 index 0000000..ed92ca7 --- /dev/null +++ b/docs/html/tools/help/uiautomator/UiCollection.jd @@ -0,0 +1,1271 @@ +page.title=UiCollection +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> +<p>Used to enumerate a container's user interface (UI) elements for the purpose of counting, + or targeting a sub elements by a child's text or description. +</p> + +<div class="jd-descr"> + + +<h2>Summary</h2> + + + + + + + + + + + + + + + + + + + + + + + +<!-- ======== CONSTRUCTOR SUMMARY ======== --> +<table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#UiCollection(com.android.uiautomator.core.UiSelector)">UiCollection</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + </td></tr> + + + +</table> + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByDescription</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, String text) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this <code><a href="UiSelector.html">UiSelector</a></code> + selector.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildByInstance(com.android.uiautomator.core.UiSelector, int)">getChildByInstance</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, int instance) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this <code><a href="UiSelector.html">UiSelector</a></code>.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByText</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, String text) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this <code><a href="UiSelector.html">UiSelector</a></code>.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildCount(com.android.uiautomator.core.UiSelector)">getChildCount</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern) + + <div class="jd-descrdiv">Counts child UI element instances matching the <code>childPattern</code> + argument.</div> + + </td></tr> + + + +</table> + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="inhmethods" class="jd-sumtable"><tr><th> + <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a> + <div style="clear:left;">Inherited Methods</div></th></tr> + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-com.android.uiautomator.core.UiObject" class="jd-expando-trigger closed" + ><img id="inherited-methods-com.android.uiautomator.core.UiObject-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + <a href="UiObject.html">com.android.uiautomator.core.UiObject</a> + +<div id="inherited-methods-com.android.uiautomator.core.UiObject"> + <div id="inherited-methods-com.android.uiautomator.core.UiObject-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-com.android.uiautomator.core.UiObject-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clearTextField()">clearTextField</a></span>() + + <div class="jd-descrdiv">Clears the existing text contents in an editable field.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#click()">click</a></span>() + + <div class="jd-descrdiv">Performs a click at the center of the visible bounds of the UI element represented + by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clickAndWaitForNewWindow(long)">clickAndWaitForNewWindow</a></span>(long timeout) + + <div class="jd-descrdiv">Performs a click at the center of the visible bounds of the UI element represented + by this UiObject and waits for window transitions.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clickAndWaitForNewWindow()">clickAndWaitForNewWindow</a></span>() + + <div class="jd-descrdiv">See <code><a href="UiObject.html#clickAndWaitForNewWindow(long)">clickAndWaitForNewWindow(long)</a></code> + This method is intended to reliably wait for window transitions that would typically take + longer than the usual default timeouts.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clickBottomRight()">clickBottomRight</a></span>() + + <div class="jd-descrdiv">Clicks the bottom and right corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clickTopLeft()">clickTopLeft</a></span>() + + <div class="jd-descrdiv">Clicks the top and left corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#exists()">exists</a></span>() + + <div class="jd-descrdiv">Check if UI element exists.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + Rect + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getBounds()">getBounds</a></span>() + + <div class="jd-descrdiv">Returns the UI element's <code>bounds</code> property.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getChild(com.android.uiautomator.core.UiSelector)">getChild</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Creates a new UiObject representing a child UI element of the element currently represented + by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getChildCount()">getChildCount</a></span>() + + <div class="jd-descrdiv">Counts the child UI elements immediately under the UI element currently represented by + this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getContentDescription()">getContentDescription</a></span>() + + <div class="jd-descrdiv">Reads the <code>content_desc</code> property of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getFromParent(com.android.uiautomator.core.UiSelector)">getFromParent</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Creates a new UiObject representing a child UI element from the parent element currently + represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getPackageName()">getPackageName</a></span>() + + <div class="jd-descrdiv">Reads the UI element's <code>package</code> property</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getSelector()">getSelector</a></span>() + + <div class="jd-descrdiv">Debugging helper.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getText()">getText</a></span>() + + <div class="jd-descrdiv">Reads the <code>text</code> property of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + Rect + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getVisibleBounds()">getVisibleBounds</a></span>() + + <div class="jd-descrdiv">Returns the visible bounds of the UI element.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isCheckable()">isCheckable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>checkable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isChecked()">isChecked</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>checked</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isClickable()">isClickable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>clickable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isEnabled()">isEnabled</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>enabled</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isFocusable()">isFocusable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>focusable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isFocused()">isFocused</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>focused</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isLongClickable()">isLongClickable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>long-clickable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isScrollable()">isScrollable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>scrollable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isSelected()">isSelected</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>selected</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#longClick()">longClick</a></span>() + + <div class="jd-descrdiv">Long clicks the center of the visible bounds of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#longClickBottomRight()">longClickBottomRight</a></span>() + + <div class="jd-descrdiv">Long clicks bottom and right corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#longClickTopLeft()">longClickTopLeft</a></span>() + + <div class="jd-descrdiv">Long clicks on the top and left corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#setText(java.lang.String)">setText</a></span>(String text) + + <div class="jd-descrdiv">Sets the text in an editable field, after clearing the field's content.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#swipeDown(int)">swipeDown</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object, Also see + #scrollToBeginning(int), #scrollToEnd(int), #scrollBackward(), + #scrollForward().</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#swipeLeft(int)">swipeLeft</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#swipeRight(int)">swipeRight</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#swipeUp(int)">swipeUp</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#waitForExists(long)">waitForExists</a></span>(long timeout) + + <div class="jd-descrdiv">Waits a specified length of time for a UI element to become visible.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#waitUntilGone(long)">waitUntilGone</a></span>(long timeout) + + <div class="jd-descrdiv">Waits a specified length of time for a UI element to become undetectable.</div> + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" + ><img id="inherited-methods-java.lang.Object-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + java.lang.Object + +<div id="inherited-methods-java.lang.Object"> + <div id="inherited-methods-java.lang.Object-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">equals</span>(Object arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + Class<?> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getClass</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">hashCode</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notify</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notifyAll</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0, int arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + +</table> + + +</div><!-- jd-descr (summary) --> + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<h2>Public Constructors</h2> + + +<a id="UiCollection(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + + </span> + <span class="sympad">UiCollection</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> selector)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p></p></div> + + </div> +</div> + + + +<!-- ========= METHOD DETAIL ======== --> +<!-- Public methdos --> + +<h2>Public Methods</h2> + + +<a id="getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChildByDescription</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Searches for child UI element within the constraints of this <code><a href="UiSelector.html">UiSelector</a></code> + selector. + + It looks for any child matching the <code>childPattern</code> argument that has + a child UI element anywhere within its sub hierarchy that has content-description text. + The returned UiObject will point at the <code>childPattern</code> instance that matched the + search and not at the identifying child element that matched the content description.</p></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> + </tr> + <tr> + <th>text</th> + <td>String of the identifying child contents of of the <code>childPattern</code></td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code></li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildByInstance(com.android.uiautomator.core.UiSelector, int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChildByInstance</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, int instance)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Searches for child UI element within the constraints of this <code><a href="UiSelector.html">UiSelector</a></code>. + + It looks for any child matching the <code>childPattern</code> argument that has + a child UI element anywhere within its sub hierarchy that is at the <code>instance</code> + specified. The operation is performed only on the visible items and no scrolling is performed + in this case.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> + </tr> + <tr> + <th>instance</th> + <td>int the desired matched instance of this <code>childPattern</code></td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code> +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChildByText</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Searches for child UI element within the constraints of this <code><a href="UiSelector.html">UiSelector</a></code> + selector. + + It looks for any child matching the <code>childPattern</code> argument that has + a child UI element anywhere within its sub hierarchy that has a text attribute equal to + <code>text</code>. The returned UiObject will point at the <code>childPattern</code> + instance that matched the search and not at the identifying child element that matched the + text attribute.</p></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> + </tr> + <tr> + <th>text</th> + <td>String of the identifying child contents of of the <code>childPattern</code></td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code></li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildCount(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + int + </span> + <span class="sympad">getChildCount</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern)</span> + </h4> + <div class="api-level"> + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Counts child UI element instances matching the <code>childPattern</code> + argument. The method returns the number of matching UI elements that are + currently visible. The count does not include items of a scrollable list + that are off-screen.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td>a <code><a href="UiSelector.html">UiSelector</a></code> that represents the matching child UI + elements to count</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>the number of matched childPattern under the current <code><a href="UiCollection.html">UiCollection</a></code> +</li></ul> + </div> + + </div> +</div> + diff --git a/docs/html/tools/help/uiautomator/UiDevice.jd b/docs/html/tools/help/uiautomator/UiDevice.jd new file mode 100644 index 0000000..1c8805b --- /dev/null +++ b/docs/html/tools/help/uiautomator/UiDevice.jd @@ -0,0 +1,3073 @@ +page.title=UiDevice +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> + +<h2>Class Overview</h2> +<p>UiDevice 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.</p> + + + + + +</div><!-- jd-descr --> + + + + + + + + + + + + + + + + +<div class="jd-descr"> + + +<h2>Summary</h2> + + + + + + + + + + + + + + + + + + + + + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> + + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#clearLastTraversedText()">clearLastTraversedText</a></span>() + + <div class="jd-descrdiv">Clears the text from the last UI traversal event.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#click(int, int)">click</a></span>(int x, int y) + + <div class="jd-descrdiv">Perform a click at arbitrary coordinates specified by the user</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#dumpWindowHierarchy(java.lang.String)">dumpWindowHierarchy</a></span>(String fileName) + + <div class="jd-descrdiv">Helper method used for debugging to dump the current window's layout hierarchy.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#freezeRotation()">freezeRotation</a></span>() + + <div class="jd-descrdiv">Disables the sensors and freezes the device rotation at its + current rotation state.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getCurrentActivityName()">getCurrentActivityName</a></span>() + + <div class="jd-descrdiv"> + <em> + This method is deprecated. + The results returned should be considered unreliable</em></div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getCurrentPackageName()">getCurrentPackageName</a></span>() + + <div class="jd-descrdiv">Retrieves the name of the last package to report accessibility events.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getDisplayHeight()">getDisplayHeight</a></span>() + + <div class="jd-descrdiv">Gets the height of the display, in pixels.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getDisplayRotation()">getDisplayRotation</a></span>() + + <div class="jd-descrdiv">Returns the current rotation of the display, as defined in Surface@return</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getDisplayWidth()">getDisplayWidth</a></span>() + + <div class="jd-descrdiv">Gets the width of the display, in pixels.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + static + + <a href="UiDevice.html">UiDevice</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getInstance()">getInstance</a></span>() + + <div class="jd-descrdiv">Retrieves a singleton instance of UiDevice</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getLastTraversedText()">getLastTraversedText</a></span>() + + <div class="jd-descrdiv">Retrieves the text from the last UI traversal event received.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getProductName()">getProductName</a></span>() + + <div class="jd-descrdiv">Retrieves the product name of the device.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#hasAnyWatcherTriggered()">hasAnyWatcherTriggered</a></span>() + + <div class="jd-descrdiv">Checks if any registered <code><a href="UiWatcher.html">UiWatcher</a></code> have triggered.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#hasWatcherTriggered(java.lang.String)">hasWatcherTriggered</a></span>(String watcherName) + + <div class="jd-descrdiv">Checks if a specific registered <code><a href="UiWatcher.html">UiWatcher</a></code> has triggered.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isNaturalOrientation()">isNaturalOrientation</a></span>() + + <div class="jd-descrdiv">Check if the device is in its natural orientation.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isScreenOn()">isScreenOn</a></span>() + + <div class="jd-descrdiv">Checks the power manager if the screen is ON.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressBack()">pressBack</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the BACK button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressDPadCenter()">pressDPadCenter</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the CENTER button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressDPadDown()">pressDPadDown</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the DOWN button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressDPadLeft()">pressDPadLeft</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the LEFT button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressDPadRight()">pressDPadRight</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the RIGHT button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressDPadUp()">pressDPadUp</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the UP button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressDelete()">pressDelete</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the DELETE key.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressEnter()">pressEnter</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the ENTER key.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressHome()">pressHome</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the HOME button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressKeyCode(int)">pressKeyCode</a></span>(int keyCode) + + <div class="jd-descrdiv">Simulates a short press using a key code.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressKeyCode(int, int)">pressKeyCode</a></span>(int keyCode, int metaState) + + <div class="jd-descrdiv">Simulates a short press using a key code.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressMenu()">pressMenu</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the MENU button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressRecentApps()">pressRecentApps</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the Recent Apps button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressSearch()">pressSearch</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the SEARCH button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#registerWatcher(java.lang.String, com.android.uiautomator.core.UiWatcher)">registerWatcher</a></span>(String name, <a href="UiWatcher.html">UiWatcher</a> watcher) + + <div class="jd-descrdiv">Registers a <code><a href="UiWatcher.html">UiWatcher</a></code> to run automatically when the testing framework is unable to + find a match using a <code><a href="UiSelector.html">UiSelector</a></code>.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#removeWatcher(java.lang.String)">removeWatcher</a></span>(String name) + + <div class="jd-descrdiv">Removes a previously registered <code><a href="UiWatcher.html">UiWatcher</a></code>.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#resetWatcherTriggers()">resetWatcherTriggers</a></span>() + + <div class="jd-descrdiv">Resets a <code><a href="UiWatcher.html">UiWatcher</a></code> that has been triggered.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#runWatchers()">runWatchers</a></span>() + + <div class="jd-descrdiv">This method forces all registered watchers to run.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#setOrientationLeft()">setOrientationLeft</a></span>() + + <div class="jd-descrdiv">Simulates orienting the device to the left and also freezes rotation + by disabling the sensors.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#setOrientationNatural()">setOrientationNatural</a></span>() + + <div class="jd-descrdiv">Simulates orienting the device into its natural orientation and also freezes rotation + by disabling the sensors.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#setOrientationRight()">setOrientationRight</a></span>() + + <div class="jd-descrdiv">Simulates orienting the device to the right and also freezes rotation + by disabling the sensors.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#sleep()">sleep</a></span>() + + <div class="jd-descrdiv">This method simply presses the power button if the screen is ON else + it does nothing if the screen is already OFF.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#swipe(android.graphics.Point[], int)">swipe</a></span>(Point[] segments, int segmentSteps) + + <div class="jd-descrdiv">Performs a swipe between points in the Point array.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#swipe(int, int, int, int, int)">swipe</a></span>(int startX, int startY, int endX, int endY, int steps) + + <div class="jd-descrdiv">Performs a swipe from one coordinate to another using the number of steps + to determine smoothness and speed.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#takeScreenshot(java.io.File, float, int)">takeScreenshot</a></span>(File storePath, float scale, int quality) + + <div class="jd-descrdiv">Take a screenshot of current window and store it as PNG + + The screenshot is adjusted per screen rotation</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#takeScreenshot(java.io.File)">takeScreenshot</a></span>(File storePath) + + <div class="jd-descrdiv">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</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#unfreezeRotation()">unfreezeRotation</a></span>() + + <div class="jd-descrdiv">Re-enables the sensors and un-freezes the device rotation allowing its contents + to rotate with the device physical rotation.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#waitForIdle(long)">waitForIdle</a></span>(long time) + + <div class="jd-descrdiv">Waits for the current application to idle.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#waitForIdle()">waitForIdle</a></span>() + + <div class="jd-descrdiv">Waits for the current application to idle.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#waitForWindowUpdate(java.lang.String, long)">waitForWindowUpdate</a></span>(String packageName, long timeout) + + <div class="jd-descrdiv">Waits for a window content update event to occur.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#wakeUp()">wakeUp</a></span>() + + <div class="jd-descrdiv">This method simulates pressing the power button if the screen is OFF else + it does nothing if the screen is already ON.</div> + + </td></tr> + + + +</table> + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="inhmethods" class="jd-sumtable"><tr><th> + <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a> + <div style="clear:left;">Inherited Methods</div></th></tr> + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" + ><img id="inherited-methods-java.lang.Object-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + java.lang.Object + +<div id="inherited-methods-java.lang.Object"> + <div id="inherited-methods-java.lang.Object-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">equals</span>(Object arg0) + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + Class<?> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getClass</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">hashCode</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notify</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notifyAll</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0, int arg1) + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + +</table> + + +</div><!-- jd-descr (summary) --> + +<!-- Details --> + + + + + + + + +<!-- XML Attributes --> + + +<!-- Enum Values --> + + +<!-- Constants --> + + +<!-- Fields --> + + +<!-- Public ctors --> + + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<!-- Protected ctors --> + + + +<!-- ========= METHOD DETAIL ======== --> +<!-- Public methdos --> + +<h2>Public Methods</h2> + + + +<a id="clearLastTraversedText()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">clearLastTraversedText</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Clears the text from the last UI traversal event. + See <code><a href="#getLastTraversedText()">getLastTraversedText()</a></code>.</p></div> + + </div> +</div> + + +<a id="click(int, int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">click</span> + <span class="normal">(int x, int y)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Perform a click at arbitrary coordinates specified by the user</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>x</th> + <td>coordinate</td> + </tr> + <tr> + <th>y</th> + <td>coordinate</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if the click succeeded else false</li></ul> + </div> + + </div> +</div> + + +<a id="dumpWindowHierarchy(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">dumpWindowHierarchy</span> + <span class="normal">(String fileName)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Helper method used for debugging to dump the current window's layout hierarchy. + The file root location is /data/local/tmp</p></div> + + </div> +</div> + + +<a id="freezeRotation()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">freezeRotation</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Disables the sensors and freezes the device rotation at its + current rotation state.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>RemoteException</td> + </tr> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getCurrentActivityName()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + String + </span> + <span class="sympad">getCurrentActivityName</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + <p> + <p class="caution"> + <strong> + This method is deprecated.</strong><br/> The results returned should be considered unreliable + </p> + <div class="jd-tagdata jd-tagdescr"><p>Retrieves the last activity to report accessibility events.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>String name of activity</li></ul> + </div> + + </div> +</div> + + +<a id="getCurrentPackageName()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + String + </span> + <span class="sympad">getCurrentPackageName</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Retrieves the name of the last package to report accessibility events.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>String name of package</li></ul> + </div> + + </div> +</div> + + +<a id="getDisplayHeight()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + int + </span> + <span class="sympad">getDisplayHeight</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Gets the height of the display, in pixels. The size is adjusted based + on the current orientation of the display.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>height in pixels or zero on failure</li></ul> + </div> + + </div> +</div> + + +<a id="getDisplayRotation()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + int + </span> + <span class="sympad">getDisplayRotation</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Returns the current rotation of the display, as defined in Surface@return</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="getDisplayWidth()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + int + </span> + <span class="sympad">getDisplayWidth</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Gets the width of the display, in pixels. The width and height details + are reported based on the current orientation of the display.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>width in pixels or zero on failure</li></ul> + </div> + + </div> +</div> + + +<a id="getInstance()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + static + + + + <a href="UiDevice.html">UiDevice</a> + </span> + <span class="sympad">getInstance</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Retrieves a singleton instance of UiDevice</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiDevice instance</li></ul> + </div> + + </div> +</div> + + +<a id="getLastTraversedText()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + String + </span> + <span class="sympad">getLastTraversedText</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Retrieves the text from the last UI traversal event received. + + You can use this method to read the contents in a WebView container + because the accessibility framework fires events + as each text is highlighted. You can write a test to perform + directional arrow presses to focus on different elements inside a WebView, + and call this method to get the text from each traversed element. + If you are testing a view container that can return a reference to a + Document Object Model (DOM) object, your test should use the view's + DOM instead.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>text of the last traversal event, else return an empty string</li></ul> + </div> + + </div> +</div> + + +<a id="getProductName()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + String + </span> + <span class="sympad">getProductName</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Retrieves the product name of the device. + + This method provides information on what type of device the test is running on. This value is + the same as returned by invoking #adb shell getprop ro.product.name.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>product name of the device</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="hasAnyWatcherTriggered()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">hasAnyWatcherTriggered</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Checks if any registered <code><a href="UiWatcher.html">UiWatcher</a></code> have triggered. + + See <code><a href="#registerWatcher(java.lang.String, com.android.uiautomator.core.UiWatcher)">registerWatcher(String, UiWatcher)</a></code> + See <code><a href="#hasWatcherTriggered(java.lang.String)">hasWatcherTriggered(String)</a></code></p></div> + + </div> +</div> + + +<a id="hasWatcherTriggered(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">hasWatcherTriggered</span> + <span class="normal">(String watcherName)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Checks if a specific registered <code><a href="UiWatcher.html">UiWatcher</a></code> has triggered. + See <code><a href="#registerWatcher(java.lang.String, com.android.uiautomator.core.UiWatcher)">registerWatcher(String, UiWatcher)</a></code>. If a UiWatcher runs and its + <code><a href="UiWatcher.html#checkForCondition()">checkForCondition()</a></code> call returned <code>true</code>, then + the UiWatcher is considered triggered. This is helpful if a watcher is detecting errors + from ANR or crash dialogs and the test needs to know if a UiWatcher has been triggered.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if triggered else false</li></ul> + </div> + + </div> +</div> + + +<a id="isNaturalOrientation()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isNaturalOrientation</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the device is in its natural orientation. This is determined by checking if the + orientation is at 0 or 180 degrees.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is in natural orientation</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="isScreenOn()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isScreenOn</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Checks the power manager if the screen is ON.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if the screen is ON else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>RemoteException</td> + </tr> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="pressBack()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressBack</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the BACK button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressDPadCenter()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressDPadCenter</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the CENTER button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressDPadDown()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressDPadDown</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the DOWN button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressDPadLeft()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressDPadLeft</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the LEFT button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressDPadRight()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressDPadRight</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the RIGHT button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressDPadUp()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressDPadUp</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the UP button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressDelete()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressDelete</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the DELETE key.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressEnter()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressEnter</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the ENTER key.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressHome()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressHome</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the HOME button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressKeyCode(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressKeyCode</span> + <span class="normal">(int keyCode)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press using a key code. + + See KeyEvent</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressKeyCode(int, int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressKeyCode</span> + <span class="normal">(int keyCode, int metaState)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press using a key code. + + See KeyEvent.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>keyCode</th> + <td>the key code of the event.</td> + </tr> + <tr> + <th>metaState</th> + <td>an integer in which each bit set to 1 represents a pressed meta key</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressMenu()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressMenu</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the MENU button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressRecentApps()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressRecentApps</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the Recent Apps button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>RemoteException</td> + </tr> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="pressSearch()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressSearch</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the SEARCH button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="registerWatcher(java.lang.String, com.android.uiautomator.core.UiWatcher)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">registerWatcher</span> + <span class="normal">(String name, <a href="UiWatcher.html">UiWatcher</a> watcher)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Registers a <code><a href="UiWatcher.html">UiWatcher</a></code> to run automatically when the testing framework is unable to + find a match using a <code><a href="UiSelector.html">UiSelector</a></code>. See <code><a href="#runWatchers()">runWatchers()</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>name</th> + <td>to register the UiWatcher</td> + </tr> + <tr> + <th>watcher</th> + <td><code><a href="UiWatcher.html">UiWatcher</a></code></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="removeWatcher(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">removeWatcher</span> + <span class="normal">(String name)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Removes a previously registered <code><a href="UiWatcher.html">UiWatcher</a></code>. + + See <code><a href="#registerWatcher(java.lang.String, com.android.uiautomator.core.UiWatcher)">registerWatcher(String, UiWatcher)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>name</th> + <td>used to register the UiWatcher</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>UiAutomationException</td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="resetWatcherTriggers()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">resetWatcherTriggers</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Resets a <code><a href="UiWatcher.html">UiWatcher</a></code> that has been triggered. + If a UiWatcher runs and its <code><a href="UiWatcher.html#checkForCondition()">checkForCondition()</a></code> call + returned <code>true</code>, then the UiWatcher is considered triggered. + See <code><a href="#registerWatcher(java.lang.String, com.android.uiautomator.core.UiWatcher)">registerWatcher(String, UiWatcher)</a></code></p></div> + + </div> +</div> + + +<a id="runWatchers()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">runWatchers</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>This method forces all registered watchers to run. + See <code><a href="#registerWatcher(java.lang.String, com.android.uiautomator.core.UiWatcher)">registerWatcher(String, UiWatcher)</a></code></p></div> + + </div> +</div> + + +<a id="setOrientationLeft()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">setOrientationLeft</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates orienting the device to the left and also freezes rotation + by disabling the sensors. + + If you want to un-freeze the rotation and re-enable the sensors + see <code><a href="#unfreezeRotation()">unfreezeRotation()</a></code>.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>RemoteException</td> + </tr> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="setOrientationNatural()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">setOrientationNatural</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates orienting the device into its natural orientation and also freezes rotation + by disabling the sensors. + + If you want to un-freeze the rotation and re-enable the sensors + see <code><a href="#unfreezeRotation()">unfreezeRotation()</a></code>.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>RemoteException</td> + </tr> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="setOrientationRight()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">setOrientationRight</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates orienting the device to the right and also freezes rotation + by disabling the sensors. + + If you want to un-freeze the rotation and re-enable the sensors + see <code><a href="#unfreezeRotation()">unfreezeRotation()</a></code>.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>RemoteException</td> + </tr> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="sleep()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">sleep</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>This method simply presses the power button if the screen is ON else + it does nothing if the screen is already OFF.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>RemoteException</td> + </tr> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="swipe(android.graphics.Point[], int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">swipe</span> + <span class="normal">(Point[] segments, int segmentSteps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Performs a swipe between points in the Point array. Each step execution is throttled + to 5ms per step. So for a 100 steps, the swipe will take about 1/2 second to complete</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>segments</th> + <td>is Point array containing at least one Point object</td> + </tr> + <tr> + <th>segmentSteps</th> + <td>steps to inject between two Points</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on success</li></ul> + </div> + + </div> +</div> + + +<a id="swipe(int, int, int, int, int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">swipe</span> + <span class="normal">(int startX, int startY, int endX, int endY, int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Performs a swipe from one coordinate to another using the number of steps + to determine smoothness and speed. Each step execution is throttled to 5ms + per step. So for a 100 steps, the swipe will take about 1/2 second to complete.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>is the number of move steps sent to the system</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>false if the operation fails or the coordinates are invalid</li></ul> + </div> + + </div> +</div> + + +<a id="takeScreenshot(java.io.File, float, int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">takeScreenshot</span> + <span class="normal">(File storePath, float scale, int quality)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Take a screenshot of current window and store it as PNG + + The screenshot is adjusted per screen rotation</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>storePath</th> + <td>where the PNG should be written to</td> + </tr> + <tr> + <th>scale</th> + <td>scale the screenshot down if needed; 1.0f for original size</td> + </tr> + <tr> + <th>quality</th> + <td>quality of the PNG compression; range: 0-100</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if screen shot is created successfully, false otherwise</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="takeScreenshot(java.io.File)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">takeScreenshot</span> + <span class="normal">(File storePath)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>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</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>storePath</th> + <td>where the PNG should be written to</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if screen shot is created successfully, false otherwise</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="unfreezeRotation()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">unfreezeRotation</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Re-enables the sensors and un-freezes the device rotation allowing its contents + to rotate with the device physical rotation. During a test execution, it is best to + keep the device frozen in a specific orientation until the test case execution has completed.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="waitForIdle(long)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">waitForIdle</span> + <span class="normal">(long time)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Waits for the current application to idle.</p></div> + + </div> +</div> + + +<a id="waitForIdle()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">waitForIdle</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Waits for the current application to idle. + Default wait timeout is 10 seconds</p></div> + + </div> +</div> + + +<a id="waitForWindowUpdate(java.lang.String, long)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">waitForWindowUpdate</span> + <span class="normal">(String packageName, long timeout)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Waits for a window content update event to occur. + + If a package name for the window is specified, but the current window + does not have the same package name, the function returns immediately.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>packageName</th> + <td>the specified window package name (can be <code>null</code>). + If <code>null</code>, a window update from any front-end window will end the wait</td> + </tr> + <tr> + <th>timeout</th> + <td>the timeout for the wait</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if a window update occurred, false if timeout has elapsed or if the current + window does not have the specified package name</li></ul> + </div> + + </div> +</div> + + +<a id="wakeUp()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">wakeUp</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>This method simulates pressing the power button if the screen is OFF else + it does nothing if the screen is already ON. + + If the screen was OFF and it just got turned ON, this method will insert a 500ms delay + to allow the device time to wake up and accept input.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>RemoteException</td> + </tr> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + + + + +<!-- ========= METHOD DETAIL ======== --> + + + +<!-- ========= END OF CLASS DATA ========= --> + diff --git a/docs/html/tools/help/uiautomator/UiObject.jd b/docs/html/tools/help/uiautomator/UiObject.jd new file mode 100644 index 0000000..a22df50 --- /dev/null +++ b/docs/html/tools/help/uiautomator/UiObject.jd @@ -0,0 +1,2687 @@ +page.title=UiObject +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> +<p>A UiObject is a representation of a user interface (UI) element. It is not in any way directly bound to a + UI element as an object reference. A UiObject holds information to help it + locate a matching UI element at runtime based on the <code><a href="UiSelector.html">UiSelector</a></code> properties specified in + its constructor. Since a UiObject is a representative for a UI element, it can + be reused for different views with matching UI elements. +</p> + + + + + + + + + + + + + + + + + +<div class="jd-descr"> + + +<h2>Summary</h2> + + + + + + + + + + + + + + + + + + + + + + + +<!-- ======== CONSTRUCTOR SUMMARY ======== --> +<table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#UiObject(com.android.uiautomator.core.UiSelector)">UiObject</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Constructs a UiObject to represent a specific UI element matched by the specified + <code><a href="UiSelector.html">UiSelector</a></code> selector properties.</div> + + </td></tr> + + + +</table> + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#clearTextField()">clearTextField</a></span>() + + <div class="jd-descrdiv">Clears the existing text contents in an editable field.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#click()">click</a></span>() + + <div class="jd-descrdiv">Performs a click at the center of the visible bounds of the UI element represented + by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#clickAndWaitForNewWindow(long)">clickAndWaitForNewWindow</a></span>(long timeout) + + <div class="jd-descrdiv">Performs a click at the center of the visible bounds of the UI element represented + by this UiObject and waits for window transitions.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#clickAndWaitForNewWindow()">clickAndWaitForNewWindow</a></span>() + + <div class="jd-descrdiv">See <code><a href="#clickAndWaitForNewWindow(long)">clickAndWaitForNewWindow(long)</a></code> + This method is intended to reliably wait for window transitions that would typically take + longer than the usual default timeouts.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#clickBottomRight()">clickBottomRight</a></span>() + + <div class="jd-descrdiv">Clicks the bottom and right corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#clickTopLeft()">clickTopLeft</a></span>() + + <div class="jd-descrdiv">Clicks the top and left corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#exists()">exists</a></span>() + + <div class="jd-descrdiv">Check if UI element exists.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + Rect + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getBounds()">getBounds</a></span>() + + <div class="jd-descrdiv">Returns the UI element's <code>bounds</code> property.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChild(com.android.uiautomator.core.UiSelector)">getChild</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Creates a new UiObject representing a child UI element of the element currently represented + by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildCount()">getChildCount</a></span>() + + <div class="jd-descrdiv">Counts the child UI elements immediately under the UI element currently represented by + this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getContentDescription()">getContentDescription</a></span>() + + <div class="jd-descrdiv">Reads the <code>content_desc</code> property of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getFromParent(com.android.uiautomator.core.UiSelector)">getFromParent</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Creates a new UiObject representing a child UI element from the parent element currently + represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getPackageName()">getPackageName</a></span>() + + <div class="jd-descrdiv">Reads the UI element's <code>package</code> property</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getSelector()">getSelector</a></span>() + + <div class="jd-descrdiv">Debugging helper.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getText()">getText</a></span>() + + <div class="jd-descrdiv">Reads the <code>text</code> property of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + Rect + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getVisibleBounds()">getVisibleBounds</a></span>() + + <div class="jd-descrdiv">Returns the visible bounds of the UI element.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isCheckable()">isCheckable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>checkable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isChecked()">isChecked</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>checked</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isClickable()">isClickable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>clickable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isEnabled()">isEnabled</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>enabled</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isFocusable()">isFocusable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>focusable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isFocused()">isFocused</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>focused</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isLongClickable()">isLongClickable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>long-clickable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isScrollable()">isScrollable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>scrollable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isSelected()">isSelected</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>selected</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#longClick()">longClick</a></span>() + + <div class="jd-descrdiv">Long clicks the center of the visible bounds of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#longClickBottomRight()">longClickBottomRight</a></span>() + + <div class="jd-descrdiv">Long clicks bottom and right corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#longClickTopLeft()">longClickTopLeft</a></span>() + + <div class="jd-descrdiv">Long clicks on the top and left corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#setText(java.lang.String)">setText</a></span>(String text) + + <div class="jd-descrdiv">Sets the text in an editable field, after clearing the field's content.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#swipeDown(int)">swipeDown</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object, Also see + #scrollToBeginning(int), #scrollToEnd(int), #scrollBackward(), + #scrollForward().</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#swipeLeft(int)">swipeLeft</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#swipeRight(int)">swipeRight</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#swipeUp(int)">swipeUp</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#waitForExists(long)">waitForExists</a></span>(long timeout) + + <div class="jd-descrdiv">Waits a specified length of time for a UI element to become visible.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#waitUntilGone(long)">waitUntilGone</a></span>(long timeout) + + <div class="jd-descrdiv">Waits a specified length of time for a UI element to become undetectable.</div> + + </td></tr> + + + +</table> + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="inhmethods" class="jd-sumtable"><tr><th> + <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a> + <div style="clear:left;">Inherited Methods</div></th></tr> + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" + ><img id="inherited-methods-java.lang.Object-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + java.lang.Object + +<div id="inherited-methods-java.lang.Object"> + <div id="inherited-methods-java.lang.Object-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">equals</span>(Object arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + Class<?> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getClass</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">hashCode</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notify</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notifyAll</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0, int arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + +</table> + + +</div><!-- jd-descr (summary) --> + +<!-- Details --> + + + + + + + + +<!-- XML Attributes --> + + +<!-- Enum Values --> + + +<!-- Constants --> + + +<!-- Fields --> + + +<!-- Public ctors --> + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<h2>Public Constructors</h2> + + + +<a id="UiObject(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + + </span> + <span class="sympad">UiObject</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> selector)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Constructs a UiObject to represent a specific UI element matched by the specified + <code><a href="UiSelector.html">UiSelector</a></code> selector properties.</p></div> + + </div> +</div> + + + + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<!-- Protected ctors --> + + + +<!-- ========= METHOD DETAIL ======== --> +<!-- Public methdos --> + +<h2>Public Methods</h2> + + + +<a id="clearTextField()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">clearTextField</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Clears the existing text contents in an editable field. + + The <code><a href="UiSelector.html">UiSelector</a></code> of this object must reference a UI element that is editable. + + When you call this method, the method first sets focus at the start edge of the field. + The method then simulates a long-press to select the existing text, and deletes the + selected text. + + If a "Select-All" option is displayed, the method will automatically attempt to use it + to ensure full text selection. + + Note that it is possible that not all the text in the field is selected; for example, + if the text contains separators such as spaces, slashes, at symbol etc. + Also, not all editable fields support the long-press functionality.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="click()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">click</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Performs a click at the center of the visible bounds of the UI element represented + by this UiObject.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true id successful else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="clickAndWaitForNewWindow(long)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">clickAndWaitForNewWindow</span> + <span class="normal">(long timeout)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Performs a click at the center of the visible bounds of the UI element represented + by this UiObject and waits for window transitions. + + This method differ from <code><a href="#click()">click()</a></code> only in that this method waits for a + a new window transition as a result of the click. Some examples of a window transition: + <li>launching a new activity</li> + <li>bringing up a pop-up menu</li> + <li>bringing up a dialog</li></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>timeout</th> + <td>timeout before giving up on waiting for a new window</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if the event was triggered, else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="clickAndWaitForNewWindow()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">clickAndWaitForNewWindow</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See <code><a href="#clickAndWaitForNewWindow(long)">clickAndWaitForNewWindow(long)</a></code> + This method is intended to reliably wait for window transitions that would typically take + longer than the usual default timeouts.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if the event was triggered, else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="clickBottomRight()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">clickBottomRight</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Clicks the bottom and right corner of the UI element</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on success</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th>Exception</td> + <td></td> + </tr> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="clickTopLeft()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">clickTopLeft</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Clicks the top and left corner of the UI element</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on success</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th>Exception</td> + <td></td> + </tr> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="exists()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">exists</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if UI element exists. + + This methods performs a <code><a href="#waitForExists(long)">waitForExists(long)</a></code> with zero timeout. This + basically returns immediately whether the UI element represented by this UiObject + exists or not. If you need to wait longer for this UI element, then see + <code><a href="#waitForExists(long)">waitForExists(long)</a></code>.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if the UI element represented by this UiObject does exist +</li></ul> + </div> + + </div> +</div> + + +<a id="getBounds()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + Rect + </span> + <span class="sympad">getBounds</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Returns the UI element's <code>bounds</code> property. See <code><a href="#getVisibleBounds()">getVisibleBounds()</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>Rect</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + </div> +</div> + + +<a id="getChild(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChild</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> selector)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Creates a new UiObject representing a child UI element of the element currently represented + by this UiObject.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>selector</th> + <td>for UI element to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>a new UiObject representing the matched UI element +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildCount()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + int + </span> + <span class="sympad">getChildCount</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Counts the child UI elements immediately under the UI element currently represented by + this UiObject.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>the count of child UI elements.</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getContentDescription()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + String + </span> + <span class="sympad">getContentDescription</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Reads the <code>content_desc</code> property of the UI element</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>value of node attribute "content_desc"</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getFromParent(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getFromParent</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> selector)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Creates a new UiObject representing a child UI element from the parent element currently + represented by this object. Essentially this is starting the search from the parent + element and can also be used to find sibling UI elements to the one currently represented + by this UiObject.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>selector</th> + <td>for the UI element to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>a new UiObject representing the matched UI element</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getPackageName()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + String + </span> + <span class="sympad">getPackageName</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Reads the UI element's <code>package</code> property</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getSelector()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + final + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">getSelector</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Debugging helper. A test can dump the properties of a selector as a string + to its logs if needed. <code>getSelector().toString();</code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiSelector.html">UiSelector</a></code> +</li></ul> + </div> + + </div> +</div> + + +<a id="getText()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + String + </span> + <span class="sympad">getText</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Reads the <code>text</code> property of the UI element</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>text value of the current node represented by this UiObject</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td>if no match could be found +</td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getVisibleBounds()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + Rect + </span> + <span class="sympad">getVisibleBounds</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Returns the visible bounds of the UI element. + + If a portion of the UI element is visible, only the bounds of the visible portion are + reported.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>Rect</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>UiObjectNotFoundException</td> + </tr> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="isCheckable()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isCheckable</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>checkable</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="isChecked()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isChecked</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>checked</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="isClickable()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isClickable</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>clickable</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="isEnabled()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isEnabled</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>enabled</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="isFocusable()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isFocusable</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>focusable</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="isFocused()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isFocused</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>focused</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="isLongClickable()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isLongClickable</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>long-clickable</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="isScrollable()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isScrollable</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>scrollable</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="isSelected()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isSelected</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>selected</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="longClick()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">longClick</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Long clicks the center of the visible bounds of the UI element</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if operation was successful</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="longClickBottomRight()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">longClickBottomRight</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Long clicks bottom and right corner of the UI element</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if operation was successful</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="longClickTopLeft()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">longClickTopLeft</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Long clicks on the top and left corner of the UI element</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if operation was successful</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="setText(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">setText</span> + <span class="normal">(String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Sets the text in an editable field, after clearing the field's content. + + The <code><a href="UiSelector.html">UiSelector</a></code> selector of this object must reference a UI element that is editable. + + When you call this method, the method first simulates a <code><a href="#click()">click()</a></code> on + editable field to set focus. The method then clears the field's contents + and injects your specified text into the field. + + If you want to capture the original contents of the field, call <code><a href="#getText()">getText()</a></code> first. + You can then modify the text and use this method to update the field.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>text</th> + <td>string to set</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if operation is successful</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="swipeDown(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">swipeDown</span> + <span class="normal">(int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Perform the action on the UI element that is represented by this object, Also see + #scrollToBeginning(int), #scrollToEnd(int), #scrollBackward(), + #scrollForward(). This method will perform the swipe gesture over any + surface. The targeted UI element does not need to have the attribute + <code>scrollable</code> set to <code>true</code> for this operation to be performed.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>indicates the number of injected move steps into the system. Steps are + injected about 5ms apart. So a 100 steps may take about 1/2 second to complete.</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="swipeLeft(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">swipeLeft</span> + <span class="normal">(int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Perform the action on the UI element that is represented by this object. Also see + #scrollToBeginning(int), #scrollToEnd(int), #scrollBackward(), + #scrollForward(). This method will perform the swipe gesture over any + surface. The targeted UI element does not need to have the attribute + <code>scrollable</code> set to <code>true</code> for this operation to be performed.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>indicates the number of injected move steps into the system. Steps are + injected about 5ms apart. So a 100 steps may take about 1/2 second to complete.</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="swipeRight(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">swipeRight</span> + <span class="normal">(int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Perform the action on the UI element that is represented by this object. Also see + #scrollToBeginning(int), #scrollToEnd(int), #scrollBackward(), + #scrollForward(). This method will perform the swipe gesture over any + surface. The targeted UI element does not need to have the attribute + <code>scrollable</code> set to <code>true</code> for this operation to be performed.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>indicates the number of injected move steps into the system. Steps are + injected about 5ms apart. So a 100 steps may take about 1/2 second to complete.</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="swipeUp(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">swipeUp</span> + <span class="normal">(int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Perform the action on the UI element that is represented by this UiObject. Also see + #scrollToBeginning(int), #scrollToEnd(int), #scrollBackward(), + #scrollForward().</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>indicates the number of injected move steps into the system. Steps are + injected about 5ms apart. So a 100 steps may take about 1/2 second to complete.</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true of successful</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="waitForExists(long)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">waitForExists</span> + <span class="normal">(long timeout)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Waits a specified length of time for a UI element to become visible. + + This method waits until the UI element becomes visible on the display, or + until the timeout has elapsed. You can use this method in situations where + the content that you want to select is not immediately displayed.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>timeout</th> + <td>the amount of time to wait (in milliseconds)</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if the UI element is displayed, else false if timeout elapsed while waiting +</li></ul> + </div> + + </div> +</div> + + +<a id="waitUntilGone(long)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">waitUntilGone</span> + <span class="normal">(long timeout)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Waits a specified length of time for a UI element to become undetectable. + + This method waits until a UI element is no longer matchable, or until the + timeout has elapsed. + + A UI element becomes undetectable when the <code><a href="UiSelector.html">UiSelector</a></code> of the object is + unable to find a match because the element has either changed its state or is no + longer displayed. + + You can use this method when attempting to wait for some long operation + to compete, such as downloading a large file or connecting to a remote server.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>timeout</th> + <td>time to wait (in milliseconds)</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if the element is gone before timeout elapsed, else false if timeout elapsed + but a matching element is still found. +</li></ul> + </div> + + </div> +</div> + diff --git a/docs/html/tools/help/uiautomator/UiObjectNotFoundException.jd b/docs/html/tools/help/uiautomator/UiObjectNotFoundException.jd new file mode 100644 index 0000000..02c607d --- /dev/null +++ b/docs/html/tools/help/uiautomator/UiObjectNotFoundException.jd @@ -0,0 +1,630 @@ +page.title=UiObjectNotFoundException +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> +<p>Generated in test runs when a <code><a href="UiSelector.html">UiSelector</a></code> selector could not be matched + to any UI element displayed. +</p> + + + + + + + + + + + + + + + + + + + + + +<div class="jd-descr"> + + +<h2>Summary</h2> + + + + + + + + + + + + + + + + + + + + + + + +<!-- ======== CONSTRUCTOR SUMMARY ======== --> +<table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#UiObjectNotFoundException(java.lang.String)">UiObjectNotFoundException</a></span>(String msg) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#UiObjectNotFoundException(java.lang.String, java.lang.Throwable)">UiObjectNotFoundException</a></span>(String detailMessage, Throwable throwable) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#UiObjectNotFoundException(java.lang.Throwable)">UiObjectNotFoundException</a></span>(Throwable throwable) + + </td></tr> + + + +</table> + + + + + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="inhmethods" class="jd-sumtable"><tr><th> + <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a> + <div style="clear:left;">Inherited Methods</div></th></tr> + + + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Throwable" class="jd-expando-trigger closed" + ><img id="inherited-methods-java.lang.Throwable-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + java.lang.Throwable + +<div id="inherited-methods-java.lang.Throwable"> + <div id="inherited-methods-java.lang.Throwable-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-java.lang.Throwable-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + synchronized + + + + Throwable + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">fillInStackTrace</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + Throwable + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getCause</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getLocalizedMessage</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getMessage</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + StackTraceElement[] + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getStackTrace</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + synchronized + + + + Throwable + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">initCause</span>(Throwable arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">printStackTrace</span>(PrintWriter arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">printStackTrace</span>(PrintStream arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">printStackTrace</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">setStackTrace</span>(StackTraceElement[] arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" + ><img id="inherited-methods-java.lang.Object-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + java.lang.Object + +<div id="inherited-methods-java.lang.Object"> + <div id="inherited-methods-java.lang.Object-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">equals</span>(Object arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + Class<?> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getClass</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">hashCode</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notify</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notifyAll</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0, int arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + + + +</table> + + +</div><!-- jd-descr (summary) --> + +<!-- Details --> + + + + + + + + +<!-- XML Attributes --> + + +<!-- Enum Values --> + + +<!-- Constants --> + + +<!-- Fields --> + + +<!-- Public ctors --> + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<h2>Public Constructors</h2> + + + +<a id="UiObjectNotFoundException(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + + </span> + <span class="sympad">UiObjectNotFoundException</span> + <span class="normal">(String msg)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p></p></div> + + </div> +</div> + + +<a id="UiObjectNotFoundException(java.lang.String, java.lang.Throwable)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + + </span> + <span class="sympad">UiObjectNotFoundException</span> + <span class="normal">(String detailMessage, Throwable throwable)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p></p></div> + + </div> +</div> + + +<a id="UiObjectNotFoundException(java.lang.Throwable)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + + </span> + <span class="sympad">UiObjectNotFoundException</span> + <span class="normal">(Throwable throwable)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p></p></div> + + </div> +</div> diff --git a/docs/html/tools/help/uiautomator/UiScrollable.jd b/docs/html/tools/help/uiautomator/UiScrollable.jd new file mode 100644 index 0000000..33566a2 --- /dev/null +++ b/docs/html/tools/help/uiautomator/UiScrollable.jd @@ -0,0 +1,2914 @@ +page.title=UiScrollable +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> +<p>UiScrollable is a <code><a href="UiCollection.html">UiCollection</a></code> and provides support for searching for items in a + scrollable user interface (UI) elements. This class can be used with horizontally or vertically scrollable controls.. +</p> + + + + + + + + + + + + + + + + + + + + + +<div class="jd-descr"> + + +<h2>Summary</h2> + + + + + + + + + + + + + + + + + + + + + + + +<!-- ======== CONSTRUCTOR SUMMARY ======== --> +<table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#UiScrollable(com.android.uiautomator.core.UiSelector)">UiScrollable</a></span>(<a href="UiSelector.html">UiSelector</a> container) + + <div class="jd-descrdiv">UiScrollable is a <code><a href="UiCollection.html">UiCollection</a></code> and as such requires a <code><a href="UiSelector.html">UiSelector</a></code> to + identify the container UI element of the scrollable collection.</div> + + </td></tr> + + + +</table> + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#flingBackward()">flingBackward</a></span>() + + <div class="jd-descrdiv">See <code><a href="#scrollBackward(int)">scrollBackward(int)</a></code></div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#flingForward()">flingForward</a></span>() + + <div class="jd-descrdiv">A convenience version of <code><a href="#scrollForward(int)">scrollForward(int)</a></code>, performs a fling</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#flingToBeginning(int)">flingToBeginning</a></span>(int maxSwipes) + + <div class="jd-descrdiv">See <code><a href="#scrollToBeginning(int, int)">scrollToBeginning(int, int)</a></code></div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#flingToEnd(int)">flingToEnd</a></span>(int maxSwipes) + + <div class="jd-descrdiv">See <code><a href="#scrollToEnd(int, int)">scrollToEnd(int, int)</a></code></div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String, boolean)">getChildByDescription</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, String text, boolean allowScrollSearch) + + <div class="jd-descrdiv">See <code><a href="#getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByDescription(UiSelector, String)</a></code></div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByDescription</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, String text) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this UiScrollable <code><a href="UiSelector.html">UiSelector</a></code> + container.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildByInstance(com.android.uiautomator.core.UiSelector, int)">getChildByInstance</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, int instance) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this UiScrollable <code><a href="UiSelector.html">UiSelector</a></code> + selector.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String, boolean)">getChildByText</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, String text, boolean allowScrollSearch) + + <div class="jd-descrdiv">See <code><a href="#getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByText(UiSelector, String)</a></code></div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByText</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, String text) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this UiScrollable <code><a href="UiSelector.html">UiSelector</a></code> + container.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getMaxSearchSwipes()">getMaxSearchSwipes</a></span>() + + <div class="jd-descrdiv">#getChildByDescription(String, boolean) and #getChildByText(String, boolean) + use an arguments that specifies if scrolling is allowed while searching for the UI element.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + double + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getSwipeDeadZonePercentage()">getSwipeDeadZonePercentage</a></span>() + + <div class="jd-descrdiv">Returns the percentage of a widget's size that's considered as a no touch zone when swiping.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollBackward(int)">scrollBackward</a></span>(int steps) + + <div class="jd-descrdiv">Perform a scroll backward.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollBackward()">scrollBackward</a></span>() + + <div class="jd-descrdiv">See <code><a href="#scrollBackward(int)">scrollBackward(int)</a></code></div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollDescriptionIntoView(java.lang.String)">scrollDescriptionIntoView</a></span>(String text) + + <div class="jd-descrdiv">Performs a swipe Up on the UI element until the requested content-description + is visible or until swipe attempts have been exhausted.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollForward()">scrollForward</a></span>() + + <div class="jd-descrdiv">A convenience version of <code><a href="#scrollForward(int)">scrollForward(int)</a></code>, performs a regular scroll</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollForward(int)">scrollForward</a></span>(int steps) + + <div class="jd-descrdiv">Perform a scroll forward.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollIntoView(com.android.uiautomator.core.UiSelector)">scrollIntoView</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Perform a scroll search for a UI element matching the <code><a href="UiSelector.html">UiSelector</a></code> selector argument.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollTextIntoView(java.lang.String)">scrollTextIntoView</a></span>(String text) + + <div class="jd-descrdiv">Performs a swipe up on the UI element until the requested text is visible + or until swipe attempts have been exhausted.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollToBeginning(int)">scrollToBeginning</a></span>(int maxSwipes) + + <div class="jd-descrdiv">See <code><a href="#scrollToBeginning(int, int)">scrollToBeginning(int, int)</a></code></div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollToBeginning(int, int)">scrollToBeginning</a></span>(int maxSwipes, int steps) + + <div class="jd-descrdiv">Scrolls to the beginning of a scrollable UI element.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollToEnd(int, int)">scrollToEnd</a></span>(int maxSwipes, int steps) + + <div class="jd-descrdiv">Scrolls to the end of a scrollable UI element.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollToEnd(int)">scrollToEnd</a></span>(int maxSwipes) + + <div class="jd-descrdiv">See {@link UiScrollable#scrollToEnd(int, int)</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#setAsHorizontalList()">setAsHorizontalList</a></span>() + + <div class="jd-descrdiv">Set the direction of swipes when performing scroll search +</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#setAsVerticalList()">setAsVerticalList</a></span>() + + <div class="jd-descrdiv">Set the direction of swipes when performing scroll search +</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#setMaxSearchSwipes(int)">setMaxSearchSwipes</a></span>(int swipes) + + <div class="jd-descrdiv">#getChildByDescription(String, boolean) and #getChildByText(String, boolean) + use an arguments that specifies if scrolling is allowed while searching for the UI element.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#setSwipeDeadZonePercentage(double)">setSwipeDeadZonePercentage</a></span>(double swipeDeadZonePercentage) + + <div class="jd-descrdiv">Sets the percentage of a widget's size that's considered as a no touch zone when swiping.</div> + + </td></tr> + + + +</table> + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="inhmethods" class="jd-sumtable"><tr><th> + <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a> + <div style="clear:left;">Inherited Methods</div></th></tr> + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-com.android.uiautomator.core.UiCollection" class="jd-expando-trigger closed" + ><img id="inherited-methods-com.android.uiautomator.core.UiCollection-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + <a href="UiCollection.html">com.android.uiautomator.core.UiCollection</a> + +<div id="inherited-methods-com.android.uiautomator.core.UiCollection"> + <div id="inherited-methods-com.android.uiautomator.core.UiCollection-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-com.android.uiautomator.core.UiCollection-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiCollection.html#getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByDescription</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, String text) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this UiCollection <code><a href="UiSelector.html">UiSelector</a></code> + selector.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiCollection.html#getChildByInstance(com.android.uiautomator.core.UiSelector, int)">getChildByInstance</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, int instance) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this UiCollection <code><a href="UiSelector.html">UiSelector</a></code> + selector.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiCollection.html#getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByText</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, String text) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this UiCollection <code><a href="UiSelector.html">UiSelector</a></code> + selector.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiCollection.html#getChildCount(com.android.uiautomator.core.UiSelector)">getChildCount</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern) + + <div class="jd-descrdiv">Counts child UI element instances matching the <code>childPattern</code> + argument.</div> + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-com.android.uiautomator.core.UiObject" class="jd-expando-trigger closed" + ><img id="inherited-methods-com.android.uiautomator.core.UiObject-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + <a href="UiObject.html">com.android.uiautomator.core.UiObject</a> + +<div id="inherited-methods-com.android.uiautomator.core.UiObject"> + <div id="inherited-methods-com.android.uiautomator.core.UiObject-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-com.android.uiautomator.core.UiObject-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clearTextField()">clearTextField</a></span>() + + <div class="jd-descrdiv">Clears the existing text contents in an editable field.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#click()">click</a></span>() + + <div class="jd-descrdiv">Performs a click at the center of the visible bounds of the UI element represented + by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clickAndWaitForNewWindow(long)">clickAndWaitForNewWindow</a></span>(long timeout) + + <div class="jd-descrdiv">Performs a click at the center of the visible bounds of the UI element represented + by this UiObject and waits for window transitions.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clickAndWaitForNewWindow()">clickAndWaitForNewWindow</a></span>() + + <div class="jd-descrdiv">See <code><a href="UiObject.html#clickAndWaitForNewWindow(long)">clickAndWaitForNewWindow(long)</a></code> + This method is intended to reliably wait for window transitions that would typically take + longer than the usual default timeouts.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clickBottomRight()">clickBottomRight</a></span>() + + <div class="jd-descrdiv">Clicks the bottom and right corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clickTopLeft()">clickTopLeft</a></span>() + + <div class="jd-descrdiv">Clicks the top and left corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#exists()">exists</a></span>() + + <div class="jd-descrdiv">Check if UI element exists.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + Rect + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getBounds()">getBounds</a></span>() + + <div class="jd-descrdiv">Returns the UI element's <code>bounds</code> property.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getChild(com.android.uiautomator.core.UiSelector)">getChild</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Creates a new UiObject representing a child UI element of the element currently represented + by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getChildCount()">getChildCount</a></span>() + + <div class="jd-descrdiv">Counts the child UI elements immediately under the UI element currently represented by + this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getContentDescription()">getContentDescription</a></span>() + + <div class="jd-descrdiv">Reads the <code>content_desc</code> property of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getFromParent(com.android.uiautomator.core.UiSelector)">getFromParent</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Creates a new UiObject representing a child UI element from the parent element currently + represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getPackageName()">getPackageName</a></span>() + + <div class="jd-descrdiv">Reads the UI element's <code>package</code> property</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getSelector()">getSelector</a></span>() + + <div class="jd-descrdiv">Debugging helper.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getText()">getText</a></span>() + + <div class="jd-descrdiv">Reads the <code>text</code> property of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + Rect + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getVisibleBounds()">getVisibleBounds</a></span>() + + <div class="jd-descrdiv">Returns the visible bounds of the UI element.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isCheckable()">isCheckable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>checkable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isChecked()">isChecked</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>checked</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isClickable()">isClickable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>clickable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isEnabled()">isEnabled</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>enabled</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isFocusable()">isFocusable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>focusable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isFocused()">isFocused</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>focused</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isLongClickable()">isLongClickable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>long-clickable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isScrollable()">isScrollable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>scrollable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isSelected()">isSelected</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>selected</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#longClick()">longClick</a></span>() + + <div class="jd-descrdiv">Long clicks the center of the visible bounds of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#longClickBottomRight()">longClickBottomRight</a></span>() + + <div class="jd-descrdiv">Long clicks bottom and right corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#longClickTopLeft()">longClickTopLeft</a></span>() + + <div class="jd-descrdiv">Long clicks on the top and left corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#setText(java.lang.String)">setText</a></span>(String text) + + <div class="jd-descrdiv">Sets the text in an editable field, after clearing the field's content.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#swipeDown(int)">swipeDown</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object, Also see + #scrollToBeginning(int), #scrollToEnd(int), #scrollBackward(), + #scrollForward().</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#swipeLeft(int)">swipeLeft</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#swipeRight(int)">swipeRight</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#swipeUp(int)">swipeUp</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#waitForExists(long)">waitForExists</a></span>(long timeout) + + <div class="jd-descrdiv">Waits a specified length of time for a UI element to become visible.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#waitUntilGone(long)">waitUntilGone</a></span>(long timeout) + + <div class="jd-descrdiv">Waits a specified length of time for a UI element to become undetectable.</div> + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" + ><img id="inherited-methods-java.lang.Object-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + java.lang.Object + +<div id="inherited-methods-java.lang.Object"> + <div id="inherited-methods-java.lang.Object-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">equals</span>(Object arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + Class<?> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getClass</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">hashCode</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notify</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notifyAll</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0, int arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + +</table> + + +</div><!-- jd-descr (summary) --> + +<!-- Details --> + + + + + + + + +<!-- XML Attributes --> + + +<!-- Enum Values --> + + +<!-- Constants --> + + +<!-- Fields --> + + +<!-- Public ctors --> + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<h2>Public Constructors</h2> + + + +<a id="UiScrollable(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + + </span> + <span class="sympad">UiScrollable</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> container)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>UiScrollable is a <code><a href="UiCollection.html">UiCollection</a></code> and as such requires a <code><a href="UiSelector.html">UiSelector</a></code> to + identify the container UI element of the scrollable collection. Further operations on + the items in the container will require specifying UiSelector as an item selector.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>container</th> + <td>a <code><a href="UiSelector.html">UiSelector</a></code> selector +</td> + </tr> + </table> + </div> + + </div> +</div> + + + + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<!-- Protected ctors --> + + + +<!-- ========= METHOD DETAIL ======== --> +<!-- Public methdos --> + +<h2>Public Methods</h2> + + + +<a id="flingBackward()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">flingBackward</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See <code><a href="#scrollBackward(int)">scrollBackward(int)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if scrolled and false if the control can't scroll anymore +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="flingForward()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">flingForward</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>A convenience version of <code><a href="#scrollForward(int)">scrollForward(int)</a></code>, performs a fling</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if scrolled and false if the control can't scroll anymore +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="flingToBeginning(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">flingToBeginning</span> + <span class="normal">(int maxSwipes)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See <code><a href="#scrollToBeginning(int, int)">scrollToBeginning(int, int)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on scrolled else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="flingToEnd(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">flingToEnd</span> + <span class="normal">(int maxSwipes)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See <code><a href="#scrollToEnd(int, int)">scrollToEnd(int, int)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on scrolled else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String, boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChildByDescription</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, String text, boolean allowScrollSearch)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See <code><a href="#getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByDescription(UiSelector, String)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> + </tr> + <tr> + <th>text</th> + <td>String may be a partial match for the content-description of a child element.</td> + </tr> + <tr> + <th>allowScrollSearch</th> + <td>set to true if scrolling is allowed</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code></li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChildByDescription</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Searches for child UI element within the constraints of this UiScrollable <code><a href="UiSelector.html">UiSelector</a></code> + container. It looks for any child matching the <code>childPattern</code> argument within its + hierarchy with a matching content-description text. The returned UiObject will represent the + UI element matching the <code>childPattern</code> and not the sub element that matched the + content description.</p> + By default this operation will perform scroll search while attempting to find the UI element + See <code><a href="#getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String, boolean)">getChildByDescription(UiSelector, String, boolean)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> + </tr> + <tr> + <th>text</th> + <td>String of the identifying child contents of of the <code>childPattern</code></td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code></li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildByInstance(com.android.uiautomator.core.UiSelector, int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChildByInstance</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, int instance)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Searches for child UI element within the constraints of this UiScrollable <code><a href="UiSelector.html">UiSelector</a></code> + selector. It looks for any child matching the <code>childPattern</code> argument and + return the <code>instance</code> specified. The operation is performed only on the visible + items and no scrolling is performed in this case.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> + </tr> + <tr> + <th>instance</th> + <td>int the desired matched instance of this <code>childPattern</code></td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code> +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String, boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChildByText</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, String text, boolean allowScrollSearch)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See <code><a href="#getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByText(UiSelector, String)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> + </tr> + <tr> + <th>text</th> + <td>String of the identifying child contents of of the <code>childPattern</code></td> + </tr> + <tr> + <th>allowScrollSearch</th> + <td>set to true if scrolling is allowed</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code></li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChildByText</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Searches for child UI element within the constraints of this UiScrollable <code><a href="UiSelector.html">UiSelector</a></code> + container. It looks for any child matching the <code>childPattern</code> argument that has + a sub UI element anywhere within its sub hierarchy that has text attribute + <code>text</code>. The returned UiObject will point at the <code>childPattern</code> + instance that matched the search and not at the text matched sub element</p> + By default this operation will perform scroll search while attempting to find the UI + element. + See <code><a href="#getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String, boolean)">getChildByText(UiSelector, String, boolean)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> + </tr> + <tr> + <th>text</th> + <td>String of the identifying child contents of of the <code>childPattern</code></td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code></li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getMaxSearchSwipes()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + int + </span> + <span class="sympad">getMaxSearchSwipes</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>#getChildByDescription(String, boolean) and #getChildByText(String, boolean) + use an arguments that specifies if scrolling is allowed while searching for the UI element. + The number of scrolls currently allowed to perform a search can be read by this method. + See <code><a href="#setMaxSearchSwipes(int)">setMaxSearchSwipes(int)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>max value of the number of swipes currently allowed during a scroll search +</li></ul> + </div> + + </div> +</div> + + +<a id="getSwipeDeadZonePercentage()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + double + </span> + <span class="sympad">getSwipeDeadZonePercentage</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Returns the percentage of a widget's size that's considered as a no touch zone when swiping. + + Dead zones are set as percentage of a widget's total width or height, denoting a margin + around the swipable area of the widget. Swipes must start and + end inside this margin. + + This is important when the widget being swiped may not respond to the swipe if + started at a point too near to the edge. The default is 10% from either edge.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>a value between 0 and 1 +</li></ul> + </div> + + </div> +</div> + + +<a id="scrollBackward(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollBackward</span> + <span class="normal">(int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Perform a scroll backward. If this list is set to vertical (see <code><a href="#setAsVerticalList()">setAsVerticalList()</a></code> + default) then the swipes will be executed from the top to bottom. If this list is set + to horizontal (see <code><a href="#setAsHorizontalList()">setAsHorizontalList()</a></code>) then the swipes will be executed from + the left to right. Caution is required on devices configured with right to left languages + like Arabic and Hebrew.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>use steps to control the speed, so that it may be a scroll, or fling</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if scrolled and false if the control can't scroll anymore +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollBackward()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollBackward</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See <code><a href="#scrollBackward(int)">scrollBackward(int)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if scrolled and false if the control can't scroll anymore +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollDescriptionIntoView(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollDescriptionIntoView</span> + <span class="normal">(String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Performs a swipe Up on the UI element until the requested content-description + is visible or until swipe attempts have been exhausted. See <code><a href="#setMaxSearchSwipes(int)">setMaxSearchSwipes(int)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>text</th> + <td>to look for anywhere within the contents of this scrollable.</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if item us found else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollForward()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollForward</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>A convenience version of <code><a href="#scrollForward(int)">scrollForward(int)</a></code>, performs a regular scroll</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if scrolled and false if the control can't scroll anymore +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollForward(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollForward</span> + <span class="normal">(int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Perform a scroll forward. If this list is set to vertical (see <code><a href="#setAsVerticalList()">setAsVerticalList()</a></code> + default) then the swipes will be executed from the bottom to top. If this list is set + to horizontal (see <code><a href="#setAsHorizontalList()">setAsHorizontalList()</a></code>) then the swipes will be executed from + the right to left. Caution is required on devices configured with right to left languages + like Arabic and Hebrew.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>use steps to control the speed, so that it may be a scroll, or fling</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if scrolled and false if the control can't scroll anymore +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollIntoView(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollIntoView</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> selector)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Perform a scroll search for a UI element matching the <code><a href="UiSelector.html">UiSelector</a></code> selector argument. + See <code><a href="#scrollDescriptionIntoView(java.lang.String)">scrollDescriptionIntoView(String)</a></code> and <code><a href="#scrollTextIntoView(java.lang.String)">scrollTextIntoView(String)</a></code>.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>selector</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if the item was found and now is in view else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollTextIntoView(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollTextIntoView</span> + <span class="normal">(String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Performs a swipe up on the UI element until the requested text is visible + or until swipe attempts have been exhausted. See <code><a href="#setMaxSearchSwipes(int)">setMaxSearchSwipes(int)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>text</th> + <td>to look for</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if item us found else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollToBeginning(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollToBeginning</span> + <span class="normal">(int maxSwipes)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See <code><a href="#scrollToBeginning(int, int)">scrollToBeginning(int, int)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on scrolled else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollToBeginning(int, int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollToBeginning</span> + <span class="normal">(int maxSwipes, int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Scrolls to the beginning of a scrollable UI element. The beginning could be the top most + in case of vertical lists or the left most in case of horizontal lists. Caution is required + on devices configured with right to left languages like Arabic and Hebrew.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>use steps to control the speed, so that it may be a scroll, or fling</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on scrolled else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollToEnd(int, int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollToEnd</span> + <span class="normal">(int maxSwipes, int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Scrolls to the end of a scrollable UI element. The end could be the bottom most + in case of vertical controls or the right most for horizontal controls. Caution + is required on devices configured with right to left languages like Arabic and Hebrew.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>use steps to control the speed, so that it may be a scroll, or fling</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on scrolled else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollToEnd(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollToEnd</span> + <span class="normal">(int maxSwipes)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See {@link UiScrollable#scrollToEnd(int, int)</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on scrolled else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="setAsHorizontalList()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">setAsHorizontalList</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the direction of swipes when performing scroll search +</p></div> + + </div> +</div> + + +<a id="setAsVerticalList()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">setAsVerticalList</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the direction of swipes when performing scroll search +</p></div> + + </div> +</div> + + +<a id="setMaxSearchSwipes(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">setMaxSearchSwipes</span> + <span class="normal">(int swipes)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>#getChildByDescription(String, boolean) and #getChildByText(String, boolean) + use an arguments that specifies if scrolling is allowed while searching for the UI element. + The number of scrolls allowed to perform a search can be modified by this method. + The current value can be read by calling <code><a href="#getMaxSearchSwipes()">getMaxSearchSwipes()</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>swipes</th> + <td>is the number of search swipes until abort +</td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="setSwipeDeadZonePercentage(double)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">setSwipeDeadZonePercentage</span> + <span class="normal">(double swipeDeadZonePercentage)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Sets the percentage of a widget's size that's considered as a no touch zone when swiping. + + Dead zones are set as percentage of a widget's total width or height, denoting a margin + around the swipable area of the widget. Swipes must always start and + end inside this margin. + + This is important when the widget being swiped may not respond to the swipe if + started at a point too near to the edge. The default is 10% from either edge</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>swipeDeadZonePercentage</th> + <td>is a value between 0 and 1 +</td> + </tr> + </table> + </div> + + </div> +</div> diff --git a/docs/html/tools/help/uiautomator/UiSelector.jd b/docs/html/tools/help/uiautomator/UiSelector.jd new file mode 100644 index 0000000..96d3fd8 --- /dev/null +++ b/docs/html/tools/help/uiautomator/UiSelector.jd @@ -0,0 +1,2088 @@ +page.title=UiSelector +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> + + +<h2>Class Overview</h2> +<p>This class provides the mechanism for tests to describe the UI elements they + intend to target. A UI element has many properties associated with it such as + text value, content-description, class name and multiple state information like + selected, enabled, checked etc. Additionally UiSelector allows targeting of UI + elements within a specific display hierarchies to distinguish similar elements + based in the hierarchies they're in.</p> + + + + + +</div><!-- jd-descr --> + + + + + + + + + + + + + + + + +<div class="jd-descr"> + + +<h2>Summary</h2> + + + + + + + + + + + + + + + + + + + + + + + +<!-- ======== CONSTRUCTOR SUMMARY ======== --> +<table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr> + + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#UiSelector()">UiSelector</a></span>() + + </td></tr> + + + +</table> + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> + + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#checked(boolean)">checked</a></span>(boolean val) + + <div class="jd-descrdiv">Set the search criteria to match widgets that + are currently checked (usually for checkboxes).</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#childSelector(com.android.uiautomator.core.UiSelector)">childSelector</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Adds a child UiSelector criteria to this selector.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#className(java.lang.String)">className</a></span>(String className) + + <div class="jd-descrdiv">Set the search criteria to match the class property + for a widget (for example, "android.widget.Button").</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + <T> + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#className(java.lang.Class<T>)">className</a></span>(Class<T> type) + + <div class="jd-descrdiv">Set the search criteria to match the class property + for a widget (for example, "android.widget.Button").</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#classNameMatches(java.lang.String)">classNameMatches</a></span>(String regex) + + <div class="jd-descrdiv">Set the search criteria to match the class property + for a widget (for example, "android.widget.Button").</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#clickable(boolean)">clickable</a></span>(boolean val) + + <div class="jd-descrdiv">Set the search criteria to match widgets that are clickable.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#description(java.lang.String)">description</a></span>(String desc) + + <div class="jd-descrdiv">Set the search criteria to match the content-description + property for a widget.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#descriptionContains(java.lang.String)">descriptionContains</a></span>(String desc) + + <div class="jd-descrdiv">Set the search criteria to match the content-description + property for a widget.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#descriptionMatches(java.lang.String)">descriptionMatches</a></span>(String regex) + + <div class="jd-descrdiv">Set the search criteria to match the content-description + property for a widget.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#descriptionStartsWith(java.lang.String)">descriptionStartsWith</a></span>(String desc) + + <div class="jd-descrdiv">Set the search criteria to match the content-description + property for a widget.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#enabled(boolean)">enabled</a></span>(boolean val) + + <div class="jd-descrdiv">Set the search criteria to match widgets that are enabled.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#focusable(boolean)">focusable</a></span>(boolean val) + + <div class="jd-descrdiv">Set the search criteria to match widgets that are focusable.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#focused(boolean)">focused</a></span>(boolean val) + + <div class="jd-descrdiv">Set the search criteria to match widgets that have focus.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#fromParent(com.android.uiautomator.core.UiSelector)">fromParent</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Adds a child UiSelector criteria to this selector which is used to + start search from the parent widget.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#index(int)">index</a></span>(int index) + + <div class="jd-descrdiv">Set the search criteria to match the widget by its node + index in the layout hierarchy.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#instance(int)">instance</a></span>(int instance) + + <div class="jd-descrdiv">Set the search criteria to match the + widget by its instance number.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#longClickable(boolean)">longClickable</a></span>(boolean val) + + <div class="jd-descrdiv">Set the search criteria to match widgets that are long-clickable.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#packageName(java.lang.String)">packageName</a></span>(String name) + + <div class="jd-descrdiv">Set the search criteria to match the package name + of the application that contains the widget.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#packageNameMatches(java.lang.String)">packageNameMatches</a></span>(String regex) + + <div class="jd-descrdiv">Set the search criteria to match the package name + of the application that contains the widget.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollable(boolean)">scrollable</a></span>(boolean val) + + <div class="jd-descrdiv">Set the search criteria to match widgets that are scrollable.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#selected(boolean)">selected</a></span>(boolean val) + + <div class="jd-descrdiv">Set the search criteria to match widgets that + are currently selected.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#text(java.lang.String)">text</a></span>(String text) + + <div class="jd-descrdiv">Set the search criteria to match the visible text displayed + for a widget (for example, the text label to launch an app).</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#textContains(java.lang.String)">textContains</a></span>(String text) + + <div class="jd-descrdiv">Set the search criteria to match the visible text displayed + for a widget (for example, the text label to launch an app).</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#textMatches(java.lang.String)">textMatches</a></span>(String regex) + + <div class="jd-descrdiv">Set the search criteria to match the visible text displayed + for a widget (for example, the text label to launch an app).</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#textStartsWith(java.lang.String)">textStartsWith</a></span>(String text) + + <div class="jd-descrdiv">Text property is usually the widget's visible text on the display.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#toString()">toString</a></span>() + + </td></tr> + + + +</table> + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="inhmethods" class="jd-sumtable"><tr><th> + <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a> + <div style="clear:left;">Inherited Methods</div></th></tr> + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" + ><img id="inherited-methods-java.lang.Object-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + java.lang.Object + +<div id="inherited-methods-java.lang.Object"> + <div id="inherited-methods-java.lang.Object-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">equals</span>(Object arg0) + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + Class<?> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getClass</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">hashCode</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notify</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notifyAll</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0, int arg1) + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + +</table> + + +</div><!-- jd-descr (summary) --> + +<!-- Details --> + + + + + + + + +<!-- XML Attributes --> + + +<!-- Enum Values --> + + +<!-- Constants --> + + +<!-- Fields --> + + +<!-- Public ctors --> + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<h2>Public Constructors</h2> + + + +<a id="UiSelector()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + + </span> + <span class="sympad">UiSelector</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p></p></div> + + </div> +</div> + + + + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<!-- Protected ctors --> + + + +<!-- ========= METHOD DETAIL ======== --> +<!-- Public methdos --> + +<h2>Public Methods</h2> + + + +<a id="checked(boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">checked</span> + <span class="normal">(boolean val)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that + are currently checked (usually for checkboxes). + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>val</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="childSelector(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">childSelector</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> selector)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Adds a child UiSelector criteria to this selector. + + Use this selector to narrow the search scope to + child widgets under a specific parent widget.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with this added search criterion</li></ul> + </div> + + </div> +</div> + + +<a id="className(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">className</span> + <span class="normal">(String className)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the class property + for a widget (for example, "android.widget.Button").</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>className</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="className(java.lang.Class<T>)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">className</span> + <span class="normal">(Class<T> type)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the class property + for a widget (for example, "android.widget.Button").</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="classNameMatches(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">classNameMatches</span> + <span class="normal">(String regex)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the class property + for a widget (for example, "android.widget.Button").</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="clickable(boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">clickable</span> + <span class="normal">(boolean val)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that are clickable. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>val</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="description(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">description</span> + <span class="normal">(String desc)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the content-description + property for a widget. + + The content-description is typically used + by the Android Accessibility framework to + provide an audio prompt for the widget when + the widget is selected. The content-description + for the widget must match exactly + with the string in your input argument. + + Matching is case-sensitive.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>desc</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="descriptionContains(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">descriptionContains</span> + <span class="normal">(String desc)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the content-description + property for a widget. + + The content-description is typically used + by the Android Accessibility framework to + provide an audio prompt for the widget when + the widget is selected. The content-description + for the widget must contain + the string in your input argument. + + Matching is case-insensitive.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>desc</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="descriptionMatches(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">descriptionMatches</span> + <span class="normal">(String regex)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the content-description + property for a widget. + + The content-description is typically used + by the Android Accessibility framework to + provide an audio prompt for the widget when + the widget is selected. The content-description + for the widget must match exactly + with the string in your input argument.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="descriptionStartsWith(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">descriptionStartsWith</span> + <span class="normal">(String desc)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the content-description + property for a widget. + + The content-description is typically used + by the Android Accessibility framework to + provide an audio prompt for the widget when + the widget is selected. The content-description + for the widget must start + with the string in your input argument. + + Matching is case-insensitive.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>desc</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="enabled(boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">enabled</span> + <span class="normal">(boolean val)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that are enabled. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>val</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="focusable(boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">focusable</span> + <span class="normal">(boolean val)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that are focusable. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>val</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="focused(boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">focused</span> + <span class="normal">(boolean val)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that have focus. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>val</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="fromParent(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">fromParent</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> selector)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Adds a child UiSelector criteria to this selector which is used to + start search from the parent widget. + + Use this selector to narrow the search scope to + sibling widgets as well all child widgets under a parent.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with this added search criterion</li></ul> + </div> + + </div> +</div> + + +<a id="index(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">index</span> + <span class="normal">(int index)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the widget by its node + index in the layout hierarchy. + + The index value must be 0 or greater. + + Using the index can be unreliable and should only + be used as a last resort for matching. Instead, + consider using the <code><a href="#instance(int)">instance(int)</a></code> method.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>index</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="instance(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">instance</span> + <span class="normal">(int instance)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the + widget by its instance number. + + The instance value must be 0 or greater, where + the first instance is 0. + + For example, to simulate a user click on + the third image that is enabled in a UI screen, you + could specify a a search criteria where the instance is + 2, the <code><a href="#className(java.lang.String)">className(String)</a></code> matches the image + widget class, and <code><a href="#enabled(boolean)">enabled(boolean)</a></code> is true. + The code would look like this: + <code> + new UiSelector().className("android.widget.ImageView") + .enabled(true).instance(2); + </code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>instance</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="longClickable(boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">longClickable</span> + <span class="normal">(boolean val)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that are long-clickable. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>val</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="packageName(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">packageName</span> + <span class="normal">(String name)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the package name + of the application that contains the widget.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>name</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="packageNameMatches(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">packageNameMatches</span> + <span class="normal">(String regex)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the package name + of the application that contains the widget.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="scrollable(boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">scrollable</span> + <span class="normal">(boolean val)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that are scrollable. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>val</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="selected(boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">selected</span> + <span class="normal">(boolean val)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that + are currently selected. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>val</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="text(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">text</span> + <span class="normal">(String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the visible text displayed + for a widget (for example, the text label to launch an app). + + The text for the widget must match exactly + with the string in your input argument. + Matching is case-sensitive.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>text</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="textContains(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">textContains</span> + <span class="normal">(String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the visible text displayed + for a widget (for example, the text label to launch an app). + + The text for the widget must contain the string in + your input argument. Matching is case-sensitive.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>text</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="textMatches(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">textMatches</span> + <span class="normal">(String regex)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the visible text displayed + for a widget (for example, the text label to launch an app). + + The text for the widget must match exactly + with the string in your input argument.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="textStartsWith(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">textStartsWith</span> + <span class="normal">(String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Text property is usually the widget's visible text on the display. + + Adding this to the search criteria indicates that the search performed + should match a widget with text value starting with the text parameter. + + The matching will be case-insensitive.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with this added search criterion</li></ul> + </div> + + </div> +</div> + + +<a id="toString()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + String + </span> + <span class="sympad">toString</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p></p></div> + + </div> +</div> + + + + + +<!-- ========= METHOD DETAIL ======== --> + + + +<!-- ========= END OF CLASS DATA ========= --> + diff --git a/docs/html/tools/help/uiautomator/UiWatcher.jd b/docs/html/tools/help/uiautomator/UiWatcher.jd new file mode 100644 index 0000000..b416fad --- /dev/null +++ b/docs/html/tools/help/uiautomator/UiWatcher.jd @@ -0,0 +1,78 @@ +page.title=UiWatcher +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> + +<p>Represents a conditional watcher on the target device. To learn how to register a conditional + watcher, see <code><a href="UiDevice.html#registerWatcher(java.lang.String, com.android.uiautomator.core.UiWatcher)">UiDevice.registerWatcher()</a></code>. +</p> + +<div class="jd-descr"> + +<h2>Summary</h2> + +<!-- ========== METHOD SUMMARY =========== --> +<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + abstract + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#checkForCondition()">checkForCondition</a></span>() + + <div class="jd-descrdiv">The testing framework calls this handler method automatically when the framework + is unable to find a match using the <code><a href="UiSelector.html">UiSelector</a></code>.</div> + + </td></tr> + +</table> + +</div><!-- jd-descr (summary) --> + + +<!-- ========= METHOD DETAIL ======== --> +<!-- Public methdos --> + +<h2>Public Methods</h2> + +<a id="checkForCondition()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + abstract + + boolean + </span> + <span class="sympad">checkForCondition</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>The testing framework calls this handler method automatically when the framework is unable to find a match using the <code><a href="UiSelector.html">UiSelector</a></code>. When a match is not found after a predetermined time has elapsed, the framework calls the checkForCondition() method of all registered watchers on the device. You can use this method to handle known blocking issues that are preventing the test from proceeding. For example, you can check if a dialog appeared that is blocking the the test, then close the dialog or perform some other appropriate action to allow the test to continue.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true to indicate a matched condition, or false if no matching condition is found +</li></ul> + </div> + + </div> +</div> diff --git a/docs/html/tools/help/uiautomator/index.jd b/docs/html/tools/help/uiautomator/index.jd new file mode 100644 index 0000000..e3899d6 --- /dev/null +++ b/docs/html/tools/help/uiautomator/index.jd @@ -0,0 +1,172 @@ +page.title=uiautomator +parent.title=Tools +parent.link=index.html +@jd:body + +<div id="qv-wrapper"> + <div id="qv"> + <h2>In this document</h2> + <ul> + <li><a href="#syntax">Syntax</a></li> + <li><a href="#options">Options</a></li> + <lI><a href="#api">uiautomator API</a> + <ul> + <li><a href="#classes">Classes</a></li> + <li><a href="#interfaces">Interfaces</a></li> + <li><a href="#exceptions">Exceptions</a></li> + </ul> + </lI> + </ul> + </div> +</div> + +<p>The {@code uiautomator} testing framework lets you test your user interface (UI) efficiently by creating automated functional UI testcases that can be run against your app on one or more devices.</p> +<p>For more information on testing with the {@code uiautomator} framework, see <a href="{@docRoot}tools/testing/testing_ui.html">UI Testing</a>.</p> + +<h2 id="syntax">Syntax</h2> +<p>To run your testcases on the target device, you can use the {@code adb shell} command to invoke the {@code uiautomator} tool. The syntax is: +<pre> +adb shell uiautomator runtest <jar> -c <test_class_or_method> [options] +</pre> +</p> +<p>Here’s an example:</p> +<pre>adb shell uiautomator runtest LaunchSettings.jar -c com.uia.example.my.LaunchSettings</pre> + +<h2 id="options">Command-line Options</h2> +<p>The following table describes the subcommands and options for {@code uiautomator}.</p> + +<p class="table-caption" id="table1"> +<strong>Table 1.</strong> Command-line options for {@code uiautomator}</p> +<table> +<tr> + <th>Subcommand</th> + <th>Option</th> + <th>Description</th> +</tr> + +<tr> +<td rowspan="6"><code>runtest</code></td> +<td><nobr>{@code <jar>}</nobr></td> +<td><strong>Required</strong>. The {@code <jar>} argument is the name of one or more JAR files that you deployed to the target device which contain your uiautomator testcases. You can list more than one JAR file by using a space as a separator.</td> +</tr> + +<tr> +<td><nobr><code>-c <test_class_or_method> </code></nobr></td> +<td><strong>Required</strong>. The {@code <test_class_or_method>} argument is a list of one or more specific test classes or test methods from the JARs that you want {@code uiautomator} to run. <p>Each class or method must be fully qualified with the package name, in one of these formats: +<ul> +<li>{@code package_name.class_name}</li> +<li>{@code package_name.class_name#method_name}</li> +</ul> +You can list multiple classes or methods by using a space as a separator.</p></td> +</tr> + +<tr> +<td><nobr><code>--nohup</code></nobr></td> +<td>Runs the test to completion on the device even if its parent process is terminated (for example, if the device is disconnected).</td> +</tr> + +<tr> +<td><nobr><code>-e <NAME> <VALUE></code></nobr></td> +<td><p>Specify other name-value pairs to be passed to test classes. May be repeated.</p><p class="note"><strong>Note: </strong>The {@code -e} options cannot be combined; you must prefix each option with a separate {@code -e} flag. </p></td> +</tr> + +<tr> +<td><nobr><code>-e debug [true|false]</code></nobr></td> +<td>Wait for debugger to connect before starting.</td> +</tr> + +<tr> +<td><code>dump</code></td> +<td><code>[file]</code></td> +<td>Generate an XML file with a dump of the current UI hierarchy. If a filepath is not specified, by default, the generated dump file is stored on the device in this location {@code /storage/sdcard0/window_dump.xml}.</td> +</tr> + +<tr> +<td><code>events</code></td> +<td> </td> +<td>Prints out accessibility events to the console until the connection to the device is terminated</td> +</tr> +</table> + +<h2 id="api">uiautomator API</h2> +<p>The {@code uiautomator} API is bundled in the {@code uiautomator.jar} file under the {@code <android-sdk>/platforms/} directory. The API includes these key classes, interfaces, and exceptions that allow you to capture and manipulate UI components on the target app:</p> + +<h3 id="classes">Classes</h3> +<table> +<tr> + <th>Class</th> + <th>Description</th> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/UiCollection.html">{@code com.android.uiautomator.core.UiCollection}</a></nobr></td> +<td>Used to enumerate a container's user interface (UI) elements for the purpose of counting, or targeting a sub elements by a child's text or description.</td> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/UiDevice.html">{@code com.android.uiautomator.core.UiDevice}</a></nobr></td> +<td>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 hardware button or pressing the Home and Menu buttons.</td> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/UiObject.html">{@code com.android.uiautomator.core.UiObject}</a></nobr></td> +<td>Represents a user interface (UI) element.</td> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/UiScrollable.html">{@code com.android.uiautomator.core.UiScrollable}</a></nobr></td> +<td>Provides support for searching for items in a scrollable UI container.</td> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/UiSelector.html">{@code com.android.uiautomator.core.UiSelector}</a></nobr></td> +<td>Represents a query for one or more target UI elements on a device screen. </td> +</tr> + +</table> + +<h3 id="interfaces">Interfaces</h3> + +<table> +<tr> + <th>Interface</th> + <th>Description</th> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/UiWatcher.html">{@code com.android.uiautomator.core.UiWatcher}</a></nobr></td> +<td>Represents a conditional watcher on the target device.</td> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/IAutomationSupport.html">{@code com.android.uiautomator.testrunner.IAutomationSupport}</a></nobr></td> +<td>Provides auxiliary support for running test cases.</td> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/UiAutomatorTestCase.html">{@code com.android.uiautomator.testrunner.UiAutomatorTestCase}</a></nobr></td> +<td>Defines an environment for running multiple tests. All {@code uiautomator} test cases should extend this class.</td> +</tr> + +</table> + +<h3 id="exceptions">Exceptions</h3> + +<table> +<tr> + <th>Exception</th> + <th>Description</th> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/UiObjectNotFoundException.html">{@code com.android.uiautomator.core.UiObjectNotFoundException}</a></nobr></td> +<td>Indicates when a a <a href="{@docRoot}tools/help/uiautomator/UiSelector.html">{@code UiSelector}</a> could not be matched to any UI element displayed.</td> +</tr> + +</table> + + + + + + |
