---
title: Connect Android Studio to a cloud Android emulator
description: Connect Android Studio to a Limrun cloud emulator over ADB, run a
  debug build, set breakpoints, and capture Logcat from the same device.
author: Limrun
date: 2026-12-04
url: https://limrun.com/blog/android-studio-cloud-emulator/
---

# Connect Android Studio to a cloud Android emulator

You can run an app from Android Studio on a cloud Android emulator and debug it with breakpoints and Logcat. Limrun runs Android in the cloud. The `lim` CLI opens an Android Debug Bridge (ADB) tunnel on your machine, and Android Studio lists the remote emulator alongside any phones and local emulators you already have.

## Start a cloud emulator and open the ADB tunnel

Install Android SDK Platform-Tools through Android Studio's SDK Manager and make sure `adb` is on your terminal's `PATH`. [Android SDK Platform-Tools](https://developer.android.com/tools/releases/platform-tools)

Install the CLI, sign in, and start an Android 15 emulator:

```bash
npm install --global lim
lim login
lim android create --os-version 15 --rm --no-open
```

The terminal prints the ADB address, such as `127.0.0.1:49923`. Leave the command running while you debug. With `--rm`, pressing **Ctrl+C** closes the tunnel and deletes the emulator.

If a teammate or an agent already created the emulator, copy the instance ID from the running device's console URL. It's the part after `/stream/` that starts with `android_`. Replace `ANDROID_INSTANCE_ID` with that ID:

```bash
lim android connect --id ANDROID_INSTANCE_ID --no-detach
```

This keeps the tunnel in the foreground. When you stop the command, the existing emulator keeps running.

## Run and debug from Android Studio

In a second terminal, run `adb devices -l`. Look for the address printed by `lim` and check that its state is `device`.

1. In Android Studio, open your project and select the cloud emulator in the target device menu. Match its ADB address if you have several devices open.
2. Select **Run** to build and install your app, or set a breakpoint and select **Debug** to launch the debug build with the debugger attached.
3. From the **View** menu, open **Tool Windows**, then select **Logcat**. Select the same device and use `package:mine` to see logs from packages in your open project.

To debug a preview that's already running, open the source for that build. From the **Run** menu, select **Attach debugger to Android process**, then select the app's debuggable process on the cloud emulator. The app keeps running while the debugger attaches. [Attach the debugger to a running app](https://developer.android.com/studio/debug#attach-debugger)

Android Studio still builds with your project's Android SDK and Gradle setup. If you already have an APK, you can install it from your terminal with just ADB:

```bash
# Replace the address with the one printed by lim.
ADB_SERIAL=127.0.0.1:49923
adb -s "$ADB_SERIAL" install -r ./app-debug.apk
adb -s "$ADB_SERIAL" logcat -b crash -d > crashes.txt
```

Use the same serial when you collect logs from a failed test. If you run Appium against the device, pass that address as `appium:udid`. [Run an Android test with Appium](https://docs.limrun.com/testing/appium)

## If the emulator does not show up

- If `adb devices -l` shows no loopback address, check that the tunnel command is still running. If `adb` lives outside your `PATH`, pass `--adb-path` with the full path to the binary.
- If the device shows as `offline`, reconnect to its instance ID and use the newly printed address. The local port can change when you reopen the tunnel.
- If ADB lists the device but Android Studio doesn't, check that Android Studio and your terminal use the same SDK's Platform-Tools. Then check the app's minimum SDK against the emulator's Android version.
- If your app normally talks to a backend running on your laptop, set up a destination tunnel. The ADB tunnel carries debugger traffic to Android. A destination tunnel lets the app reach your backend. [Connect an emulator to local services](https://docs.limrun.com/android/local-services)

For the CLI, MCP, and CI options, see the [cloud Android emulator setup guide](https://limrun.com/blog/android-emulator-for-ai-agents/).
