📚 Encyclopedia

Android · updated 2026-10-13

Testing SMS and MMS with one phone

androidmmssmsadblogcattestingtwilio

Proven method for testing an Android SMS/MMS app when there is only one phone with service: send a picture to your own number. On AT&T it goes out through the MMSC and comes back as a real incoming MMS (WAP push plus download), so one message exercises both directions, and logcat separates the stages.

Recipe

  1. Build and install the release APK.
  2. Grant the SMS role without the UI dialog: adb shell cmd role add-role-holder --user 0 android.app.role.SMS <package> (the role survives a reinstall but not an uninstall).
  3. Self-send a picture with logcat running, then find the stage that went quiet: adb logcat -d -s MmsSender:* MmsSentReceiver:* MmsReceiver:* MmsDownloadedRcvr:* (log tags are truncated to 23 characters on older Android, so check the exact tag).
  4. adb logcat -b radio shows whether a WAP push ever reached the device: no push means the carrier dropped it, a push with no row means your receive path is broken.
  5. adb shell dumpsys package <pkg> | grep -e version -e lastUpdateTime tells which build handled which event.

Before touching code when MMS "breaks", verify ground truth: is the current build installed, and does the app hold the role (cmd role get-role-holders android.app.role.SMS)?

Options that do not work (as of 2026)

Device quirks seen (ZTE NX733J, Android 16, AT&T)

When the test phone is someone's daily phone

Check the foreground before injecting input: adb shell "dumpsys activity activities | grep -m1 ResumedActivity". A swipe once landed on an active call screen. A call can be running in the background too (timer chip in the status bar); keep interactions brief and stop if a call is active.

Instrumentation tests

Run with adb shell am instrument rather than ./gradlew connectedDebugAndroidTest, which reinstalls the app and resets the default SMS role.

See also

Linked from

Sources: message memory (reference_twilio, project_mms_debugging, project_testing)