← All posts

Termux on a Cloud Android Phone: On-Device Automation (2026)

Oct 14, 2026 · By Xavier Fok

Most automation drives a phone from the outside, over adb from your laptop. Termux flips that around: you run a real Linux shell on the phone itself, so the automation lives on the device. On a cloud phone that’s a powerful combo, because the phone is always on and reachable, so a script you start keeps running long after you’ve closed your laptop. Here’s how to set it up on a remote device.

I run a real cloud phone farm, so this is the on-device automation story for a genuine Android handset on a real SG mobile IP, not an emulator that flakes the moment a script touches a sensor or a real network.

what Termux gives you

Termux is a terminal emulator and Linux environment that runs as a normal Android app, no root required. You get a package manager, Python, Node, cron-style scheduling, SSH, and the standard Unix tooling, all running on the phone. Pair it with the Termux:API add-on and you can also read the phone’s sensors, send SMS, get the clipboard, and trigger notifications from a script.

On a cloud phone the win is location. The script runs on a real device on a real SG mobile IP, so anything network-facing it does looks like a normal phone in Singapore, because it is one.

install it onto the remote phone

You don’t have the Play Store side-by-side, and the Play Store build of Termux is deprecated anyway. Get the F-Droid APK and push it over your network adb connection:

adb connect <phone-host>:<adb-port>
adb -s <phone-host>:<adb-port> install -r termux-app.apk
adb -s <phone-host>:<adb-port> install -r termux-api.apk

Install the main app and the Termux:API add-on together. They have to be signed by the same key, so grab both from the same F-Droid source or the install will refuse with a signature mismatch.

set up SSH so you can reach the shell directly

The cleanest way to work in Termux on a remote phone is to SSH straight into it, instead of poking at a terminal through a screen mirror. Inside Termux:

pkg update && pkg upgrade
pkg install openssh
passwd                 # set a password, or add a key
whoami                 # note the username, like u0_a123
sshd                   # starts the SSH server on port 8022

Termux’s SSH listens on port 8022, not 22. To reach it from your laptop, forward the port over adb and connect to localhost:

adb -s <udid> forward tcp:8022 tcp:8022
ssh -p 8022 u0_a123@127.0.0.1

Now you have a real shell on the phone. Key-based auth is worth setting up so unattended scripts and reconnects don’t prompt for a password.

scheduling jobs on the device

Termux ships cronie for scheduling, plus termux-job-scheduler which hooks into Android’s own job system and survives better across reboots. For a simple recurring task, cron is enough:

pkg install cronie
crontab -e
# run a check every 15 minutes
*/15 * * * * /data/data/com.termux/files/home/check.sh
crond

The catch on Android is power management. The system will try to doze the app and freeze your jobs. Two things keep them alive:

  • Acquire a wake lock so Android doesn’t suspend Termux. Run termux-wake-lock at the start of your session or script.
  • Disable battery optimisation for Termux in the phone’s settings so it isn’t killed in the background.

On a cloud phone this is less of a fight than on a handset in your pocket, because the device is powered and on a rack, but the wake lock is still the difference between a cron job that fires and one that silently never runs.

talking to the phone’s hardware

This is where on-device automation gets interesting. With Termux:API installed, your scripts can read real device state:

termux-battery-status     # real battery JSON
termux-clipboard-get      # current clipboard
termux-clipboard-set "x"  # set it
termux-sensor -s accelerometer -n 1   # one accelerometer reading
termux-notification --title "done" --content "job finished"

Because it’s a real device, these return genuine values. The accelerometer reads real, the battery reads real, the network is a real mobile carrier. That’s the whole reason to do this on a real phone instead of an emulator, where every one of these returns a fake or a flat value that gives the game away.

a small example: a watcher that runs on the phone

Here’s the shape of an on-device script that checks something every few minutes and pings you. Save as check.sh:

#!/data/data/com.termux/files/usr/bin/bash
termux-wake-lock
status=$(curl -s https://example.com/health)
if [ "$status" != "ok" ]; then
  termux-notification --title "alert" --content "health check failed"
fi

Make it executable with chmod +x check.sh, point cron at it, and the phone watches on its own. It keeps running whether or not your laptop is on, which is the point of putting the automation on the device.

gotchas for a remote device

Symptom Cause Fix
ssh connection refused sshd not running or wrong port start sshd, connect on 8022
jobs stop after a while Android dozed the app termux-wake-lock + disable battery optimisation
termux-battery-status hangs Termux:API app not installed install both APKs, same signing key
pkg update fails stale mirror run termux-change-repo and pick a fresh mirror
permission denied on storage storage not granted run termux-setup-storage once

on-device or remote-control?

Both have a place. Driving the phone from your laptop over adb (Appium, scrcpy) is right for UI tests and interactive work. Termux is right for automation that should live on the phone and keep running on its own, network checks, scheduled posts, scraping over the phone’s real mobile IP, anything you want running 24/7 without your machine in the loop. On a cloud phone you can do both against the same device.

where cloudf.one fits

All of this assumes a real, always-on Android device you can adb into and leave running, which is what we run at cloudf.one. Real phones in Singapore on real SG mobile IPs, persistent and dedicated, so a Termux job you start today is still running next week. There’s a free trial on the cloudf.one home page if you want a device to install Termux on and let a script live on. New here? YT30 takes a bit off your first month.

The recipe: push the Termux APKs over network adb, SSH in on port 8022 via an adb forward, hold a wake lock, and schedule with cron. Then the automation runs on the phone, on a real SG mobile IP, whether or not you’re watching.

Get new guides and videos first — join the Telegram channel.

40% off until 31 December 2026
Real phones in Singapore, each with its own mobile IP.
Introductory price until 31 December 2026. A dedicated phone straight away, no queue.