2.3 KiB
Android App Installation Guide
This guide explains how to install the Android app on an emulator or physical device.
Prerequisites
- Android emulator or physical device connected via ADB
- Java installed (for bundletool)
- ADB installed and configured
Installation
Using the Yarn Script
The easiest way to install the app is to use the provided yarn script:
# Set the device ID (emulator or physical device)
export DEVICE=emulator-5554
# Run the installation script
yarn install:android
Manual Installation
If you need to install the app manually, follow these steps:
-
Navigate to the bundle release directory:
cd android/app/build/outputs/bundle/release
-
Build APKs with signing:
java -jar /opt/bundletool-all-1.17.1.jar build-apks \ --mode universal \ --bundle ./app-release.aab \ --output ./app.apks \ --ks /home/jo/lab/alerte-secours/as-app/android/app/debug.keystore \ --ks-pass pass:android \ --ks-key-alias androiddebugkey \ --key-pass pass:android
-
Convert .apks to .zip and extract:
mv app.apks app.zip unzip -o app.zip
-
Install the APK on the device:
adb -s $DEVICE install universal.apk
Troubleshooting
Finding Available Devices
To list all available devices:
adb devices
Example output:
List of devices attached
emulator-5554 device
Common Issues
-
No devices found: Make sure your emulator is running or your physical device is connected and has USB debugging enabled.
-
Installation fails: Check if the app is already installed. You might need to uninstall it first:
adb -s $DEVICE uninstall com.alertesecours
-
Signing issues: If you encounter signing problems, make sure the keystore path is correct and the keystore passwords match.
Custom Installation Script
A custom installation script (install-android.sh
) has been created to simplify the installation process. This script:
- Checks if the DEVICE environment variable is set
- Navigates to the bundle release directory
- Builds APKs with signing
- Converts .apks to .zip and extracts it
- Installs the APK on the device
You can run this script directly:
export DEVICE=emulator-5554
./install-android.sh