Automate a smoke test of your Android app
Wann einsetzen: You want 'app opens, login, main screen loads' as an auto-run before every release.
Voraussetzungen
- ADB installed and device connected — Android Studio ships ADB;
adb devicesshould show your device - Device has USB debugging or wireless debugging on — Settings > Developer Options > USB Debugging
Ablauf
-
Capture current stateGet the UI state — what screen am I on and what elements are visible?✓ Kopiert→ UI tree with labeled elements
-
Execute the flowTap the 'Sign In' button, type '[email protected]' in the email field, 'P@ss' in password, submit.✓ Kopiert→ App transitions to home
-
Assert successVerify the home screen's 'Welcome' banner is visible. If not, fail.✓ Kopiert→ Pass/fail verdict
Ergebnis: A scriptable smoke test you can run on every build.
Fallstricke
- Coordinates change between device sizes — Prefer State-Tool queries that find elements by label/id, then click the returned coordinates
- Flow breaks on A/B tests — Pin build config or disable experiments for QA builds