Virtual Remote USB Devices with TestGrid

You are here:
< All Topics

Overview

Virtual USB (vUSB) is a mobile debugging tool that replicates the experience of connecting a TestGrid Real Devices Cloud to your personal computer via a USB cable. This allows you to debug applications using your preferred in-house development and testing tools as if the device were directly connected to your workstation.

Key Features:

  • Build and deploy apps directly from any IDE (e.g., Android Studio, Xcode).
  • Streamline early-stage development workflows.
  • Combine live and automated testing as per your requirements.
  • Monitor device performance metrics such as CPU consumption, memory usage, and network performance (dependent on your IDE/tools).

Note: Virtual USB is exclusively for debugging purposes, Localhosted automation script execution runs or manually connections, and currently supports iOS 17 and later, and Android 14 and later.

Prerequisites

  • A TestGrid account credentials.
  • A system running Windows, macOS, or Linux.
  • Administrative rights to install software on your machine.
  • Java Development Kit (JDK) installed.

For iOS App Testing:

  • macOS or Linux (not supported on Windows).
  • Xcode installed (macOS only).

For Android App Testing:

  • Android Debug Bridge (ADB) version 1.0.39 or higher.
  • Android Studio version 4 or higher.

 

Step 1: Go to the TestGird Portal and find a left-side navigation Virtual USB option.

  • After clicking on the Virtual USB option, you will see the option to download virtual USB.jar.

 

 

 

Step 2: Establish a Connection to the Real Device Cloud

Launch the command prompt on your local machine and execute the following command:

$ sudo java -jar RemoteUSB.jar Server --userToken <your_token> --server https://<your_domain>.testgrid.io

 

Note:Virtual USB requires Java version 20 or higher. Ensure your local machine meets this requirement.

Learn how to obtain your user token.

 

Step 3: Accept Application Execution

A pop-up will appear requesting permission to execute the application. Click Allow. After executing the command, the session data log will run in the background. Do not close the session or the terminal.

 

Step 4: List Available Devices

Run the following command to list the devices on the cloud:

$ java -jar RemoteUSB.jar List

 

Step 5: Connect to a Device

To start a session with a specific device, run:

$ java -jar RemoteUSB.jar Connect <UDID>

Upon successful connection, the prompt will confirm the connection.

 

 

Step 6: Verify Device Connection

  • For Xcode, the connected device will appear, allowing developers to design, code, test, and debug with a unified workflow.
  • For Android, use the command line or Android Studio to verify the connection:
$ scrcpy

 

 

Step 7: Disconnect the Device

To disconnect the device from the cloud, execute:

$ java -jar RemoteUSB.jar Disconnect <UDID>

Upon successful execution, the prompt will confirm the disconnection.

 

 

Conclusion

With Virtual USB, debugging becomes seamless and efficient, enabling you to harness the power of TestGrid Real Devices Cloud as if the devices were physically connected to your local machine.

Happy Testing!

 

 

 

 

Table of Contents