Skip to main content
No Result Found
Get your setup working faster. Join our Discord for optimisation tips from elite testers. Join our DiscordJoin our Discord

Device Tunnel CLI quick start

Setup and quick-start guide for Device Tunnel CLI

This document provides a step-by-step guide to set up and get started with Device Tunnel CLI, including prerequisites, authentication methods, and a quick-start workflow.

Prerequisites

Follow these prerequisites to get started with Device Tunnel CLI:

Account requirements

  • A BrowserStack account with Bridge Cloud or Dedicated Device access, and your Username and Access key. You can find this in your account profile. If you do not have an account yet, you can sign up for a free trial.

  • Custom Device Lab provisioned. Verify using the following command:

Copy icon Copy

System requirements

Following are the system requirements to run Device Tunnel CLI:

Requirement Details
Node.js v16 or later
ADB (Android) In $PATH for automatic adb connect
Network Outbound HTTPS (443) to api.browserstack.com and hub.browserstack.com
Ports Port 8080 free for orchestrator

Get the Device Tunnel binary

You can get the Device Tunnel binary either by downloading it directly, or by installing the BrowserStack SDK for your language, which bundles and auto-downloads the binary for you.

The minimum supported binary version is 1.29.0. These direct-download links are not yet published on a public downloads page, so bookmark them from this guide.

Direct download

OS Architecture Download
macOS ARM64 Download for macOS ARM64
macOS x64 Download for macOS x64
Linux ARM64 Download for Linux ARM64
Linux x64 Download for Linux x64

Install through the SDK

Installing the BrowserStack SDK for your language bundles the binary and auto-downloads it for your OS into ~/.browserstack/cli/ on first use. You don’t manage the binary directly, you only install whichever SDK matches your stack:

Language Install command
Node.js npm install -g browserstack-node-sdk
Python pip install browserstack-sdk
Java Add browserstack-java-sdk to pom.xml or build.gradle
Ruby gem install browserstack-sdk

After installation, the binary is fetched on first use and lives at ~/.browserstack/cli/binary-<platform>. For example, on macOS with an Apple silicon chip: /Users/username/.browserstack/cli/binary-macos-arm64.

You can also invoke this path directly for Device Tunnel commands:

Copy icon Copy

Choose the binary that matches your machine’s architecture.

Setup

Run the following command to set up the Device Tunnel CLI:

Copy icon Copy

Authentication

Following are the authentication methods for Device Tunnel CLI:

Inline flags (recommended for CI):

Copy icon Copy

YAML config:

Copy icon Copy
Copy icon Copy

Place device-tunnel.yml in the same directory as the binary to skip the --config flag.

To connect to iOS devices, pass --enable-ios with the start command, or set enable_ios: true in device-tunnel.yml.

Quick start

Follow the steps below to get your first tunnel up and running:

Start the orchestrator

Copy icon Copy

Or use a config file:

Copy icon Copy

Keep this running in a dedicated terminal. The orchestrator must remain active for all tunnel operations.

List available devices

Copy icon Copy

Note the Device ID (UDID) for your target device.

Connect to device

Copy icon Copy

To connect to iOS devices, pass --enable-ios with the start command, or set enable_ios: true in config.yml, before you run connect.

Success output:

Copy icon Copy

Android: ADB auto-connects if in $PATH:

Copy icon Copy

iOS: Use the displayed WDA Port for WebDriver client.

Run automation

Point your automation framework to localhost:<localPort> (Android) or WDA Port (iOS).

Disconnect

Copy icon Copy

Stop orchestrator

Copy icon Copy

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle