[{"data":1,"prerenderedAt":20},["ShallowReactive",2],{"blog-post-en-automate-daily-device-health-checks-with-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-daily-device-health-checks-with-phoma","en","Automate Daily Device Health Checks with Phoma","A step‑by‑step guide to building a visual Phoma flow that monitors battery, storage and app version on Android phones, then runs it on multiple devices on a daily schedule.","2026-11-14",[10,11,12,13,14],"automation","phoma","device-health","qa","android",[10,11,12,13,14],"https://blog-api.phomaapp.com/api/blog/posts/automate-daily-device-health-checks-with-phoma/thumbnail.svg?lang=en",[5],"## Why Automate Device Health Checks\n\nKeeping a fleet of Android phones in good shape is essential for any QA team, operations staff, or small business that relies on a few devices for daily tasks. Manual checks for battery level, storage usage, or app version are time‑consuming and error‑prone. By automating these checks with Phoma you gain three concrete benefits:\n\n1. **Early detection** – low battery or full storage can cause crashes or data loss before they affect users.\n2. **Consistency** – the same criteria are applied to every device, eliminating human variability.\n3. **Hands‑free monitoring** – once scheduled, the flow runs automatically even when you are not at the computer.\n\nPhoma’s visual flow builder lets you create these checks without writing a single line of code, making the process accessible to testers, developers, and operations staff alike.\n\n## Prerequisites\n\n- **Phoma desktop app** installed on a Windows PC (latest stable version). \n- **Android phone** with USB debugging enabled (Developer Options → USB debugging). \n- **USB drivers** for your device installed on the PC, or a Wi‑Fi ADB connection if you prefer wireless debugging. \n- **At least one phone** to test the flow; additional phones can be added later for parallel execution.\n\n> **Tip:** Verify the connection in Phoma’s *Device List* before creating a flow. If the phone does not appear, re‑enable USB debugging or reinstall the drivers.\n\n## Connect Your Phone via USB (or Wi‑Fi)\n\n1. Open **Developer Options** on the phone (tap *Build number* seven times in *About phone*).\n2. Enable **USB debugging**. This allows Phoma to communicate with the device over the USB cable.\n3. Connect the phone to the PC using a good quality USB cable.\n4. In Phoma, click **Refresh** in the *Device List* panel. The device should appear with its model name and Android version.\n5. (Optional) For wireless debugging, enable **Wireless debugging** in the same Developer Options, note the IP address and port, then in Phoma choose **Connect via Wi‑Fi** and enter the details. The phone will prompt you to accept the debugging connection.\n\nOnce the device is listed, you can proceed to build the flow.\n\n## Build the Health Check Flow\n\n### Step 1 – Create a New Flow\n\n- In Phoma’s main window, click **New Flow**.\n- Give it a clear name, e.g., **Daily Health Check**.\n- Choose **Start from Home Screen** as the trigger (this ensures the phone is on the home screen before any action).\n\n### Step 2 – Add the Core Actions\n\n| Action | Purpose | How to configure |\n|--------|---------|------------------|\n| **Tap Home** (or **Launch App**) | Ensure the phone is on the home screen or a known app. | Use the built‑in **Tap** step on the home icon (`resource-id=android:id/home`). |\n| **Read Battery Level** | Capture the current battery percentage. | Add a **Read Text** step. Set the selector to the battery text element (see selector example below). |\n| **Read Storage Usage** | Capture the percentage of internal storage used. | Add another **Read Text** step with the storage element selector. |\n| **If** (condition) | Trigger a warning when thresholds are breached. | Insert an **If** step. Condition: `battery \u003C 20` **OR** `storage > 80`. |\n| **Log Warning** | Record a visible message when the condition is true. | Inside the *If* block, add a **Log** step with text \"Low battery or high storage detected\". |\n| **Log Info** | Record success when everything is fine. | Outside the *If* block, add a **Log** step with text \"Device health OK\". |\n\n#### Example Selectors\n\n```xml\n\u003C!-- Battery level text element -->\n\u003Celement selector=\"resource-id=android:id/battery\" class=Text>\n```\n\n```xml\n\u003C!-- Storage usage text element -->\n\u003Celement selector=\"resource-id=android:id/storage\" class=Text>\n```\n\nThese selectors use the **resource‑id** attribute, which is stable across most Android versions and survives app updates. Avoid using text content alone, because UI strings can change with localisation.\n\n### Step 3 – Wire the Steps Together\n\n1. Drag the **Tap Home** step onto the canvas and connect it to the **Read Battery** step.\n2. Connect **Read Battery** to **Read Storage**.\n3. Connect **Read Storage** to the **If** condition.\n4. From the **If** condition, draw two branches:\n   - *True* → **Log Warning**\n   - *False* → **Log Info**\n5. Finally, connect the **Log Warning** and **Log Info** steps to a **End** node.\n\nThe flow now reads two key health metrics, evaluates them against simple thresholds, and logs an appropriate message.\n\n## Run and Verify on a Single Device\n\n- Click the **Run** button in the toolbar.\n- Phoma will launch the flow on the selected device, execute each step, and display a real‑time log panel.\n- Verify that the log shows either \"Device health OK\" or \"Low battery or high storage detected\" based on the current phone state.\n- If the log is empty or shows errors, double‑check the selectors. You can use Phoma’s **Element Inspector** (right‑click a step → *Inspect*) to capture the exact resource‑id of the battery or storage text.\n\n## Run on Multiple Devices Simultaneously\n\nPhoma supports parallel execution, which is ideal for teams that maintain a device lab.\n\n1. In the flow editor, open the **Run Settings** panel.\n2. Tick **Run on Multiple Devices**.\n3. Select all connected phones (you can add devices by clicking **+ Add Device**).\n4. Choose **Run on All Devices** or **Run on Selected Devices**.\n5. Press **Run**. Phoma will launch the flow on each device at the same time, collecting separate logs for each.\n\nThis capability lets you verify that the same health criteria hold across a fleet, catching device‑specific regressions early.\n\n## Schedule the Flow for Daily Runs\n\nAutomation is most valuable when it runs without manual intervention.\n\n1. Switch to the **Scheduler** tab.\n2. Click **Add Schedule**.\n3. Set the **Time** (e.g., 02:00 AM) and **Recurrence** (Daily).\n4. Under **Devices**, choose **All Connected Devices** (or a specific subset).\n5. Optionally enable **Run only when screen is off** to avoid interfering with the user.\n6. Save the schedule.\n\nPhoma will now execute the health‑check flow automatically each day, even if the PC is idle or the user is logged out. All logs are stored in the **Run History** view, where you can filter by date, device, or result type.\n\n## Share the Flow with Your Team\n\nFor organizations that use a shared device pool or a small QA team, Phoma’s **Team Library** makes collaboration straightforward.\n\n- In Phoma, go to **Team Library** → **Upload Flow**.\n- Name the flow (e.g., *Daily Health Check – Team*).\n- Assign **Team** or **Business** permissions so that colleagues can view, edit, or run the flow on their own devices.\n- Team members can pull the flow, modify thresholds (e.g., change the low‑battery limit), or add extra checks such as **Read App Version**.\n\nBecause the flow is built visually, every team member sees the same logical steps, reducing miscommunication and ensuring consistent monitoring.\n\n## Takeaways\n\n- **Automated health checks** provide early warnings about battery, storage, or app version issues, helping prevent crashes and data loss.\n- Phoma’s **visual flow builder** eliminates the need for custom scripts while still offering powerful actions like reading UI text and conditional logic.\n- **Stable selectors** based on resource‑ids keep the flow robust across app updates and device model changes.\n- **Parallel execution** lets you monitor multiple phones at once, ideal for device labs or small businesses.\n- **Scheduling** turns a manual daily check into a fully hands‑free process, freeing staff time for higher‑value tasks.\n- **Team sharing** ensures that the same reliable health‑check routine is used across the whole organization.\n\nBy following the steps above, you can create a repeatable, low‑maintenance automation that keeps your Android devices in optimal shape, improves reliability, and reduces the operational overhead of manual monitoring.\n","https://blog-api.phomaapp.com/api/blog/posts/automate-daily-device-health-checks-with-phoma/assets",1796035640149]