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.
- 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 higher or Android 13 or higher for TV and WearOS
- Optionally: a cable to connect your device to the operating system
In this article:
Connecting to Secure Remote ADB
Step 1: ADB Enabled
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.
In the device’s Blueprint, enable ADB access in the Device Security section.
Step 2: Connect the 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
If using a cable, disconnect the device. You should now be able to connect to adb via port 5555 over TCP.
Step 3: Set Up Esper CLI
To 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.
$ espercli secureadb connect -d SNA-SNL-1234
Step 5: Connect the Device with ADB
$ adb connect 127.0.0.1:62945
You are now connected to adb. Reboot the device to exit adb. Once the device is rebooted, it will no longer be connected to adb.