Home
/
Guides
/
Mobile development

Mobile development

Compiling mobile applications are resource-intensive, but Coder allows you to leverage cloud resources to save time compiling while still keeping your native emulator experience.

Android

You can use the Android emulator on your local machine to build and debug apps developed remotely on Coder.

  1. Install Android Studio onto your local machine.

  2. Start Android Studio, and when prompted, install the SDK.

    Android SDK Install

  3. Create and start a Virtual Device.

    Android Device

  4. Create a workspace variable called ANDROID_SDK_PATH and set it to the installation path of your Android SDK (for example, it's typically ~/Library/Android/sdk on macOS and C:\Users\<USER_NAME>\AppData\Local\Android\sdk on Windows).

    Android SDK Path

  5. Start the Android Debug Server on port 5555:

    $ $ANDROID_SDK_PATH/platform-tools/adb tcpip 5555
    restarting in TCP mode port: 5555
    
  6. Create a Coder workspace that includes the Android SDK; you can do this by including the following in your Dockerfile:

    FROM codercom/enterprise-android
    

    Alternatively, you can import or extend Coder's image

  7. Forward your Android Debug Server to the remote workspace:

    # You must have the Coder CLI installed.
    $ coder config-ssh
    $ ssh -R 5555:127.0.0.1:5555 coder.<NAME_OF_YOUR_WORKSPACE>
    
  8. Run adb devices to view the emulators forwarded from your local machine:

    $ adb devices
    List of devices attached
    emulator-5556
    
  9. Build and run your Android applications remotely:

    ./gradlew android:installDebug
    
See an opportunity to improve our docs? Make an edit.