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
- Build and install the release APK.
- 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). - 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). adb logcat -b radioshows 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.adb shell dumpsys package <pkg> | grep -e version -e lastUpdateTimetells 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)
- Twilio toll-free numbers cannot send MMS without business verification (error 30032, "Unverified toll-free number"); a hobbyist cannot get verified.
- AT&T email-to-text gateways (
txt.att.net,mms.att.net) shut down 2025-06-17 and silently drop mail. - An earlier belief that "AT&T self-send loopback does not work" was a misdiagnosis: the app's receive path was broken.
- For an independent second sender, Google Voice web (voice.google.com) sends and receives real MMS from a browser for free.
Device quirks seen (ZTE NX733J, Android 16, AT&T)
Log.dlines are dropped from logcat entirely; only I/W/E appear. UseLog.ifor pipeline diagnostics. Release builds keep log calls unless ProGuard strips them.getDefaultSmsPackage()returns null even when the app holds the role; useRoleManager.isRoleHeld().logcat -T 100applies the 100-line window before tag filtering, so a busy buffer hides your tag. Uselogcat -d -s TAG:*.
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
- Sending MMS from an Android SMS app
- Receiving MMS as the default SMS app
- Driving the Android emulator headlessly for QA