Skip to main content

Virtual USB CLI: Start Test Session

Description

Launch a Virtual USB (vUSB) session between your local machine and a Sauce Labs device. Alternatively, you can connect to an existing vUSB session.

Usage

$ <main class> [OPTIONS] startSession [OPTIONS]

Options Details

--username

| REQUIRED | STRING |

A valid Sauce Labs user account. You can find your username on the Sauce Labs User Settings page. This option supports environment variable values.

--accessKey

| REQUIRED | STRING |

The authentication access key associated with your Sauce Labs user account. You can find your access key on the Sauce Labs User Settings page. This option supports environment variable values.

--deviceName

| REQUIRED | STRING |

The name of the private device that you want to use for testing.

--serverHost

| OPTIONAL | URL ADDRESS |

A specific vUSB server host address. The default value, if not specified, is http://127.0.0.1.

--serverPort

| OPTIONAL | STRING |

A specific vUSB server port. The default value, if not specified, is 33657.

--adbPortMin

| OPTIONAL | STRING |

Specifies a vUSB server Android Debug Bridge (ADB) port. Default value: 7000.

--adbPortRange

| OPTIONAL | STRING |

Specifies a vUSB server ADB port range. Default value: 100.

--proxyHost

| OPTIONAL | STRING |

Specifies the HTTP proxy host.

--proxyPort

| OPTIONAL | STRING |

Specifies the HTTP proxy port. Default value: 0.

--proxyUser

| OPTIONAL | STRING |

Specifies the HTTP proxy user.

--proxyPassword

| OPTIONAL | STRING |

Specifies the HTTP proxy password.

--tunnelIdentifier

| OPTIONAL | STRING |

The name of an active Sauce Connect tunnel to use for secure connectivity to the Sauce Labs platform.

Identifying a Tunnel

The value expected here is the value shown under the Tunnel Name column on the Sauce Labs Tunnels page, not the Tunnel ID numerical value.

Examples

Basic Example with Required Flags

Start Session Request
java -jar virtual-usb-client.jar startSession --username $SAUCE_USERNAME --accessKey $SAUCE_ACCESS_KEY --deviceName iPhone_XS
Sample Response
07:43:22.551 [main] INFO com.saucelabs.vusb.client.Runner - Runner Version 2.0.0
Started new session:
e21abb6f-a08e-4685-ba6e-8c6586dd4264 iPhone SE 2020 IOS 14.3 https://app.eu-central-1.saucelabs.com/live/mobile/dataCenters/EU/devices/iPhone_SE_2020_14_POC05/shared/e21abb6f-a08e-4685-ba6e-8c6586dd4264
localhost:-1 online

Full Example with Optional Flags

java -jar virtual-usb-client.jar startSession \
--username $SAUCE_USERNAME \
--accessKey ab015c1e-xxxx-xxxx-xxxx-xxxxxxx \
--deviceName iPhone_XS \
--serverHost http://127.0.0.1 \
--serverPort 8080 \
--tunnelIdentifier my-tunnel