[{"data":1,"prerenderedAt":20},["ShallowReactive",2],{"blog-post-en-automate-android-first-run-checks-phoma":3},{"slug":4,"lang":5,"title":6,"summary":7,"date":8,"tags":9,"tag_slugs":15,"thumbnail_url":16,"translations":17,"body":18,"asset_base":19},"automate-android-first-run-checks-phoma","en","Automate Android App First-Run Checks with Phoma","Learn how to build a Phoma flow that verifies Android first-run screens, permissions, and empty states without writing code.","2026-11-28",[10,11,12,13,14],"phoma","android-testing","first-run","qa","ui-automation",[10,11,12,13,14],"https://blog-api.phomaapp.com/api/blog/posts/automate-android-first-run-checks-phoma/thumbnail.svg?lang=en",[5],"## Why first-run flows deserve their own test\n\nThe first launch of an Android app is a special state. There is no cache, no saved preference, and often no user session. A flow that works after the app has been used for weeks can fail immediately after a fresh install because a permission dialog, coach mark, or empty-state screen appears for the first time.\n\nFor QA testers and app developers, first-run checks catch problems that normal regression flows miss: a broken onboarding carousel, a permission prompt that blocks the main screen, a blank home screen, or a call to action that leads nowhere. For operations teams, the same flow can verify that a newly provisioned phone opens the right app state before it is handed to a user.\n\nThis guide shows how to build one focused Phoma flow for first-run validation. Phoma runs on your Windows PC and controls your own Android phones visually, so the flow is built from steps and selectors rather than written code.\n\n## Define the first-run starting point\n\nBefore adding steps, decide what fresh means for the app.\n\n- App data has been cleared, or the app has been uninstalled and reinstalled.\n- The app is not signed in, unless your test intentionally uses a preconfigured test account.\n- No onboarding flag has been set in local storage.\n- The phone has a stable network connection if the app needs one for first-run content.\n\nWrite this definition into the flow name or team notes. A first-run flow is only useful if everyone agrees on the starting state.\n\nIf your team already has a clean-state procedure, use it before this flow starts. The goal here is not to rebuild device cleanup, but to validate what the user sees immediately after the app opens in a fresh state.\n\n## Map the screens you expect to see\n\nRun the app manually once and record the sequence. A simple first-run path might look like this:\n\n1. Splash screen appears for a moment.\n2. Welcome screen shows a primary button such as Get Started.\n3. Optional permissions dialog appears.\n4. Three onboarding pages appear with Next and Skip controls.\n5. Home screen appears with an empty-state message.\n\nTurn each screen into a checkpoint. The more concrete the checkpoint, the easier it is to debug when the flow fails.\n\n### Build a checkpoint list\n\n- Launch completes and a known element appears.\n- Splash screen is gone.\n- Permission prompt is handled.\n- Onboarding can be advanced or skipped.\n- Final destination screen shows expected text.\n- Screenshot evidence is captured at key moments.\n\n## Create the Phoma flow\n\n### Step 1: Launch from a known state\n\nStart the flow by opening the target app. If your team uses a reset step before the flow, place it here. Then wait for the first reliable element instead of relying on a fixed delay.\n\n```text\nOpen app\n  package: com.example.app\n\nWait for element\n  selector: text=Get Started\n  timeout: 10 seconds\n```\n\nA fixed delay is tempting, but first-run screens can be slower on low-end phones or when the app downloads remote configuration. Waiting for an element makes the flow more stable.\n\n### Step 2: Handle the splash screen with a condition\n\nSome apps show a splash screen only on cold start. Others show it every time. Use a condition so the flow does not fail when the splash is absent.\n\n```text\nIf element exists\n  selector: content-desc=Splash screen\nThen\n  Wait for element to disappear\n    selector: content-desc=Splash screen\n    timeout: 8 seconds\n```\n\nIf the splash has no useful text or content description, wait for the next known screen instead. For example, wait for Get Started or the first onboarding page title.\n\n### Step 3: Accept or dismiss first-run permissions\n\nAndroid permission dialogs are system screens, so they can look different across phone makers and Android versions. Do not assume one exact label. Use a small set of acceptable selectors.\n\n```text\nIf element exists\n  selector: text=While using the app\nThen\n  Tap element\n    selector: text=While using the app\n\nElse if element exists\n  selector: text=Allow\nThen\n  Tap element\n    selector: text=Allow\n```\n\nIf the app does not request permissions on first run, the condition simply skips this block. That makes the same flow reusable across builds.\n\n### Step 4: Walk the onboarding carousel\n\nOnboarding screens often use a Next button, page dots, or swipe gestures. Prefer a loop with a maximum count so the flow cannot run forever if the app changes.\n\n```text\nRepeat up to 5 times\n  If element exists\n    selector: text=Next\n  Then\n    Tap element\n      selector: text=Next\n  Else\n    Break loop\n```\n\nIf the button uses an icon instead of text, use a content description or resource id when available.\n\n```text\nselector: resource-id=com.example.app:id/onboarding_next\n```\n\nAfter the loop, verify that the expected final screen appears.\n\n### Step 5: Verify the destination screen\n\nThe final screen should prove that onboarding actually completed. A good check is a stable piece of text, such as a home tab label or an empty-state message.\n\n```text\nWait for element\n  selector: text=No items yet\n  timeout: 10 seconds\n\nRead text\n  selector: text=No items yet\n  save as: first_run_empty_state\n```\n\nIf the app sends the user to a login screen instead of the home screen, decide whether that is expected. For a guest-first app, reaching login may be a failure. For an account-first app, reaching login may be the correct endpoint.\n\n### Step 6: Capture evidence\n\nAdd screenshots at meaningful points, not after every tap.\n\n- After launch, before any interaction.\n- After permissions are handled.\n- On the final onboarding page.\n- On the destination screen.\n\nScreenshots help reviewers see whether a failure came from timing, layout, or an unexpected dialog.\n\n## Choose selectors that survive small app updates\n\nFirst-run screens change often because they are tied to product messaging. Prefer selectors that describe meaning rather than position.\n\nGood choices:\n\n```text\ntext=Continue\ntext=Skip\ncontent-desc=Close\nresource-id=com.example.app:id/btn_primary\n```\n\nAvoid choices like the third child of a layout unless there is no alternative. If you must use a structural selector, combine it with text or a resource id so it is less likely to break.\n\nFor repeated onboarding pages, a content description such as Next page is often more stable than the visible page title, because titles may change with localization or marketing copy.\n\n## Make the flow tolerant of optional screens\n\nFirst-run experiences are full of optional branches:\n\n- A review prompt may appear after a few pages.\n- A network permission dialog may appear only on Wi-Fi.\n- A personalization screen may appear only for new installs.\n- A dark-mode suggestion may appear only once.\n\nUse conditions for each optional screen. If the element is not present, continue. This keeps the flow focused on the main path while still handling common variations.\n\n## Run the flow on more than one phone\n\nFirst-run behavior can vary by Android version, screen size, and device manufacturer. Run the same flow on at least two phones: one clean test device and one older or lower-memory device if your users have them.\n\nIf the flow fails only on one phone, inspect the screenshot. The usual causes are:\n\n- A permission dialog with different wording.\n- A splash screen that lasts longer.\n- An onboarding button below the visible area.\n- A remote first-run screen that failed to load.\n\nAdd alternate selectors or an extra wait for the affected screen, then rerun the flow.\n\n## What to hand off to the team\n\nWhen the flow is stable, share it with the team along with a short note:\n\n- What fresh state means.\n- Which screens are expected.\n- Which selectors are intentionally used.\n- Which failures require a human review.\n\nA first-run flow is most valuable when it gives the team a repeatable answer to a simple question: does the app open into a usable state for a new user? With a small Phoma flow, you can answer that question on every build without writing code.\n","https://blog-api.phomaapp.com/api/blog/posts/automate-android-first-run-checks-phoma/assets",1796035638981]