Custom Parameters for Android Automation
You can enter custom parameters when automating Android systems under test (SUTs), both via Android Gateway and via the command line. In both cases, you pass these parameters through SystemNative2 (SN2), an on-device process that enables Android automation.
How to Use Parameters
First, install SN2 on your Android SUT. Open Android Gateway, connect an Android device, and click Start in the Android Gateway interface. Android Gateway installs and launches SN2 on the connected device. After you install SN2 on an Android device, you can automate that device using Android Gateway or the command line.
Automating with Android Gateway
If you're using Android Gateway, enter parameters only in the Custom Parameters field in the Android Gateway GUI.
Automating with the Command Line
If you're automating Android devices using the command line, use this syntax to open SN2 and begin automation:
The available parameters are described below:
Connection Parameters
These parameters apply to Android connections.
Parameter | Definition |
---|---|
|
Specifies the port number. The default is 5900. |
|
Specifies the IP address for a reverse connection. |
|
Specifies the port number for a reverse connection. The default is 5500. |
|
Specifies whether or not the server can work with multiple clients. The default value is |
|
Chooses what to do when the server is not being shared between clients, but a second client tries to connect. See also |
|
Forwards messages to a different server. This is useful when working with LG G5 devices. |
|
Switches off forwarding. |
|
Uses the specified port for internal communication between SN2 and EggSensor. Note that this option is the same as |
|
Iterates through the specified range to find an available TCP port on the phone, and uses that port for internal communication between SN2 and EggSensor. The default range is 6000-6050. |
|
Enables Zeroconf. The host can be either a symbolic name or a dot-separated IP address. |
Debugging Parameters
These parameters apply to debugging.
Parameter | Definition |
---|---|
|
Prints debugging information related to receiving and parsing messages. |
|
Prints debugging information related to client configuration. |
|
Prints debugging information related to processing messages. |
|
Displays connection messages. |
|
Turns on all VNC/core traces. |
|
Traces file transfers from the SUT. |
|
Displays inbound messages. |
|
Displays outbound messages, except screen update messages. |
|
Prints a table every 10 seconds that shows how much time was spent on different sections of code. |
|
Displays procedural messages. |
|
Displays outbound screen update messages. |
|
Switches on traces for the connection between SN2 and EggSensor. |
|
Switches on less verbose traces related to EggSensor. |
|
Traces keyboard events. |
|
Traces the Unicode keyboard (Eggboard). |
|
Traces mouse detection and configuration. |
|
Traces the configuration of the screen capture method. |
|
Traces functionality specific to Android. Using this trace with |
General Parameters
These are general parameters for Android testing.
Parameter | Definition |
---|---|
|
Displays this help file. |
|
Displays the version information, then exits immediately. |
|
Sets the password to be an empty string. |
|
Makes SN2 read commands from stdin. |
|
Specifies the password. "WordToPass" is the default. |
|
Does not start EggSensor. Set device orientation will not work, and change device orientation notifications will not be sent. This option can help when EggSensor is not compatible with the SUT system. |
|
Establishes a socket connection to Eggboard, which can enter Unicode strings. Disabled by default. |
|
Does not establish a socket connection to Eggboard. Unicode characters will not be available. Use this option if Eggboard is not working or is causing issues. |
Mouse Parameters
These parameters apply to touch gestures.
Parameter | Description |
---|---|
|
Selects a path for the mouse device. This value is only used with |
|
Chooses the algorithm for controlling the mouse. Portable supports only taps and swipes, not long holds or multitouch gestures. Power mouse supports long holds and pinches. Scaled mouse is similar to power mouse, except it expects different IDs for mouse coordinates. SN2 defaults to power mouse mode; if that fails, SN2 switches to portable mouse mode. |
|
Enabled by default. Runs in power mouse mode, and tries to automatically detect the path for the mouse , and whether it is a button mouse. |
|
Tweaks the --power-mouse algorithm to make it work with a few devices that need this option. |
|
Tweaks the --power-mouse algorithm to make it work with certain devices. Most devices work with this option. |
|
Attempts to detect the type of mouse (button or non-button) using the --power-mouse setting. This option is enabled by default. |
|
Doesn't send timestamps to the mouse. This option can be useful when testing older devices. |
|
Flips the coordinates for the mouse. This command is deprecated; use |
|
Turns the mouse coordinates by 0, 90, 180, or 270 degrees, respectively. This can help if the screen displays incorrectly in the Eggplant Functional Viewer window. |
|
This command affects how Android Gateway processes mouse events. It should only be used while working with Eggplant support. |
Screen Parameters
These parameters apply to screen specifications including size, colors, and rotation.
Parameter | Definition |
---|---|
|
Scales down the screen size by a given factor to enable faster screen updates. For example, |
|
Blends the pixels on a scaled screen instead of dropping them. Blending provides a better image, but can be slower to load. |
|
Limits how many screenshots the VNC server takes per second. The default is 5. This value can be a float number. A high frame rate can drain the device battery even if the device is connected to a power source. A lower frame rate also allows more processor time to be spent executing the test. |
|
Define screen slicing. By default, NX and NY are 8. |
|
Enables or disables TightVNC encoding, which compresses screenshots using JPEG formatting. |
|
Enables or disables compression using the zlib standard. |
|
Sets the compression level for JPEG encoding. For good quality source images, the default (75) is the best choice. The valid range is 0 to 100. For more information see the JPEG image compression FAQ. |
|
Sets the compression level for zlib encoding. |
|
In --rgb-auto mode, the default, the server decides whether to reverse the byte order in the pixel according to the pixel format requested by the client. |
|
Turns the screen by 0, 90, 180, or 270 degrees, respectively. |
|
Selects a method for screen capture. The default is |
|
Enable other algorithms for screen capture. |
|
Used for testing and VNC forwarding. |
|
Enables an alternative algorithm for changing screen orientation. This option can have unexpected side effects, so do not use unless you have to. |
|
Defines the touch screen range. For use with devices (i.e., MC9200), where the dimensions of the touch screen can't be figured out automatically. |