Debug your devices, even if you’re not physically close to them. Android Debug Bridge (adb) allows you to connect with your devices to collect logs or resolve issues from almost any location with a network connection.
With Esper CLI, we provide you secure access to your host machine and devices using our APIs. You can also connect to a device on most networks.
Requirements if using Foundation devices:
Requirements if using non-Foundation devices:
- Esper CLI
- An API Key
- ADB supported and installed on your operating system and device (see Android Developers documentation)
- A device with remote adb supported and enabled
- Enterprise Admin access to the Esper Console
- An Android device running Android 11+ or Android 13+ for TV and WearOS
- A cable to connect the device to your operating system
- The device and your operating system must be on the same network
In this article:
Connecting to Secure Remote ADB
Step 1: ADB Enabled
In the device’s Blueprint, enable ADB access in the Device Security section.
Locate the device in Devices & Groups. Go to the device’s Settings tab and navigate to the ADB access section. Then enable it and set the duration of the session.
Step 2: Connect the Device
You will need to complete this step every time to enable remote adb on a non-Foundation device.
Connect a cable to the device, or to enable wireless debugging, see Developer Options. Then, navigate to the Android SDK platform-tools directory, and open the TCP mode port.
$ adb tcpip 5555
You can now optionally disconnect the device. You should now be able to connect to adb via port 5555 over TCP.
Step 3: Set Up Esper CLI
You'll need to install the Esper CLITo set up Esper CLI:
- Check your Esper CLI version by entering in your terminal:
$ espercli -v - Ensure Esper CLI is >= 0.0.5 to use the secure-adb feature.
- If needed, upgrade Esper CLI
$ pip install -U espercli
Step 4: Connect to the Device with Esper CLI
Then, copy the device ID from Esper and use Esper CLI to connect to the device. The following command is an example.
$ espercli secureadb connect -d SNA-SNL-1234
Step 5: Connect the Device with ADB
After specifying the device, the terminal will output a command. Open a new window and past the command. The following command is is an example.
$ adb connect 127.0.0.1:62945
You are now connected to adb.
Step 6: Exit the session
Perform this step to end the active adb connection.
$ adb disconnect
Then reboot the device. Once the device is rebooted, it will no longer be connected to adb.
Sessions are not indefinite. You will need to enable adb each time you want to connect to the device (steps 4 and 5 of this guide).
adb disconnect. Improperly closing a session can lead to problems starting a new session.