How to keep iPhones running 24/7 for automation
Set each phone's Auto-Lock to Never, turn off Low Power Mode, keep it charging on a powered USB hub, and save its passcode in iFarm so it can unlock itself. On the Mac, let iFarm keep it awake while phones run, enable start at login and reopen after a crash, and set the idle disconnect to Never. After a phone restarts, unlock it once by hand.
The checklist
Most farm outages come from a handful of things: a phone locked itself, a phone restarted and is waiting for its passcode, the Mac went to sleep, or a cable only charges. Here's everything in one place, then the details.
| Where | Setting | Why |
|---|---|---|
| Phone | Auto-Lock → Never | A locked phone can't be driven |
| Phone | Passcode saved in iFarm, or no passcode on dedicated phones | iFarm can unlock it by itself |
| Phone | Low Power Mode off | Keeps the phone at normal speed |
| Phone | Charging, with a charge limit or Optimized Battery Charging | Battery health on a phone that's always plugged in |
| Hardware | Powered USB hub and data cables | Phones charge and stay connected |
| Mac | iFarm keeps the Mac awake while needed | Schedules don't miss their window |
| Mac | Start at login, reopen after a crash | iFarm comes back by itself |
| iFarm | Idle disconnect → Never | Helpers don't stop on locked phones |
| iFarm | Health page | Shows problems before they cost you a night |
On each phone
Auto-Lock: Never
Settings → Display & Brightness → Auto-Lock → Never. This is the single most important setting. iOS won't let anything drive a locked phone.
The passcode
You have two choices:
- No passcode on phones dedicated to the farm. Simplest, and nothing to unlock.
- Save the passcode in iFarm. On the phone's page, save it (it's stored only in your Mac's Keychain) and turn on Keep this phone awake and unlocked, which checks every 30 seconds. Wake and Unlock now do it once.
The one thing a saved passcode can't do: start the helper on a locked phone. Whenever the helper has to start from scratch (after the phone restarts, after iFarm restarts, or after the helper was stopped for being idle), unlock the phone by hand once. iOS won't start the helper on a locked phone, and iFarm can't type the passcode without it. The phone's tile says Unlock the phone by hand to continue when this happens.
Tip: To make hand-unlocking rare, set the idle disconnect to Never (below) and keep every phone charging, so the helper never has a reason to stop.
Low Power Mode off
Turn it off in Settings → Battery. A phone on charge all day doesn't need it, and it slows the phone down.
Charging and battery health
A farm phone sits on a charger around the clock, so give its battery some help:
- iPhone 15 and later: Settings → Battery → Charging lets you set a charge limit between 80% and 100% in 5% steps (Apple Support). 80% is a sensible choice for a phone that never leaves the hub.
- iPhone 14 and earlier: keep Optimized Battery Charging on in Battery Health & Charging. It learns your charging routine and delays charging past 80% when it expects a long session (Apple Support).
Heat
Phones on a shelf, screens on, charging, can get warm. Apple says iPhone works best at 0° to 35° C (32° to 95° F) ambient, that charging in high heat can cause further damage, and that charging inside certain cases may generate excess heat (Apple Batteries). In practice:
- Take the phones out of thick cases.
- Leave space between them, and keep them out of direct sun.
- Keep the room cool. A small fan over the rack is cheap insurance.
- Watch battery levels on iFarm's Health page; a phone that keeps losing charge while plugged in usually has a bad cable or port.
Hubs and cables
- Use a powered USB hub for 3 or more phones. A powered hub carries about 10–15 phones; for more, use several hubs on separate Mac ports.
- Plug into the Mac itself or a powered hub, not a monitor's built-in hub. A display's USB 2 hub can drop the data connection as soon as Xcode starts the helper.
- Use data cables. Some Lightning and USB-C cables only charge, and iFarm's Health page flags a charge-only cable.
- Past about 10 phones on Wi-Fi, use cables. If USB drops, iFarm switches that phone to Wi-Fi (when allowed) without stopping, and moves back when the cable works again.
More detail on choosing hubs and a host Mac: phone farm hardware.
On the Mac
Sleep
While a phone is running, or a schedule or program is on, iFarm keeps the Mac from sleeping on its own. The display can still sleep. This isn't a system setting: it's held by the app and ends the moment iFarm quits. You can switch it off on the Health page. A laptop still sleeps when you close the lid, which is one reason a Mac mini makes a good always-on host.
Start at login and reopen after a crash
On the Health page, press Enable. Move iFarm to your Applications folder first and open it from there. macOS may ask you to approve it in System Settings → General → Login Items. After that, iFarm starts when the Mac does, and if it ever crashes it comes back after 30 seconds. A normal Quit stays quit.
Helper signing renewal
The helper app on each phone is signed with your Apple developer team, and the signature expires: after 7 days on a free Personal Team, after a year on the Apple Developer Program ($99/year). iFarm rebuilds and renews it by itself in the last 3 days, the next time a phone starts. For a farm, the paid program is recommended, simply because there's less to renew.
In iFarm
Idle disconnect
Setup → Preferences → Disconnect a phone after no use for… is 30 minutes by default. It stops an unused helper to save battery. That's fine on your desk, but on a 24/7 farm a stopped helper on a locked phone means unlocking by hand. Set it to Never on phones that are always charging.
Automatic recovery
If a phone's helper crashes or stops answering, iFarm restarts it by itself, waiting longer after each failure (2 s, 5 s, 15 s, 30 s, then 60 s). Unplugging and plugging back in reconnects automatically. During a run, if something gets in the way, iFarm dismisses alerts, taps "Not now" or "Close" buttons, goes back, or reopens the app; if a step still fails, the run stops with a screenshot and the phone is sent Home, so it never sits blocked.
How schedules behave overnight
- Planned runs wait while a phone is busy, offline, stopped from the phone, or in use (its screen changed in the last minute without iFarm touching it). iFarm retries until the window ends.
- A run missed by more than an hour (Mac asleep, iFarm closed) is skipped, not run late. So a Mac that slept through the night won't fire a burst of old runs in the morning.
- History keeps every run with a screenshot when one failed. Check it in the morning.
The Health page
Open Health in the sidebar; its badge counts problems. It shows:
- Capacity: "Room for about N more phones", from your Mac's free memory and what your phones actually use, plus memory pressure and live-view bandwidth.
- Each phone: running time, battery, live-view speed, helper restarts, and anything that needs you (low battery, a charge-only cable, stopped from the phone).
- A hardware checklist: powered hub and data cables, Auto-Lock Never or a saved passcode, Low Power Mode off, unlock once by hand after a phone restarts.
When you need to stop everything
- Stop on a phone, Stop all in the toolbar, or ⌘. on the Mac.
- On the phone itself, hold volume up + volume down together. iFarm stops everything on that phone within a second and shows "Stopped from the phone". Nothing runs there again until you press Resume.
Only run automations on phones dedicated to the farm; a replay taps whatever is on screen, so don't leave one running on a phone someone is using.
Frequently asked questions
Can an iPhone stay on a charger 24/7?
Yes, and a farm phone usually does. On iPhone 15 and later, set a charge limit such as 80%; on older models, keep Optimized Battery Charging on. Keep the phones cool and out of thick cases.
Why does my phone need unlocking by hand after a restart?
iOS won't start iFarm's helper on a locked phone, and iFarm can't type the saved passcode until the helper is running. Unlock it once; after that the saved passcode keeps it unlocked.
Does iFarm change my Mac's sleep settings?
No. It holds the Mac awake from inside the app while phones or schedules need it, and that ends the moment iFarm quits.
What happens to schedules if the Mac was asleep?
Runs that are more than an hour late are skipped. Runs inside their window are retried while a phone is busy or in use.
How often does the helper need re-signing?
Every 7 days on a free Apple developer team, once a year on a paid one. iFarm renews it by itself in the last 3 days, the next time a phone starts.