Write, assemble, link, and really run ARM assembly directly on your Android phone — then step through it in a built-in debugger.
⚠️ Not available on Google Play — sideload only. To genuinely execute code it compiles, ARM Lab must target an older Android API level (28). Google Play requires a newer target, so ARM Lab is distributed as a standalone APK you install yourself. (This is the same technical reason Termux is not updated on Play.)
- Real on-device execution. Your assembly is assembled with
as, linked statically withld, and run as a real Linux process on the phone's CPU — not an emulator. - Two architecture modes
- arm64 (AArch64) — works on virtually every modern phone.
- arm32 (ARMv7) — for older devices. Note: many phones from ~2023 onward are 64-bit-only and physically cannot run 32-bit code; on those, arm32 mode reports a clear "unsupported on this CPU" message.
- Two ways to write code
- Text editor — type assembly directly.
- Visual blocks — drag instruction blocks and plug register/immediate/label operands into their slots; the blocks generate assembly for you.
- Debugger — single-step, breakpoints, and live views of registers, flags, and memory.
- Android 7.0 (API 24) or newer.
- For arm32 mode: a device whose CPU still supports 32-bit (AArch32) execution.
- Installation from outside the Play Store ("install unknown apps") enabled for whichever installer you use.
- Download the APK (or build it — see below).
- Allow installs from your browser / file manager in Settings → Apps → Special access → Install unknown apps.
- Open the APK and install.
git clone <this-repo>
cd android-asm-app
./gradlew installDebug # builds and installs to a connected device/emulatorYou'll need Android Studio (or the Android SDK + NDK) and a device or emulator. See
CLAUDE.md and PLAN.md for architecture and constraints.
Android 10+ forbids apps from executing binaries in their own writable storage
unless the app targets API ≤ 28. ARM Lab targets 28 to keep that ability. The
bundled as/ld ship as native libraries (so they're installed with execute
permission), and your compiled program is linked statically and run from the app's
private files directory.
A device or emulator is required to actually run/debug assembly. These are the
adb commands used to drive and inspect the app during development. Set a shortcut
first:
ADB=/path/to/android-sdk/platform-tools/adb # e.g. .../platform-tools/adbWake the screen and dismiss the lockscreen (a dozing device screencaps black):
$ADB shell input keyevent 26 # power button — toggles the display on
$ADB shell wm dismiss-keyguard # get past the lockscreen
$ADB shell dumpsys power | grep -E 'mWakefulness|Display Power' # confirm Awake/ONLaunch / restart the app:
$ADB shell am start -n com.rockmary.armlab/.MainActivity
$ADB shell am force-stop com.rockmary.armlab # kill it first for a clean startEmulate touches (tap coordinates are x y in pixels):
$ADB shell input tap 436 711 # tap the "Debug" button, for example
$ADB shell input swipe 100 800 100 400 # scroll/swipe
$ADB shell input keyevent KEYCODE_BACK
⚠️ MIUI (the Redmi Note 8T) blocksinput tapinto the app with anINJECT_EVENTSSecurityException, so the UI can't be driven remotely there — tap by hand and verify via logcat. The Zebra TC51 (Android 8.1) does allow injected taps, so it's the better device for scripted UI testing.
Screenshot the current screen:
$ADB exec-out screencap -p > /tmp/shot.png # first capture is sometimes black; retryWatch the logs:
$ADB logcat -c # clear, then reproduce
$ADB logcat -d -s armlab-dbg:* # debugger logs (pid, stops, pc)
$ADB logcat -d | grep -iE 'avc:|armlab' # SELinux + app lines
$ADB logcat -d | grep -i 'avc: denied' # exec-path regressions (should be empty)Inspect the app sandbox / check for stray processes:
$ADB shell run-as com.rockmary.armlab ls -l files/work/arm64
$ADB shell ps -A | grep -E 'files/work|/prog' # orphaned tracees (should be none)ARM Lab bundles the GNU Binutils assembler (as) and linker (ld), which are
licensed under the GNU GPL v3. In accordance with the GPL, the corresponding
source for the bundled binaries is available on request / at the upstream project.
The rest of ARM Lab is licensed under (TBD).