Schedule Unattended Phoma Flows on Android Test Phones
If your team runs the same checks on Android phones every morning--login smoke tests, daily data entry, end-of-day reconciliation--doing it by hand eats time and invites missed steps. Phoma lets you build those flows visually on a Windows PC and run them on your own Android phones. Scheduling turns a manual ritual into an unattended job that runs while you are away.
This guide walks through preparing phones, building a flow that can run without supervision, setting a schedule across one or many devices, and reviewing results. Everything runs on your computer and phones. Individual use is free with no limit on phones or flows; Team and Business plans are for sharing phones and flows with colleagues.
1. Prepare the phones for unattended runs
A scheduled flow fails most often because the phone went to sleep, the screen locked, or USB debugging timed out. Fix the environment before you set the schedule.
- Enable Developer options and USB debugging on each phone. When Phoma connects, check Always allow so the authorization dialog does not block later runs.
- Turn on Stay awake so the screen stays on while the phone is charging. This keeps the display available for mirroring and control.
- Set Screen timeout to the longest available value, or disable the lock screen during the scheduled window. A locked phone can interrupt adb input events.
- Disable battery optimization for the app under test and for any background services Phoma uses. Aggressive power saving can pause the app or cut the adb connection.
- Keep the phones plugged into stable power and, if using wireless debugging, on the same reliable Wi-Fi as the PC.
- Decide whether the flow should open the app itself or assume the app is already open. For unattended runs, include an Open app step so the flow starts from a known state.
Real-world example: a QA team runs a nightly checkout flow on five test phones. They leave the phones on a charging cart, enable Stay awake, and disable lock screens from 10 p.m. to 6 a.m. so the schedule never meets a black screen.
2. Build the flow for unattended execution
Because no one will be watching, the flow must handle timing and UI changes on its own. Phoma flows are visual: you add steps in the app and point to elements with selectors.
Use selectors that survive app updates. Prefer stable attributes such as resource-id or content-desc over visible text or positional indexes.
Good selector:
resource-id="com.example.myapp:id/submit_button"
Risky selector:
text="Submit"
or an XPath that depends on the third button in a list. If the design changes, the risky step breaks.
Add explicit waits before every important interaction. A Wait for element step tells Phoma to pause until an element appears, up to a timeout you set. This is better than a fixed sleep because it proceeds as soon as the UI is ready.
Example unattended checkout flow:
Step 1: Open app
Package: com.example.store
Activity: .MainActivity
Step 2: Wait for element
Selector: resource-id="com.example.store:id/login_screen"
Timeout: 15 seconds
Step 3: Type text
Selector: resource-id="com.example.store:id/username"
Text: tester01
Step 4: Type text
Selector: resource-id="com.example.store:id/password"
Text: P@ssw0rd!
Step 5: Tap
Selector: resource-id="com.example.store:id/login_button"
Step 6: Wait for element
Selector: resource-id="com.example.store:id/dashboard_header"
Timeout: 15 seconds
Step 7: Tap
Selector: resource-id="com.example.store:id/reset_data_button"
Step 8: Screenshot
Label: checkout_reset_complete
If your app regularly shows a welcome popup after login, add a conditional step near the top: if the popup element exists, tap Close; otherwise continue. Keep conditions narrow so they do not mask real failures.
3. Choose devices and set the schedule
Open the flow in Phoma and select the devices that should run it. You can run one flow on many phones at once, or one after another.
Running in parallel saves time but uses more PC resources and adb bandwidth. Run sequentially if the phones share a weak Wi-Fi connection or if the flow performs heavy HTTP requests that could overwhelm your network.
In the schedule settings, pick:
- Frequency: daily, weekly, or a custom interval.
- Time and time zone: choose a window when the phones are charging and the PC is awake.
- Run condition: only if the device is connected, or attempt anyway and mark unreachable devices as failed.
Remember that flows run on your computer. The Windows PC running Phoma must stay on and should not enter sleep mode during the scheduled window. Adjust Windows power settings if necessary.
4. Watch the run and interpret results
When the schedule triggers, Phoma controls each phone through adb and screen mirroring. You can watch live from the Phoma dashboard or review afterward.
For each device, the run record shows:
- Which steps passed and which failed.
- The step where execution stopped.
- Screenshots captured at checkpoints.
- Total run time.
If one phone fails, parallel runs continue on the other phones. You do not lose the whole batch because of a single bad cable or a sleepy device.
5. Fix common failures and rerun
The most common unattended failures are:
- Element not found: the app updated and the selector changed. Open the element tree in Phoma, pick the new element, and update the step.
- Phone asleep: verify Stay awake and power settings.
- USB disconnected: check the cable and re-authorize debugging if the Allow USB debugging dialog reappeared.
- App not in expected state: add an Open app step at the start so every run begins from the same screen.
After fixing the flow, run it manually on one device first. Once it passes, re-enable the schedule and let it run overnight.
6. Sharing schedules with a team
Individual Phoma use is free, with no limit on phones or flows. If you want teammates to view the same phone pool, edit shared flows, or see each other's run history, that requires a Team or Business plan. Schedules themselves are configured in the Phoma desktop app; there is no public API or CLI to trigger them from external systems.
Quick pre-schedule checklist
- USB debugging enabled with Always allow checked
- Stay awake on; screen timeout extended
- Battery optimization disabled for the test app
- Phones on stable power and network
- Flow uses stable selectors and Wait for element steps
- Open app step included as step one
- PC power settings prevent sleep during the window
- Manual run passed on one device
Schedule the flow, check the first morning's run history, and you have replaced a repetitive manual task with a reliable unattended check.
