Skip to content

Instantly share code, notes, and snippets.

@badsyntax
Last active May 28, 2025 12:31
Show Gist options
  • Select an option

  • Save badsyntax/4029600db276b0b51342626aebf9400a to your computer and use it in GitHub Desktop.

Select an option

Save badsyntax/4029600db276b0b51342626aebf9400a to your computer and use it in GitHub Desktop.

Revisions

  1. badsyntax revised this gist Aug 3, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion android_emulator_cli_ci.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    ```bash
    # Install AVD files
    $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;android-29;default;x86'
    yes | $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;android-29;default;x86'
    yes | $ANDROID_HOME/tools/bin/sdkmanager --licenses

    # Create emulator
  2. badsyntax renamed this gist Apr 16, 2021. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. badsyntax revised this gist Apr 16, 2021. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions android_emulator_ci.md
    Original file line number Diff line number Diff line change
    @@ -6,13 +6,13 @@ yes | $ANDROID_HOME/tools/bin/sdkmanager --licenses
    # Create emulator
    echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd -n Pixel_API_29_AOSP -d pixel --package 'system-images;android-29;default;x86' --force

    $ANDROID_HOME/emulator/emulator -list-avds

    # Set screen dimensions
    echo "hw.lcd.density=420" >> ~/.android/avd/Pixel_API_29_AOSP.avd/config.ini
    echo "hw.lcd.height=1920" >> ~/.android/avd/Pixel_API_29_AOSP.avd/config.ini
    echo "hw.lcd.width=1080" >> ~/.android/avd/Pixel_API_29_AOSP.avd/config.ini

    $ANDROID_HOME/emulator/emulator -list-avds

    echo "Starting emulator and waiting for boot to complete..."
    nohup $ANDROID_HOME/emulator/emulator -avd Pixel_API_29_AOSP -no-snapshot -no-window -no-audio -no-boot-anim -camera-back none -camera-front none -qemu -m 2048 > /dev/null 2>&1 &
    $ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done; input keyevent 82'
  4. badsyntax revised this gist Apr 16, 2021. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion android_emulator_ci.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    ```bash
    # Install AVD files
    $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;android-29;default;x86'
    yes | $ANDROID_HOME/tools/bin/sdkmanager --licenses
    @@ -17,4 +18,5 @@ nohup $ANDROID_HOME/emulator/emulator -avd Pixel_API_29_AOSP -no-snapshot -no-wi
    $ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done; input keyevent 82'

    echo "Emulator has finished booting"
    $ANDROID_HOME/platform-tools/adb devices
    $ANDROID_HOME/platform-tools/adb devices
    ```
  5. badsyntax created this gist Apr 16, 2021.
    20 changes: 20 additions & 0 deletions android_emulator_ci.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    # Install AVD files
    $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;android-29;default;x86'
    yes | $ANDROID_HOME/tools/bin/sdkmanager --licenses

    # Create emulator
    echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd -n Pixel_API_29_AOSP -d pixel --package 'system-images;android-29;default;x86' --force

    # Set screen dimensions
    echo "hw.lcd.density=420" >> ~/.android/avd/Pixel_API_29_AOSP.avd/config.ini
    echo "hw.lcd.height=1920" >> ~/.android/avd/Pixel_API_29_AOSP.avd/config.ini
    echo "hw.lcd.width=1080" >> ~/.android/avd/Pixel_API_29_AOSP.avd/config.ini

    $ANDROID_HOME/emulator/emulator -list-avds

    echo "Starting emulator and waiting for boot to complete..."
    nohup $ANDROID_HOME/emulator/emulator -avd Pixel_API_29_AOSP -no-snapshot -no-window -no-audio -no-boot-anim -camera-back none -camera-front none -qemu -m 2048 > /dev/null 2>&1 &
    $ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done; input keyevent 82'

    echo "Emulator has finished booting"
    $ANDROID_HOME/platform-tools/adb devices