All posts

Automate Daily Device Health Checks with Phoma

Automate Daily Device Health Checks with Phoma

Why Automate Device Health Checks

Keeping 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:

  1. Early detection – low battery or full storage can cause crashes or data loss before they affect users.
  2. Consistency – the same criteria are applied to every device, eliminating human variability.
  3. Hands‑free monitoring – once scheduled, the flow runs automatically even when you are not at the computer.

Phoma’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.

Prerequisites

  • Phoma desktop app installed on a Windows PC (latest stable version).
  • Android phone with USB debugging enabled (Developer Options → USB debugging).
  • USB drivers for your device installed on the PC, or a Wi‑Fi ADB connection if you prefer wireless debugging.
  • At least one phone to test the flow; additional phones can be added later for parallel execution.

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.

Connect Your Phone via USB (or Wi‑Fi)

  1. Open Developer Options on the phone (tap Build number seven times in About phone).
  2. Enable USB debugging. This allows Phoma to communicate with the device over the USB cable.
  3. Connect the phone to the PC using a good quality USB cable.
  4. In Phoma, click Refresh in the Device List panel. The device should appear with its model name and Android version.
  5. (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.

Once the device is listed, you can proceed to build the flow.

Build the Health Check Flow

Step 1 – Create a New Flow

  • In Phoma’s main window, click New Flow.
  • Give it a clear name, e.g., Daily Health Check.
  • Choose Start from Home Screen as the trigger (this ensures the phone is on the home screen before any action).

Step 2 – Add the Core Actions

Action Purpose How to configure
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).
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).
Read Storage Usage Capture the percentage of internal storage used. Add another Read Text step with the storage element selector.
If (condition) Trigger a warning when thresholds are breached. Insert an If step. Condition: battery < 20 OR storage > 80.
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".
Log Info Record success when everything is fine. Outside the If block, add a Log step with text "Device health OK".

Example Selectors

<!-- Battery level text element -->
<element selector="resource-id=android:id/battery" class=Text>
<!-- Storage usage text element -->
<element selector="resource-id=android:id/storage" class=Text>

These 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.

Step 3 – Wire the Steps Together

  1. Drag the Tap Home step onto the canvas and connect it to the Read Battery step.
  2. Connect Read Battery to Read Storage.
  3. Connect Read Storage to the If condition.
  4. From the If condition, draw two branches:
    • True → Log Warning
    • False → Log Info
  5. Finally, connect the Log Warning and Log Info steps to a End node.

The flow now reads two key health metrics, evaluates them against simple thresholds, and logs an appropriate message.

Run and Verify on a Single Device

  • Click the Run button in the toolbar.
  • Phoma will launch the flow on the selected device, execute each step, and display a real‑time log panel.
  • Verify that the log shows either "Device health OK" or "Low battery or high storage detected" based on the current phone state.
  • 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.

Run on Multiple Devices Simultaneously

Phoma supports parallel execution, which is ideal for teams that maintain a device lab.

  1. In the flow editor, open the Run Settings panel.
  2. Tick Run on Multiple Devices.
  3. Select all connected phones (you can add devices by clicking + Add Device).
  4. Choose Run on All Devices or Run on Selected Devices.
  5. Press Run. Phoma will launch the flow on each device at the same time, collecting separate logs for each.

This capability lets you verify that the same health criteria hold across a fleet, catching device‑specific regressions early.

Schedule the Flow for Daily Runs

Automation is most valuable when it runs without manual intervention.

  1. Switch to the Scheduler tab.
  2. Click Add Schedule.
  3. Set the Time (e.g., 02:00 AM) and Recurrence (Daily).
  4. Under Devices, choose All Connected Devices (or a specific subset).
  5. Optionally enable Run only when screen is off to avoid interfering with the user.
  6. Save the schedule.

Phoma 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.

Share the Flow with Your Team

For organizations that use a shared device pool or a small QA team, Phoma’s Team Library makes collaboration straightforward.

  • In Phoma, go to Team Library → Upload Flow.
  • Name the flow (e.g., Daily Health Check – Team).
  • Assign Team or Business permissions so that colleagues can view, edit, or run the flow on their own devices.
  • Team members can pull the flow, modify thresholds (e.g., change the low‑battery limit), or add extra checks such as Read App Version.

Because the flow is built visually, every team member sees the same logical steps, reducing miscommunication and ensuring consistent monitoring.

Takeaways

  • Automated health checks provide early warnings about battery, storage, or app version issues, helping prevent crashes and data loss.
  • Phoma’s visual flow builder eliminates the need for custom scripts while still offering powerful actions like reading UI text and conditional logic.
  • Stable selectors based on resource‑ids keep the flow robust across app updates and device model changes.
  • Parallel execution lets you monitor multiple phones at once, ideal for device labs or small businesses.
  • Scheduling turns a manual daily check into a fully hands‑free process, freeing staff time for higher‑value tasks.
  • Team sharing ensures that the same reliable health‑check routine is used across the whole organization.

By 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.