How do I connect adb in a CI job to an Android virtual device running in the cloud?

Last verified against genymotion.com:

Use gmsaas in the CI job, then connect the running SaaS instance with gmsaas instances adbconnect. The device will show up in adb devices as localhost:<port> after the tunnel is established.

Install and configure gmsaas, including your Android SDK path, then authenticate with an API token before connecting: How to connect a virtual device to ADB in Genymotion SaaS? and How to use Android Studio, Eclipse, VS Code, JetBrains Rider or any other IDE with Genymotion SaaS?.

Typical flow in CI:

pip3 install gmsaas
gmsaas auth token <your_api_token>
gmsaas config set android-sdk-path <sdk_path>
gmsaas doctor
gmsaas instances adbconnect <instance_uuid>
adb devices

You can also omit <instance_uuid> only if exactly one instance is online. If you see Adb tunnel communication failure, the Android SDK path is usually not set correctly.