Termux e' l'emulatore Linux piu' potente per Android: kernel condiviso col telefono, ma userspace Debian-like completo, con oltre 2000 pacchetti installabili via apt. Il tutto senza root.
1. Installazione
NON dallo Play Store: quella versione e' obsoleta (aprile 2020) e non riceve piu' update. Usa F-Droid:
- Scarica F-Droid da
f-droid.org - In F-Droid cerca "Termux" e installa
- Installa anche Termux:API e Termux:Boot se vuoi accedere a sensori/notifiche
2. Primo avvio
pkg update && pkg upgrade
termux-setup-storage # accede a /sdcard
3. Installazione strumenti essenziali
pkg install
openssh
git
nano
vim
tmux
htop
tree
curl
wget
python
nodejs-lts
rsync
file
zip
unzip
4. SSH server: telefono raggiungibile via rete
pkg install openssh
passwd # imposta password
sshd # avvia server (porta 8022)
whoami # es. u0_a123
ifconfig | grep inet # trova IP del telefono
Da un altro pc:
ssh -p 8022 u0_a123@192.168.1.42
5. Git + GitHub
pkg install git gh
git config --global user.name "Nome"
git config --global user.email "email@example.com"
gh auth login # login a GitHub, salvato in keychain
6. Python dev environment mobile
pkg install python
pip install --upgrade pip
pip install requests fastapi uvicorn ipython
python -m ipython # REPL potente
7. Termux API: accedi ai sensori del telefono
Con l'app Termux:API installata:
pkg install termux-api
termux-battery-status # JSON con stato batteria
termux-location # GPS
termux-sms-list -l 10 # ultimi 10 SMS
termux-notification -t "Ciao" -c "Test da Termux"
termux-tts-speak "hello world" # text-to-speech
8. Wake lock (evita che Android termini Termux)
termux-wake-lock # tiene attivo Termux
# ...i tuoi processi lunghi qui...
termux-wake-unlock # libera
9. Backup del tuo ambiente
tar -czf termux-backup-$(date +%F).tgz -C /data/data/com.termux/files ./home ./usr/etc
# Copia il .tgz su cloud/pc via scp/rsync
10. Trucchi produttivita'
- Tasti Volume+ = tasto Ctrl (per Ctrl-C/D/Z)
- Vol- + Q = mostra/nasconde tastiera extra (frecce, tab, esc)
- Long-press schermo per copiare/incollare
tmux new -s workcrea sessione persistente (sopravvive a chiusura app)- Aggiungi shortcut sulla home Android per lanciare direttamente
tmux attach
Nota: Termux funziona ANCHE su tablet Android e ChromeOS con Android subsystem. In particolare su tablet Samsung con tastiera fisica diventa un dev environment ottimo per lavori di scripting/SSH in mobilita', a un decimo del prezzo di un iPad.