Skip to main content

Virtual USB CLI: Start Test Session

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.

--artifactsEnabled

| OPTIONAL | BOOLEAN |

Whether to generate and save artifacts for this session (device logs and video recording). The default value, if not specified, is false.

--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.

--proxyHost

| OPTIONAL | STRING |

Specify a proxy host to be set on the device.

--proxyPort

| OPTIONAL | STRING |

Specify a proxy port to be set on the device. Default value: 0.

--proxyUser

| OPTIONAL | STRING |

Specify a proxy user to be set on the device.

--proxyPassword

| OPTIONAL | STRING |

Specify a proxy password to be set on the device.

--tunnelIdentifier

| OPTIONAL | STRING |

Specifies the name of an active Sauce Connect tunnel to use for secure connectivity to the Sauce Labs platform.
Use the --tunnelIdentifier option with the tunnel identifier in the format:
tunnel identifier format
--tunnelIdentifier tunnel-identifier:<tunnel-name>,<tunnel-owner>
Identifying a Tunnel
  • tunnel-name: 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.
  • tunnel-owner: The name of the tunnel owner. This is the value shown under the Owner column on the Sauce Labs Tunnels page.

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 tunnel-identifier:my-tunnel,my-owner