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 Google's Android Debug Bridge (adb) documentation instructions.

  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 from Google's Android developer site.

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 connect to Mobile Farm devices over ADB.

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

  1. In the control panel, on the top menu, click Account.
  2. Go to AccessibilityADB Keys tab.
  3. Click Add Key.
  4. Enter the name of the key.
  5. Paste the public ADB key that you copied when you created the ADB key pair in step 3.
  6. Click Add.

4. Connect to the device via ADB

  1. In the dashboard, from the top menu, click Products and select Mobile Farm.

  2. Go to the Farms section.

  3. Open the mobile farm page.

  4. Click on the serial number of the device.

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

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

  7. 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 connection to mobile devices;
    • 3094 — example of a port to connect to.
  8. 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