# How to Send Mock SMS to Android Emulator Using ADB: Complete Testing Guide


When building Android apps that handle SMS — OTP verification, message parsing, two-factor authentication flows — testing on a physical device means you're dependent on actually receiving messages, which slows things down. The Android emulator solves this cleanly: ADB lets you inject mock SMS messages directly into a running emulator, so you can test your SMS handling logic without a SIM card or a real number.

This guide walks through setting up an emulator if you don't have one, starting it, and sending SMS messages via ADB.

---

## Setting Up an Emulator

If you already have an emulator configured, skip ahead to the next section.

**Install Android Studio** from developer.android.com. During setup, make sure the Android Virtual Device (AVD) Manager component is selected.

**Create a virtual device:**

1. Open Android Studio and go to **Tools > Device Manager**
2. Click **Create Device**
3. Choose a hardware profile — Pixel 5 or Pixel 6 work well for most testing
4. Select a system image (Android 13 or 14 recommended) and download it if it's not already available
5. Adjust RAM and storage if needed, then click **Finish**

---

## Starting the Emulator

**From Android Studio:**

Open Device Manager and click the play button next to your emulator. Wait for it to fully boot before proceeding.

**From the command line:**

List your available emulators:

```bash
<Android SDK path>/emulator/emulator -list-avds
```

Start one by name:

```bash
<Android SDK path>/emulator/emulator -avd Pixel_5_API_33
```

Replace `Pixel_5_API_33` with the name from your AVD list.

**Verify the emulator is running:**

```bash
adb devices
```

You should see output like:

```
List of devices attached
emulator-5554   device
```

If the status shows `offline` instead of `device`, wait a few more seconds for the emulator to finish booting.

---

## Sending a Mock SMS

Once the emulator is running, sending a test SMS is a single command:

```bash
adb emu sms send <phone_number> "<message>"
```

For example:

```bash
adb emu sms send 5551234567 "Your OTP is 849201"
```

The phone number can be any string — it doesn't need to be a real or valid number. The message can be anything, including structured formats your app might parse.

**Verify it arrived:**

Open the Messages app on the emulator. The SMS should appear immediately from the number you specified.

---

## If You Have Multiple Devices Connected

If `adb devices` shows more than one device or emulator, target a specific one with the `-s` flag:

```bash
adb -s emulator-5554 emu sms send 5551234567 "Your OTP is 849201"
```

Use the exact device ID from the `adb devices` output.

---

## Useful ADB Commands for Emulator Testing

**List connected devices:**
```bash
adb devices
```

**Open a shell on the emulator:**
```bash
adb shell
```

**Install an APK:**
```bash
adb install path/to/your-app.apk
```

**Uninstall an app:**
```bash
adb uninstall com.your.package.name
```

**Clear app data (reset app state):**
```bash
adb shell pm clear com.your.package.name
```

**Restart ADB if devices aren't showing:**
```bash
adb kill-server
adb start-server
```

---

## Troubleshooting

**"emulator: command not found"**

The emulator binary isn't in your PATH. Either add `<Android SDK>/emulator/` to your PATH, or use the full path to the binary each time.

**Emulator not appearing in `adb devices`**

Make sure the emulator has fully booted — the home screen should be visible. If it still doesn't appear, restart the ADB server with `adb kill-server` followed by `adb start-server`.

**SMS not appearing in the Messages app**

Some system images handle SMS simulation better than others. If you're on an older image, try updating to a more recent Android version. Also check that the Messages app is set as the default SMS app on the emulator.

---

## Summary

Start the emulator, confirm it's listed with `adb devices`, then run `adb emu sms send <number> "<message>"`. The SMS appears in the emulator's Messages app immediately. This works for any SMS content — OTPs, structured messages, conversation threads — and makes SMS-related feature testing significantly faster than relying on real messages.

