Android is Linux, right?!

This is a guide on how to turn your Android device into an environment you can develop in.

Basic Setup

  1. Install Termux from F-Droid. (That also means install F-Droid if you don't have it.)

  2. Run pkg update && pkg upgrade, then pkg install git curl

  3. Make yourself feel at home. Sometimes you'll need to do stuff in Termux, so you can install your favorite shell to make that experience more cosy. For me, that means:

    1. Install Fish shell ( apt install fish) and make it the default login shell ( chsh -s $(which fish)), then launch it ( fish)
    2. Install Oh My Fish: curl https://raw.githubusercontent.com/oh-my-fish/oh-my-fish/master/bin/install | fish
    3. Install the robbyrussell theme: omf install robbyrussell
    4. Configure Git:
      1. git config --global user.name "Joe Mama" (replace the name with your own name)
      2. git config --global user.email "joe@example.com" (replace the email with your own)
      3. Set main as the default git branch: git config --global init.defaultBranch main
      4. Generate an SSH key ( ssh-keygen -t ed25519 -C "joe@example.com") and upload the public key to GitHub/GitLab
  4. Now, we'll install a Ubuntu container using PRoot .

    1. pkg install proot-distro
    2. proot-distro install ubuntu
    3. proot-distro login ubuntu
    4. apt update && apt upgrade
    5. apt install sudo adduser git curl wget
    6. Create a new user: useradd joe --ingroup sudo --disabled-password (replace joe with your desired username)
    7. Set password to empty passwd -d joe (where joe is your username)
    8. Allow the user to use sudo without password:
      1. nano /etc/sudoers
      2. add line: joe ALL=(ALL) NOPASSWD:ALL (where joe is your username)
      3. save (Ctrl+O, Enter) and exit (Ctrl+X)
    9. exit
  5. From now on, you can log in to the Ubuntu container using proc-distro login ubuntu -- su -l joe (where joe is your username). I advise you to create an alias for it – for example in my setup, I added alias ubuntu = proc-distro login ubuntu -- su -l joe to ~/.config/fish/config.fish.

  6. Launch the Ubuntu container and make yourself feel at home there, too (eg. repeat Step 3).

Accessing Termux’s Storage From the Container and Vice Versa

From the container, you can find Termux's files under /data/data/com.termux/files/. From Termux, you can access the container's file system via /data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/ubuntu/.

Install Toolchains for Programming Languages