BYTESLIP ← Back
Knowledge Base // Desk Marathon

The Termux Marathon Switch: Keep Android Awake on the Charger Without Another App

Difficulty: Advanced ~2 min Developer options

You kick off a pkg upgrade, a proot distro install or a long build in Termux, set the phone down on the desk, and turn back to the laptop. Thirty seconds later the screen dims and locks, and now you’re unlocking it every few minutes just to watch progress scroll by. Same deal when you’re screen sharing a phone demo or reading logs at the bench.

The Play Store will happily sell you a “keep screen on” app with ads and a permission list longer than your build log. You don’t need it. Android has had this switch built in for years: Stay awake, hidden in Developer options. While the phone is plugged in, the screen never sleeps. Unplug it and normal timeouts come back.

My rule: it’s a marathon switch, not a lifestyle. Turn it on for the long job, then turn it off.

Stay awake while chargingPhone plugged into a charger with an always-on screen indicator.STAY AWAKEWHILE PLUGGED IN
Checklist // Before You Start

What You Need

Battery & heat tradeoff: Stay awake only works while plugged in, but a lit screen plus a CPU‑heavy compile is a toasty combo. The phone can charge slower and run warm. Drop brightness to the minimum you can read, keep the phone out of direct sun and off soft surfaces, and don’t make “screen on all night” a habit. It does not keep the screen on when running on battery alone.

Walkthrough // Steps 01–04

Flip the Marathon Switch

  1. Step 1: Enable Developer options

    Settings > About phone → tap Build number seven times (Samsung: About phone → Software information → Build number). Yes, it really is a secret knock.

  2. Step 2: Turn on Stay awake

    Settings > System > Developer options (search Stay awake if your build hides it).

    Under General options, enable Stay awake. Android Developers’ wording: it “sets your screen to stay on while the device is plugged in.”

  3. Step 3: Verify with a charger

    Plug in, then wait past your normal screen timeout. The display should stay lit. Unplug and the usual timeout comes back. Unplugging is your off switch for the day.

  4. Step 4: Turn it off when the marathon ends

    Developer options → disable Stay awake. Or flip the master Use developer options switch off when you’re done with developer tools entirely.

Notes // Samsung

Samsung Galaxy

Same Stay awake toggle under Developer options after Build number ×7 (ANS10003430). Samsung warns Developer options aren’t meant for typical use and may affect performance, which is one more reason to leave Stay awake off day to day.

Field Notes // Do You Even Need It?

Stay Awake vs. the Cheaper Fixes

Pro Tip

Leave Yourself a Note

Sources // Verified

Official docs

Configure on-device developer options — General options → Stay awake. Samsung enable path: ANS10003430.

← All Tutorials Byteslip Apps