Skip to content

Latest commit

ย 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Android Development Environment for Fedora

A production-grade Android development setup optimised for testing apps on your Fedora workstation before deploying to your Samsung S24.

What This Provides

โœ… Two Emulators:

  • Samsung S24 - Android 14, matches your actual phone
  • Android Latest - Android 15, for testing cutting-edge features
  • Samsung S24 (Android 16) - for matching your phone when itโ€™s on Android 16

โœ… Full Development Toolchain:

  • Android SDK with platform tools
  • Build tools for multiple Android versions
  • ADB (Android Debug Bridge)
  • KVM hardware acceleration for fast emulation

โœ… Easy Maintenance:

  • Simple update commands
  • Version-controlled SDK packages
  • Automated emulator creation

Quick Start

1. Initial Setup (One Time)

cd AndroidDevEnvironment
chmod +x setup.sh
./setup.sh

What it does:

  • Installs Java JDK 17
  • Installs KVM/QEMU for hardware acceleration
  • Downloads Android SDK (~3GB)
  • Creates two emulators
  • Adds convenience commands

Time: 15-20 minutes

After setup: Log out and back in (for KVM permissions)

2. Start an Emulator

Option A: App Menu (Easiest)

  1. Press the Super/Windows key to open your app launcher.
  2. Type "Samsung" or "Android".
  3. Click Samsung S24 Emulator.

Option B: Terminal

android-s24

The emulator window will open. Wait 2-3 minutes for first boot.

3. Deploy Your App

Open a terminal (or your IDE) to your app folder:

cd /path/to/your/app
npm run android

The app installs and launches automatically on the running emulator.

Available Commands

After setup, these commands are available system-wide:

android-s24

Start Samsung S24 emulator (Android 14)

android-s24-16

Start Samsung S24 emulator (Android 16 / API 36)

android-latest

Start Android 15 emulator with latest features

android-devices

List all available Android Virtual Devices

android-update

Update Android SDK and all installed packages

android-status

Show current environment status, installed packages, running emulators

android-ui

Start the Android Test Console (local SPA) with:

  • Emulator/device screen rendered in the centre
  • Click-to-tap and drag-to-swipe input
  • Emulator controls and app install/launch actions
  • Live logcat panel
  • Saved app profiles (APK path, package name, deep link)
  • Conditions panel (Wiโ€‘Fi/Data toggles, emulator network shaping, geo, battery, theme/locale/font)

Emulator Controls

Mouse Interaction

  • Click = Touch/Tap
  • Click and Drag = Swipe
  • Scroll Wheel = Scroll content
  • Right Click = Context menu (on some apps)

Keyboard

  • Works normally for text input
  • Esc = Back button
  • Home = Home button (if enabled)

Side Panel

  • ๐Ÿ”„ Rotate - Switch portrait/landscape
  • ๐Ÿ”Š Volume - Volume up/down
  • โšก Power - Power button/lock screen
  • ๐Ÿ  Home - Return to home screen
  • โ—€๏ธ Back - Navigate back
  • ๐Ÿ“ท Camera - Take screenshot
  • โ‹ฎ More - Additional controls (location, battery, etc.)

Samsung S24 Emulator Specs

