Skip to content

Compiling & Running on Android

The Arctic Fox edited this page Jul 20, 2026 · 3 revisions

Advanced Server — Compiling & Running on Android

This guide walks through building Advanced Server from source on an Android device using Termux and connecting to it locally from the game running on the same phone.

The test device used in this guide is a Redmi phone flashed with LineageOS and rooted. That said, root access is not required — you can host a server on stock factory firmware just as well. Root only gives you extra system-level capabilities that Advanced Server itself does not need.

The compilation takes roughly 4 minutes on a mid-range Android device. You will need a working internet connection for the package installation and git clone steps.

Step 1 — Install Termux

Open Google Play Store, search for terminal or termux, and install Termux by Fredrik Fornwall.

Screenshot_20260429-233325_Google Play Store Screenshot_20260429-233354_Google Play Store

Step 2 — Install Rust & Git inside Termux

Open Termux and run:

apt install -y rust git

This installs the Rust compiler toolchain and Git. The download is several hundred megabytes — wait for it to finish before proceeding.

Screenshot_20260429-233726_Termux

Step 3 — Clone the repository

Clone the Advanced Server source and enter the directory:

git clone https://github.com/thearcticfox25/AdvancedServer.git
cd AdvancedServer
Screenshot_20260430-000040_Termux Screenshot_20260430-000124_Termux

Step 4 — Build in release mode

Compile the server with optimisations enabled:

Screenshot_20260430-000142_Termux
cargo build --release

Cargo will download and compile all dependencies. On a typical mid-range phone this takes around 4 minutes. The compiler will emit several warnings — this is expected.

Step 5 — Set up an instance directory and run

Create a folder for the server instance, copy the compiled binary into it, and launch it:

Screenshot_20260430-000704_Termux
mkdir ~/AS-test-instance
cp ./target/release/AdvancedServer ~/AS-test-instance/
cd ~/AS-test-instance
./AdvancedServer

The server will generate a default config.toml on first run. You can edit it before restarting — see the Config Reference for all available options.

Advanced Server is a command-line program — you start it, stop it, and observe its output entirely through the terminal. This is the standard and universal approach for server software: it keeps the program lean, scriptable, and easy to manage over SSH or inside any terminal emulator regardless of the operating system.

Step 6 — Connect from the game

Open Sonic.exe — The Disaster 2D Remake on the same device. Go to Join Game and enter localhost as the IP address.

Do not press the Host button in the game — the server is already running in Termux. The game's built-in host function starts a different, unrelated server process. Simply enter the IP and join as a client.

Screenshot_20260430-000757_Sonic Exe Disaster 2D Remake Screenshot_20260430-000808_Sonic Exe Disaster 2D Remake

Result

The server is now running on the phone and accepting connections. Players on the local network can join by entering the phone's local IP address instead of localhost.

Screenshot_20260430-003638_Sonic Exe Disaster 2D Remake

Do not try to embed Advanced Server into a modded TD2DR build. The blocker is not the server's internal logic — it's the user interaction model. Advanced Server is operated entirely through a terminal: commands, output, and control all go through stdin/stdout. That interface becomes impossible to use when the server is embedded as a component inside a game process. On top of that, the server relies on its own config files and data storage on disk — path conventions, working directory, and file layout that simply have no place inside a game's directory structure.

For reference: the original server that Advanced Server evolved from could technically be embedded — but only because it had no user interface whatsoever. Advanced Server added a proper CLI on top of that foundation, and it is precisely that addition which makes embedding impractical.