Skip to main content

Connect to a mobile farm device via ADB

Android Debug Bridge (ADB) — a tool that allows you to interact with Android OS devices via the command line interface. For example, you can:

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

Learn more about the Android Debug Bridge tool in the Android Debug Bridge (adb) documentation by Google.

  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 on the Android developer website by Google.

2. Create an ADB key pair

  1. Open the CLI.

  2. Create an ADB key pair and place them in the folder where you want to store them:

    cd ~/.android/
    adb keygen adbkey
    adb pubkey ~/.android/adbkey > ~/.android/adbkey.pub
  3. Copy your 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 another user's profile and use it to connect to mobile farm devices via ADB.

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

  1. In the control panel, in the upper right corner, open the menu (account number) and select Profile.
  2. Go to the Access section → ADB Keys tab.
  3. Click Add key.
  4. Enter a key name.
  5. Paste the public ADB key you copied when creating the ADB key pair in step 3.
  6. Click Add.

4. Connect to the device via ADB

  1. In the control panel, on the top menu, click Products and select Mobile Farm.

  2. Go to the Devices section.

  3. In the device row, click the device manufacturer and model.

  4. Under the device name, copy the command to connect to the mobile farm device, for example:

    adb connect adb.mobfarm.servercore.com:3094

    Where:

    • adb.mobfarm.servercore.com — the DNS address for connecting to mobile devices; ;
    • 3094 — an example of a connection port.
  5. Open the CLI.

  6. Connect to the device by running the command you copied in step 4.

    Even if the connection is successful, you will see an authentication error in the response:

    failed to authenticate to adb.mobfarm.servercore.com:3094

    Where:

    • adb.mobfarm.servercore.com — the DNS address for connecting to mobile devices; ;
    • 3094 — an example of a connection port.
  7. Ensure that the connection is established. To do this, request a list of connected devices:

    adb devices -l

    The response will list the connected devices. For example:

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