Configured to match your actual Samsung S24:

  • Android Version: 14 (API 34)
  • Screen: 1080x2340, 425 DPI (6.2")
  • RAM: 8GB
  • Storage: 8GB
  • Features: Camera, GPS, Sensors, Audio

Android Latest Emulator Specs

For testing newest Android features:

  • Android Version: 15 (API 35)
  • Device Profile: Pixel 8 Pro
  • Features: All latest Android 15 APIs

Updating the Environment

Update SDK Packages

android-update

This updates:

  • Platform tools (adb, fastboot)
  • Build tools
  • System images
  • Emulator itself

Update to Newer Android Version

When Android 16 is released:

sdkmanager --install "platforms;android-36"
sdkmanager --install "system-images;android-36;google_apis_playstore;x86_64"

# Recreate latest emulator
avdmanager delete avd -n Android_Latest
echo "no" | avdmanager create avd \
    -n Android_Latest \
    -k "system-images;android-36;google_apis_playstore;x86_64" \
    -d "pixel_9_pro"

Or just re-run ./setup.sh (it updates automatically).

Testing Workflow

For New Apps (e.g., Breathing App)

  1. Start emulator:

    android-s24  # Use S24 to match your phone
  2. Wait for boot (2-3 minutes first time)

  3. Deploy app:

    cd ~/Documents/BreathingApp
    npm run android
  4. Test thoroughly:

    • All UI interactions
    • Audio playback
    • Data persistence
    • Performance
    • Crashes/errors
  5. Check logs:

    adb logcat | grep -i "error\|crash"
  6. Verify on real device only after emulator testing passes

Android Test Console (UI)

The UI is a focused testing cockpit: the emulator canvas sits in the centre, with controls around it so you donโ€™t bounce between windows.

Start the UI

android-ui

It will open a browser at http://127.0.0.1:4242.

Notes

  • The canvas uses adb exec-out screencap -p, so itโ€™s not a perfect real-time stream, but itโ€™s responsive enough for functional testing.
  • For lower latency, set Interval to ~150โ€“250ms (CPU permitting).
  • App profiles are stored locally in your browser (localStorage). Use Export/Import to move them between machines.

Build & install straight from the console

Use the App project + Build & install panels (left column) to manage your React Native project without leaving the browser:

  1. Configure once

    • Project root: e.g. /home/squigz/Documents/BreathingApp
    • Build command: something that produces an APK (recommended: ./gradlew assembleDebug)
    • APK directory: path to the generated APKs relative to the project (default: android/app/build/outputs/apk/debug)
    • Package name: whichever app id you want auto-launched (e.g. com.innerfire)
    • Toggle Auto launch if you want the console to start the app after every install.
  2. Build

    • Click Build only for a compile, or Build & install to compile and automatically push the freshest APK onto the selected emulator.
    • The Build log panel (right column) streams Gradle/React Native output live, with a follow toggle and a clear button.
  3. Install / re-install

    • The console lists every APK in your output folder. Hit Install next to any entry or use Install latest APK for the newest build.
    • After install, the console can auto-launch the configured package so youโ€™re immediately back on the emulator canvas.

This flow turns the Android Test Console into a single โ€œinteractive test benchโ€: start/kill emulators, build BreathingApp, install it on Android 16, and drive it via the canvas, quick controls, logcat, and condition togglesโ€”all without reaching for the CLI.

For Existing Apps

  1. Install APK on emulator:

    adb install path/to/app.apk
  2. Launch manually from app drawer

  3. Test all features

Performance Optimisation

Enable KVM Acceleration

Already configured! KVM makes the emulator 10x faster.

Verify KVM is working:

kvm-ok  # Should show "KVM acceleration can be used"

Allocate More RAM

Edit ~/.android/avd/Samsung_S24.avd/config.ini:

hw.ramSize=12288  # 12GB instead of 8GB

Use GPU Acceleration

Already enabled with -gpu host flag in launch scripts.

Troubleshooting

Emulator won't start

Check KVM permissions:

groups | grep libvirt  # Should show libvirt

If not, log out and back in.

Emulator is slow

Verify hardware acceleration:

emulator -accel-check

Should show "KVM is installed and usable".

App won't install

Check if emulator is ready:

adb devices
# Should show: emulator-5554  device

If shows "offline" or "unauthorized", wait longer.

Black screen on emulator

Try software rendering:

emulator -avd Samsung_S24 -gpu swiftshader_indirect

"SDK location not found" when building

Create local.properties in your app:

echo "sdk.dir=$HOME/Android/Sdk" > android/local.properties

Disk Space Management

Current Usage

  • Android SDK: ~5GB
  • Each emulator: ~8GB
  • Total: ~20GB

Clean Up Old Packages

# List all installed packages
sdkmanager --list_installed

# Uninstall old build tools
sdkmanager --uninstall "build-tools;33.0.0"

# Delete unused system images
sdkmanager --uninstall "system-images;android-33;google_apis;x86_64"

Delete an Emulator

avdmanager delete avd -n Android_Latest

Directory Structure

AndroidDevEnvironment/
โ”œโ”€โ”€ setup.sh                # Main setup script
โ”œโ”€โ”€ uninstall.sh            # Cleanup script
โ”œโ”€โ”€ config/                 # Configuration files
โ”‚   โ””โ”€โ”€ avd/
โ”‚       โ””โ”€โ”€ s24.ini         # Hardware config for S24
โ”œโ”€โ”€ ui/                     # Android Test Console (local SPA + server)
โ””โ”€โ”€ scripts/                # Helper scripts
    โ”œโ”€โ”€ install-deps.sh     # System dependencies
    โ”œโ”€โ”€ install-sdk.sh      # SDK download and install
    โ”œโ”€โ”€ create-avds.sh      # Emulator creation
    โ”œโ”€โ”€ setup-env.sh        # Environment variables and aliases
    โ””โ”€โ”€ create-desktop-entries.sh # GNOME/Linux desktop shortcuts

Integration with IDEs

Android Studio

Point to existing SDK at ~/Android/Sdk

VS Code

Install "React Native Tools" extension, it will detect SDK automatically.

IntelliJ IDEA

File โ†’ Project Structure โ†’ SDK Location โ†’ ~/Android/Sdk

Uninstalling

If you want to remove everything:

./uninstall.sh

About

My phone environment emulator.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages