Host configuration
Follow the steps below to ensure your host system is properly configured to mount the smartphone inside the container.-
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 asunauthorizedmake sure to accept the prompt on your phone. -
Confirm that the ADB keys have been correctly created. Check for an
.androidfolder under your$HOMEdirectory that contains:adb.5037,adbkey, andadbkey.pub. -
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
idVendorandidProductusing thelsusbcommand. In the example below, theidVendorandidProductare18d1and4ee2, respectively. -
Create a new file (sudo may be required) under
/etc/udev/rules.dand name it51-android.rules. -
Add the following content and save the file:
where
XXXX,YYYY, andSSSSare 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
-
Open a terminal and find your device’s
-
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:
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 thesetup CLI command.
Verify the setup
Simply run the container with theping 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/phoneexists. - An ADB server is still running on the host. Stop it with
adb kill-server.
- The phone isn’t mounted at the expected custom path. Verify that
Next Steps
- CLI Usage - Dive into the various parameters and start building your own projects with Docker!