Skip to main content
Connect to the device via ADB
Last update:

Connect to the device via ADB

Android Debug Bridge (ADB) is a tool that allows you to interact with Android OC devices through a command line interface. For example, you can:

  • run shell commands and applications;
  • remotely debug applications;
  • transfer files between your mobile device and your computer;
  • to get the logs;
  • reboot the device;
  • change the settings of the device.

Learn more about the Android Debug Bridge tool in the instructions Android Debug Bridge (adb) Google docs.

  1. Install Android SDK Platform Tools.
  2. Create an ADB key pair.
  3. Add a public ADB key.
  4. Connect to the device via ADB.

1. Install Android SDK Platform Tools

Download the Android SDK Platform Tools distribution for your operating system at Google's site for Android developers.

2. Create an ADB key pair

  1. Open the CLI.

  2. Create a pair of ADB keys and place them in the folder where they will be stored:

    cd ~/.android/
    adb keygen adbkey
    adb pubkey ~/.android/adbkey > ~/.android/adbkey.pub
  3. Copy the public ADB key:

    xclip -sel clip < ~/.android/adbkey.pub

3. Add a public ADB key

You can add a public ADB key to your profile or to another user's profile and then use it to connections to mobile farm devices via ADB.

The key will be available in all projects to which the user has been added.

  1. В control panels in the upper right corner, open the menu (account number) and select Profile and settings.
  2. Go to the section ADB keys.
  3. Click Add key.
  4. Enter the name of the key.
  5. Paste the public ADB key that you copied when creating an ADB key pair in step 3.
  6. Click Add.

4. Connect to the device via ADB

  1. В control panels go to Mobile farmFarms.

  2. Open the mobile farm page.

  3. Click on the serial number of the device.

  4. Under the device name, copy the command to connect a mobile farm device of the form adb connect <host>: <port>, where:

    • <host> — DNS address for connecting to mobile devices;
    • <port> — connection port.
  5. Open the CLI.

  6. Connect to the device — run the command you copied in step 4.

    Even with a successful connection, an authentication error will appear in the response:

    failed to authenticate to adb.mobfarm.selectel.ru:3094

    Here:

    • adb.mobfarm.selectel.ru — DNS address for connecting to mobile devices;
    • 3094 — example of a port to connect to.
  7. To verify that the connection is established, request a list of connected devices:

    adb devices -l

    A list of connected devices will appear in the response. For example:

    List of devices attached
    adb.mobfarm.selectel.ru:3094 device product:AD8-RU model:TECNO_AD8 device:TECNO-AD8 transport_id:1