# Set up the phone

Android stops apps that run in the background for long. Setup is four steps on the phone, and each one only turns green once Android confirms it.

## The four steps

1.  **Keep Dukoi running.** Starts Dukoi as a foreground service, with a notification that stays while it runs.
2.  **Turn off battery optimization.** Stops Doze and App Standby from pausing Dukoi.
3.  **Allow child processes.** Stops Android 12 and newer from killing your apps for using too much CPU.
4.  **Steps for your phone’s brand.** Some makers add their own app killer. Dukoi spots the brand and shows only its steps.

The checklist stays on screen until all four are green. If one slips later, the phone, the CLI and the dashboard all show a warning.

## Allow child processes

Your apps run as child processes of Dukoi, and from Android 12 the system can kill those. The fix depends on the Android version:

-   **Android 10 and 11:** nothing to do.
-   **Android 14 and newer:** in Developer options, turn on **Disable child process restrictions**. Dukoi links straight to it.
-   **Android 12 and 13:** run this once from a computer with the phone plugged in and USB debugging on. Dukoi shows it with a copy button.

```sh
$ adb shell device_config set_sync_disabled_for_tests persistent && adb shell device_config put activity_manager max_phantom_processes 2147483647
```

## Steps by brand

Menu names change between versions, so Dukoi shows the right ones for your phone. In short:

- **Google Pixel**: Battery: Unrestricted. Pixels usually need nothing else.
- **Samsung**: Battery: Unrestricted.Take Dukoi out of Sleeping apps and Deep sleeping apps, and add it to Never sleeping apps.Turn off Put unused apps to sleep.
- **Xiaomi, Redmi, POCO**: Autostart: on.Battery saver: No restrictions.Lock Dukoi in recent apps.If apps still stop, turn off MIUI optimization in Developer options.
- **Oppo, Realme, OnePlus**: Allow auto launch and Allow background activity: on.Battery: turn off battery optimization for Dukoi.Lock Dukoi in recent apps.
- **Nothing**: Battery: Unrestricted.Lock Dukoi in recent apps.

## Where to keep the phone

-   Use a spare phone, factory reset, not the one you use every day.
-   Keep it in open air, out of drawers and cases, so it stays cool.
-   Use a good charger and cable, and Wi-Fi rather than mobile data.
-   Give it a fixed address on your router (a DHCP reservation), so its local URLs don’t change.

> Plugged in all day?
> 
> Turn on your phone’s 80% charge limit to save the battery. [Battery care](/docs/battery-care.md) shows how.
