Skip to main content
This guide will help you get Mobilerun running in a Docker container, controlling your Android device through natural language without installing it natively.

Host configuration

Follow the steps below to ensure your host system is properly configured to mount the smartphone inside the container.
  1. Make sure you’ve completed the prerequisite steps in the Quickstart. Then verify the ADB connection with adb devices. This should list your phone as “device” along with its Serial Number. If the phone appears as unauthorized make sure to accept the prompt on your phone.
  2. Confirm that the ADB keys have been correctly created. Check for an .android folder under your $HOME directory that contains: adb.5037, adbkey, and adbkey.pub.
  3. Set up a custom rule to uniquely identify your phone and map it to a static path:
    • Open a terminal and find your device’s idVendor and idProduct using the lsusb command. In the example below, the idVendor and idProduct are 18d1 and 4ee2, respectively.
    • Create a new file (sudo may be required) under /etc/udev/rules.d and name it 51-android.rules.
    • Add the following content and save the file:
      where XXXX, YYYY, and SSSS are the vendor ID, product ID, and serial number of your phone. This static mapping is required because otherwise the phone’s mount path will change across reconnections!
    • Reload the rules
  4. Kill the ADB server on the host so that the container can actually detect the phone:

Usage

Pull the image from the GitHub Container Registry:
Before running the container, note that the following options are always required when launching Mobilerun in Docker: The Docker image uses the mobilerun entrypoint, which means you can use any of the CLI commands described in the CLI Usage section and append it to the following base command:

Set Up the Portal APK

Simply run the container with the setup CLI command.

Verify the setup

Simply run the container with the ping CLI command.

Run some agents

Now you’re ready to control your device using Docker and natural language:

Troubleshooting

  • Error response from daemon If you encounter the following error:
    it usually indicates one of two things:
    • The phone isn’t mounted at the expected custom path. Verify that /dev/phone1/phone exists.
    • An ADB server is still running on the host. Stop it with adb kill-server.

Next Steps

  • CLI Usage - Dive into the various parameters and start building your own projects with Docker!