Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ services:
- ./extras:/extras
environment:
- DNS=one.one.one.one
- SDCARD_SIZE=64G
- RAM_SIZE=8192
privileged: true
devices:
Expand Down
14 changes: 13 additions & 1 deletion start-emulator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,17 @@ if [ -f /data/.first-boot-done ]; then
RAMDISK="-ramdisk /data/android.avd/ramdisk.img"
fi

# Define the SD card path
SDCARD_PATH="/data/android.avd/sdcard.img"
SDCARD="-sdcard $SDCARD_PATH"
# Initialize the SDCARD_PATH only if CREATE_SDCARD is true and the sdcard doesn't exist
if [ -n "$SDCARD_SIZE" ] && [ ! -f /data/android.avd/sdcard.img ]; then
echo "Creating SD card..."
# Create the SD card using the specified size
/opt/android-sdk/emulator/mksdcard $SDCARD_SIZE $SDCARD_PATH
echo "SD card created with size: $SDCARD_SIZE"
fi

chmod -x /opt/android-sdk/emulator/crashpad_handler
# Start the emulator with the appropriate ramdisk.img
/opt/android-sdk/emulator/emulator -avd android -nojni -netfast -writable-system -no-window -no-audio -no-boot-anim -skip-adb-auth -gpu swiftshader_indirect -no-snapshot -no-metrics $RAMDISK -qemu -m ${RAM_SIZE:-4096}
/opt/android-sdk/emulator/emulator -avd android -nojni -netfast -writable-system -no-window -no-audio -no-boot-anim -skip-adb-auth -gpu swiftshader_indirect -no-snapshot -no-metrics $RAMDISK ${SDCARD_SIZE:+$SDCARD} -qemu -m ${RAM_SIZE:-4096}