Debug an Android Mobile App

When you develop or test a mobile native or web app, being able to control a device or an app on a low level is a key capability.

So, users are often afraid that they cannot longer use their favorite debugging tools with a cloud-based testing infrastructure.

In webmate, you can use the same tools that you grew accustomed to.

Getting Started

webmate-mobilebridge is a tool that connects your local debugging facilities, such as Android Studio, Google Chrome, or ADB to a specific mobile device in webmate. It also enables you to run local Espresso tests in webmate. Download webmate-mobilebridge: (The latest version of the binary is 1.0.15. If you are not sure which version you are currently using on your computer, run webmate-mobilebridge --version to show its version on the terminal.)

OSLinkSHA-256
WindowsDownload (opens in a new tab)fa5d8fb33882df27bbc2413c409710717311384741a6a58daf00937539be0d4a
MacDownload (opens in a new tab)410fb2f8d6711ea87db3384a952089293b7dbaa502c3258ef1a7b47eab781247
LinuxDownload (opens in a new tab)99ea737c8ce1359bf4a919af8b74b57775998f335cc07660779c91fc60949793

If you are on Linux or macOS, you need to make the downloaded file executable by running chmod +x webmate-mobilebridge in your terminal.
On macOS you additionally need to go to the file’s parent folder using Finder, right-click on the file and select open from the context menu, then open again from the pop-up.
A terminal window should now open, which you can close again.
This is necessary to prevent the Gatekeeper feature in macOS from blocking the execution of webmate-mobilebridge from your terminal later on.

If you (or your security department) need more information about what webmate-mobilebridge does and how it interacts with your local computer, you can read more at Background Information about webmate-mobilebridge .

After you have downloaded the binary, you can start webmate-mobilebridge in its Android mode:

You must replace the <deviceId> placeholder with the device id of the mobile device you want to connect to. You can find it in the device details of your project’s device overview view. The entry is named webmate.deviceId.

The mobilebridge supports both types of webmate API keys. The traditional API key follows the UUID format, e.g. c1e3effb-xxx-xxx-xxx-xxx, and requires the inclusion of the --user (email) in the configuration. On the other hand, the new longer API key, e.g. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=, does not require the --user information.

Instead of specifying the device id directly, you can also set the name of a device with the devicename option. The mobile bridge creation will fail if the name is not unique, i.e., if there is another device with the same name available in some project available to your user. In such a case, you can also limit the project where the device is running in with the project option, which takes the project’s id as an argument.

Starting from version 1.0.12,it is now essential to provide the absolute path to the adb executable using the command-line parameter “–adbpath” when using the webmate-mobilebridge on Windows.

After webmate-mobilebridge is started, you are ready to use Android Studio, Chrome, ADB, or any of the other tools for Android debugging.

Overview: Passing additional Arguments to webmate-mobilebridge

Here you will find an overview table of all arguments that can be passed to webmate-mobilebridge:

ArgumentDescriptionType
-vEnable verbose mode
--helpShow the included help-text
--user REQUIRED: Specify your webmate user/email addressString
--apikey REQUIRED: Specify your webmate API-KeyString
--device REQUIRED: Specify a device to use via ID. You can optionally omit this argument and use the devicename argument mentioned below.String
--devicename Optional: Specify a device to use via name. If –device is omitted, –devicename becomes required.String
--project Optional: Set a specific project to limit device lookup to. Defaults to all projects.String
--proxy Optional: Use a specified URL as a proxy. By default no proxy is used.String
--adbpath REQUIRED on Windows: Path of the adb executableString
--pid <true/false>Optional: If set to true, webmate-mobilebridge will generate a PID file. Defaults to false.Boolean
--max-retry-count Optional: Specify the maximum amount of retries for webmate-mobilebridge. By default, retries will be unlimited.Number
--max-retry-interval Optional: Specify the maximum interval for retries in seconds. Defaults to 0.Number
--server-baseOptional: Use a custom webmate-API-Endpoint to connect against. By default, https://app.webmate.io/api/v1 (opens in a new tab) is used.String