Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vishwassharma/be5ea986a8248ae20bef9c8136cd63fd to your computer and use it in GitHub Desktop.
Save vishwassharma/be5ea986a8248ae20bef9c8136cd63fd to your computer and use it in GitHub Desktop.

Revisions

  1. vishwassharma revised this gist Feb 3, 2020. No changes.
  2. Mark Han revised this gist Jan 30, 2020. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions emulator-install-using-avdmanager.md
    Original file line number Diff line number Diff line change
    @@ -15,6 +15,8 @@ For generic skin emulator with default apis (without google apis):
    skin.name=1080x1920 # proper screen size for emulator
    hw.lcd.density=480
    hw.keyboard=yes # enables keys from your laptop to be sent to the emulator
    If you cannot do this, you can still pass -skin 1080x1920 as an argument when starting the emulator.

    4. **Run Emulator:** `emulator @generic_10 &`

  3. Mark Han revised this gist Jan 30, 2020. 1 changed file with 0 additions and 8 deletions.
    8 changes: 0 additions & 8 deletions emulator-install-using-avdmanager.md
    Original file line number Diff line number Diff line change
    @@ -18,14 +18,6 @@ For generic skin emulator with default apis (without google apis):

    4. **Run Emulator:** `emulator @generic_10 &`

    5. **Edit config.ini** Finally, add the following to `~/.android/avd/generic_10.avd/config.ini` to make sure it starts with an appropriate resolution and typing with your Laptop Keyboard is enabled. (This will make it so you don't have to pass the `-skin 768x1280` argument when starting the emulator)


    skin.name=1080x1920
    hw.lcd.density=480
    hw.keyboard=yes


    ## About

    - The goal of this gist is to quickly pre-install a range of system images to provide our project teams the ability to run emulators on a range of API levels, from API 19 to API 28.
  4. Mark Han revised this gist Jan 30, 2020. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion emulator-install-using-avdmanager.md
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,13 @@ For generic skin emulator with default apis (without google apis):

    4. **Run Emulator:** `emulator @generic_10 &`

    5. **Create Alias (and add any additional avd args):** `alias generic_9.0='emulator @generic_10 &'`
    5. **Edit config.ini** Finally, add the following to `~/.android/avd/generic_10.avd/config.ini` to make sure it starts with an appropriate resolution and typing with your Laptop Keyboard is enabled. (This will make it so you don't have to pass the `-skin 768x1280` argument when starting the emulator)


    skin.name=1080x1920
    hw.lcd.density=480
    hw.keyboard=yes


    ## About

  5. Mark Han revised this gist Jan 10, 2020. 1 changed file with 3 additions and 8 deletions.
    11 changes: 3 additions & 8 deletions emulator-install-using-avdmanager.md
    Original file line number Diff line number Diff line change
    @@ -10,16 +10,11 @@ For generic skin emulator with default apis (without google apis):

    3. **Create Emulator:** `echo "no" | avdmanager --verbose create avd --force --name "generic_10" --package "system-images;android-29;default;x86" --tag "default" --abi "x86"`

    **Recommended:**
    I recommend adding these lines to: ~/.android/avd/generic_10.avd/config.ini

    Add these lines to: ~/.android/avd/generic_10.avd/config.ini to permanently change startup settings

    ```
    skin.name=1080x1920
    skin.name=1080x1920 # proper screen size for emulator
    hw.lcd.density=480
    hw.keyboard=yes
    ```
    `hw.keyboard=yes` enables keys from your laptop to be sent to the emulator
    hw.keyboard=yes # enables keys from your laptop to be sent to the emulator

    4. **Run Emulator:** `emulator @generic_10 &`

  6. Mark Han revised this gist Jan 10, 2020. 1 changed file with 8 additions and 8 deletions.
    16 changes: 8 additions & 8 deletions emulator-install-using-avdmanager.md
    Original file line number Diff line number Diff line change
    @@ -10,16 +10,16 @@ For generic skin emulator with default apis (without google apis):

    3. **Create Emulator:** `echo "no" | avdmanager --verbose create avd --force --name "generic_10" --package "system-images;android-29;default;x86" --tag "default" --abi "x86"`

    **Recommended:**
    **Recommended:**

    Add these lines to: ~/.android/avd/generic_10.avd/config.ini to permanently change startup settings
    Add these lines to: ~/.android/avd/generic_10.avd/config.ini to permanently change startup settings

    ```
    skin.name=1080x1920
    hw.lcd.density=480
    hw.keyboard=yes
    ```
    `hw.keyboard=yes` enables keys from your laptop to be sent to the emulator
    ```
    skin.name=1080x1920
    hw.lcd.density=480
    hw.keyboard=yes
    ```
    `hw.keyboard=yes` enables keys from your laptop to be sent to the emulator

    4. **Run Emulator:** `emulator @generic_10 &`

  7. Mark Han revised this gist Jan 10, 2020. 1 changed file with 6 additions and 4 deletions.
    10 changes: 6 additions & 4 deletions emulator-install-using-avdmanager.md
    Original file line number Diff line number Diff line change
    @@ -10,11 +10,9 @@ For generic skin emulator with default apis (without google apis):

    3. **Create Emulator:** `echo "no" | avdmanager --verbose create avd --force --name "generic_10" --package "system-images;android-29;default;x86" --tag "default" --abi "x86"`

    4. **Run Emulator:** `emulator @generic_10 -skin 768x1280 &`
    **Recommended:**

    5. **Create Alias:** `alias generic_9.0='emulator @generic_10 -skin 768x1280 &'`

    6. **Recommended: Add these lines to: ~/.android/avd/generic_10.avd/config.ini to permanently change startup settings**
    Add these lines to: ~/.android/avd/generic_10.avd/config.ini to permanently change startup settings

    ```
    skin.name=1080x1920
    @@ -23,6 +21,10 @@ hw.keyboard=yes
    ```
    `hw.keyboard=yes` enables keys from your laptop to be sent to the emulator

    4. **Run Emulator:** `emulator @generic_10 &`

    5. **Create Alias (and add any additional avd args):** `alias generic_9.0='emulator @generic_10 &'`

    ## About

    - The goal of this gist is to quickly pre-install a range of system images to provide our project teams the ability to run emulators on a range of API levels, from API 19 to API 28.
  8. Mark Han revised this gist Jan 10, 2020. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions emulator-install-using-avdmanager.md
    Original file line number Diff line number Diff line change
    @@ -14,9 +14,7 @@ For generic skin emulator with default apis (without google apis):

    5. **Create Alias:** `alias generic_9.0='emulator @generic_10 -skin 768x1280 &'`

    6. **Recommended:**

    Add these lines to: ~/.android/avd/generic_10.avd/config.ini to permanently change startup settings
    6. **Recommended: Add these lines to: ~/.android/avd/generic_10.avd/config.ini to permanently change startup settings**

    ```
    skin.name=1080x1920
  9. Mark Han revised this gist Jan 10, 2020. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion emulator-install-using-avdmanager.md
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,10 @@ For generic skin emulator with default apis (without google apis):

    5. **Create Alias:** `alias generic_9.0='emulator @generic_10 -skin 768x1280 &'`

    6. **Recommended: Add these lines to: ~/.android/avd/generic_10.avd/config.ini to permanently change startup settings
    6. **Recommended:**

    Add these lines to: ~/.android/avd/generic_10.avd/config.ini to permanently change startup settings

    ```
    skin.name=1080x1920
    hw.lcd.density=480
  10. Mark Han revised this gist Jan 10, 2020. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions emulator-install-using-avdmanager.md
    Original file line number Diff line number Diff line change
    @@ -14,6 +14,14 @@ For generic skin emulator with default apis (without google apis):

    5. **Create Alias:** `alias generic_9.0='emulator @generic_10 -skin 768x1280 &'`

    6. **Recommended: Add these lines to: ~/.android/avd/generic_10.avd/config.ini to permanently change startup settings
    ```
    skin.name=1080x1920
    hw.lcd.density=480
    hw.keyboard=yes
    ```
    `hw.keyboard=yes` enables keys from your laptop to be sent to the emulator

    ## About

    - The goal of this gist is to quickly pre-install a range of system images to provide our project teams the ability to run emulators on a range of API levels, from API 19 to API 28.
  11. Mark Han revised this gist Dec 20, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion emulator-install-using-avdmanager.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@

    For generic skin emulator with default apis (without google apis):

    1. **List All System Images Available for Download** `sdkmanager --list | grep system-images`
    1. **List All System Images Available for Download:** `sdkmanager --list | grep system-images`

    2. **Download Image:** `sdkmanager --install "system-images;android-29;default;x86"`

  12. Mark Han revised this gist Dec 20, 2019. 1 changed file with 6 additions and 4 deletions.
    10 changes: 6 additions & 4 deletions emulator-install-using-avdmanager.md
    Original file line number Diff line number Diff line change
    @@ -4,13 +4,15 @@

    For generic skin emulator with default apis (without google apis):

    1. **Download Image:** `sdkmanager --install "system-images;android-29;default;x86"`
    1. **List All System Images Available for Download** `sdkmanager --list | grep system-images`

    2. **Create Emulator:** `echo "no" | avdmanager --verbose create avd --force --name "generic_10" --package "system-images;android-29;default;x86" --tag "default" --abi "x86"`
    2. **Download Image:** `sdkmanager --install "system-images;android-29;default;x86"`

    3. **Run Emulator:** `emulator @generic_10 -skin 768x1280 &`
    3. **Create Emulator:** `echo "no" | avdmanager --verbose create avd --force --name "generic_10" --package "system-images;android-29;default;x86" --tag "default" --abi "x86"`

    4. **Create Alias:** `alias generic_9.0='emulator @generic_10 -skin 768x1280 &'`
    4. **Run Emulator:** `emulator @generic_10 -skin 768x1280 &`

    5. **Create Alias:** `alias generic_9.0='emulator @generic_10 -skin 768x1280 &'`

    ## About

  13. Mark Han revised this gist Dec 17, 2019. 1 changed file with 9 additions and 9 deletions.
    18 changes: 9 additions & 9 deletions emulator-install-using-avdmanager.md
    Original file line number Diff line number Diff line change
    @@ -118,23 +118,23 @@ See: [Google Documentation on Start the emulator from the command line](https://

    **Note:** Add this alias to `~/.bashrc` or `~/.zshrc`, or just run using these parameters for best results. `-skin 768x1280` is useful to run default emulators successfully because they have a very low resolution out-of-the-box.

    `alias generic_4.4 ='emulator @generic_4.4 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`
    `alias generic_4.4='emulator @generic_4.4 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`

    `alias generic_5.0 ='emulator @generic_5.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`
    `alias generic_5.0='emulator @generic_5.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`

    `alias generic_5.1 ='emulator @generic_5.1 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`
    `alias generic_5.1='emulator @generic_5.1 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`

    `alias generic_6.0 ='emulator @generic_6.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`
    `alias generic_6.0='emulator @generic_6.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`

    `alias generic_7.0 ='emulator @generic_7.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`
    `alias generic_7.0='emulator @generic_7.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`

    `alias generic_7.1 ='emulator @generic_7.1 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`
    `alias generic_7.1='emulator @generic_7.1 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`

    `alias generic_8.0 ='emulator @generic_8.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`
    `alias generic_8.0='emulator @generic_8.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`

    `alias generic_8.1 ='emulator @generic_8.1 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`
    `alias generic_8.1='emulator @generic_8.1 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`

    `alias generic_9.0 ='emulator @generic_9.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`
    `alias generic_9.0='emulator @generic_9.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`

    **Note:** Add this alias to `~/.bashrc` or `~/.zshrc`, or just run using these parameters for results. Pixel emulators should run at default resolution of 1080x1920 by default, but can specify this just in-case with the parameter: `-skin 1080x1920`

  14. Mark Han revised this gist Dec 17, 2019. 1 changed file with 12 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions emulator-install-using-avdmanager.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,17 @@
    # Install and Create Emulators using AVDMANAGER and SDKMANAGER

    ## TL;DR

    For generic skin emulator with default apis (without google apis):

    1. **Download Image:** `sdkmanager --install "system-images;android-29;default;x86"`

    2. **Create Emulator:** `echo "no" | avdmanager --verbose create avd --force --name "generic_10" --package "system-images;android-29;default;x86" --tag "default" --abi "x86"`

    3. **Run Emulator:** `emulator @generic_10 -skin 768x1280 &`

    4. **Create Alias:** `alias generic_9.0='emulator @generic_10 -skin 768x1280 &'`

    ## About

    - The goal of this gist is to quickly pre-install a range of system images to provide our project teams the ability to run emulators on a range of API levels, from API 19 to API 28.
  15. mrk-han revised this gist Feb 7, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion emulator-install-using-avdmanager.md
    Original file line number Diff line number Diff line change
    @@ -36,7 +36,7 @@ See: [Google Documentation on Start the emulator from the command line](https://

    ### MARSHMELLOW (6.0) API 23

    `sdkmanager --install "system-images;android-23;google_apis;x86"`
    `sdkmanager --install "system-images;android-23;google_apis;x86"`

    ### NOUGAT (7.0) API 24

  16. mrk-han revised this gist Feb 7, 2019. No changes.
  17. mrk-han revised this gist Feb 7, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions emulator-install-using-avdmanager.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # How to Install and Create Emulators using AVDMANAGER and SDKMANAGER
    # Install and Create Emulators using AVDMANAGER and SDKMANAGER

    ## About

    @@ -36,7 +36,7 @@ See: [Google Documentation on Start the emulator from the command line](https://

    ### MARSHMELLOW (6.0) API 23

    `sdkmanager --install "system-images;android-23;google_apis;x86"`
    `sdkmanager --install "system-images;android-23;google_apis;x86"`

    ### NOUGAT (7.0) API 24

  18. Mark Han revised this gist Feb 7, 2019. No changes.
  19. mrk-han revised this gist Feb 7, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion emulator-install-using-avdmanager.md
    Original file line number Diff line number Diff line change
    @@ -150,7 +150,7 @@ See: [Google Documentation on Start the emulator from the command line](https://

    1) Certain emulators, like Pixel, need to be started at a higher resolution than default oem emulators. Either define this in the `~/.android/avd/{name of avd}/config.ini` file, or start emulator with `-skin {RESOLUTION}` as seen above.
    2) `emulator -list-avds` will print list of available devices
    3) `avdmanager list` `avdmanager list target` `avdmanager list devices` `avdmanager list avd`
    3) `avdmanager list` , `avdmanager list target`, `avdmanager list devices` , `avdmanager list avd`

    ``` text
    - avdmanager list : Lists existing targets or virtual devices.
  20. mrk-han revised this gist Feb 7, 2019. 1 changed file with 16 additions and 1 deletion.
    17 changes: 16 additions & 1 deletion emulator-install-using-avdmanager.md
    Original file line number Diff line number Diff line change
    @@ -100,33 +100,48 @@ See: [Google Documentation on Start the emulator from the command line](https://

    `echo "no" | avdmanager --verbose create avd --force --name "generic_9.0" --package "system-images;android-28;google_apis;x86" --tag "google_apis" --abi "x86"`


    ## Extra Steps - Aliases and notes on resolutions

    ### Aliases to run emulators more optimally

    **Note:** Add this alias to `~/.bashrc` or `~/.zshrc`, or just run using these parameters for best results. `-skin 768x1280` is useful to run default emulators successfully because they have a very low resolution out-of-the-box.

    `alias generic_4.4 ='emulator @generic_4.4 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`

    `alias generic_5.0 ='emulator @generic_5.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`

    `alias generic_5.1 ='emulator @generic_5.1 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`

    `alias generic_6.0 ='emulator @generic_6.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`

    `alias generic_7.0 ='emulator @generic_7.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`

    `alias generic_7.1 ='emulator @generic_7.1 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`

    `alias generic_8.0 ='emulator @generic_8.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`

    `alias generic_8.1 ='emulator @generic_8.1 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`

    `alias generic_9.0 ='emulator @generic_9.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`

    **Note:** Add this alias to `~/.bashrc` or `~/.zshrc`, or just run using these parameters for results. Pixel emulators should run at default resolution of 1080x1920 by default, but can specify this just in-case with the parameter: `-skin 1080x1920`

    `alias pixel_4.4 ='emulator @pixel_4.4 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 1080x1920 &'`

    `alias pixel_5.0 ='emulator @pixel_5.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 1080x1920 &'`

    `alias pixel_5.1 ='emulator @pixel_5.1 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 1080x1920 &'`

    `alias pixel_6.0 ='emulator @pixel_6.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 1080x1920 &'`

    `alias pixel_7.0 ='emulator @pixel_7.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 1080x1920 &'`

    `alias pixel_7.1 ='emulator @pixel_7.1 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 1080x1920 &'`

    `alias pixel_8.0 ='emulator @pixel_8.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 1080x1920 &'`

    `alias pixel_8.1 ='emulator @pixel_8.1 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 1080x1920 &'`

    `alias pixel_9.0 ='emulator @pixel_9.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 1080x1920 &'`

    **Note** You can run all of the emulators above with a `-read-only` parameter to run multiple emulators at the same time, but this is an experimental feature right now.
  21. mrk-han revised this gist Feb 7, 2019. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions emulator-install-using-avdmanager.md
    Original file line number Diff line number Diff line change
    @@ -2,10 +2,10 @@

    ## About

    We pre-install these system images on the base build agent to provide our project teams the ability to run emulators on a range of API levels, from API 19 to API 28.
    X86 is the fastest architecture for emulators, though x86_64 would probably be better to test against because most phones are 64 bit now.

    We create two sets of emulators here, one set with pixel hardware emulation and one set with default oem emulation.
    - The goal of this gist is to quickly pre-install a range of system images to provide our project teams the ability to run emulators on a range of API levels, from API 19 to API 28.
    - These can be run locally or on the base build agent.
    - **Note:** X86 is the fastest architecture for emulators, though x86_64 would probably be better to test against because most phones are 64 bit now.
    - We create two sets of emulators here, one set with pixel hardware emulation and one set with default oem emulation.

    See: [Google Documentation on Start the emulator from the command line](https://developer.android.com/studio/run/emulator-commandline) for more info

  22. mrk-han revised this gist Feb 7, 2019. 1 changed file with 18 additions and 2 deletions.
    20 changes: 18 additions & 2 deletions emulator-install-using-avdmanager.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # How to Install and Create Emulators using AVDMANAGER and SDKMANAGER

    ## Installing system images
    ## About

    We pre-install these system images on the base build agent to provide our project teams the ability to run emulators on a range of API levels, from API 19 to API 28.
    X86 is the fastest architecture for emulators, though x86_64 would probably be better to test against because most phones are 64 bit now.
    @@ -9,6 +9,19 @@ We create two sets of emulators here, one set with pixel hardware emulation and

    See: [Google Documentation on Start the emulator from the command line](https://developer.android.com/studio/run/emulator-commandline) for more info

    ## Steps

    1) Run the **sdkmanager --install** commands.
    2) Run the **avdmanager** commands.

    ## Extra Steps

    - Add aliases to run the emulators with parameters more easily. Or add these parameters to your build steps in TeamCity.
    - Instead of using `emulator @{EMULATOR NAME}` to run devices, you can use the aliases if they are added.
    - If you run this locally, you can use the `-read-only` parameter to run multiple devices at the same time. You can then manually run automation against various APIs for added device coverage during regression.

    ## Step 1 - Run the sdkmanager commands

    ### KITKAT (4.4) API 19

    `sdkmanager --install "system-images;android-19;google_apis;x86"`
    @@ -45,7 +58,7 @@ See: [Google Documentation on Start the emulator from the command line](https://

    `sdkmanager --install "system-images;android-28;google_apis;x86"`

    ## Using AVDMANAGER to create emulator
    ## Step 2 - Use AVDMANAGER to create emulators

    ### Pixel Emulator with Google Apis and x86 architecture

    @@ -87,6 +100,9 @@ See: [Google Documentation on Start the emulator from the command line](https://

    `echo "no" | avdmanager --verbose create avd --force --name "generic_9.0" --package "system-images;android-28;google_apis;x86" --tag "google_apis" --abi "x86"`


    ## Extra Steps - Aliases and notes on resolutions

    ### Aliases to run emulators more optimally

    **Note:** Add this alias to `~/.bashrc` or `~/.zshrc`, or just run using these parameters for best results. `-skin 768x1280` is useful to run default emulators successfully because they have a very low resolution out-of-the-box.
  23. mrk-han revised this gist Feb 7, 2019. 1 changed file with 38 additions and 31 deletions.
    69 changes: 38 additions & 31 deletions emulator-install-using-avdmanager.md
    Original file line number Diff line number Diff line change
    @@ -5,61 +5,49 @@
    We pre-install these system images on the base build agent to provide our project teams the ability to run emulators on a range of API levels, from API 19 to API 28.
    X86 is the fastest architecture for emulators, though x86_64 would probably be better to test against because most phones are 64 bit now.

    ### KITKAT
    We create two sets of emulators here, one set with pixel hardware emulation and one set with default oem emulation.

    (4.4)
    See: [Google Documentation on Start the emulator from the command line](https://developer.android.com/studio/run/emulator-commandline) for more info

    `sdkmanager --install "system-images;android-19;google_apis;x86"`
    ### KITKAT (4.4) API 19

    ### LOLLIPOP
    `sdkmanager --install "system-images;android-19;google_apis;x86"`

    (5.0)
    ### LOLLIPOP (5.0) API 21

    `sdkmanager --install "system-images;android-21;google_apis;x86"`

    (5.1)
    ### LOLLIPOP (5.1) API 22

    `sdkmanager --install "system-images;android-22;google_apis;x86"`

    ### MARSHMELLOW

    (6.0)
    ### MARSHMELLOW (6.0) API 23

    `sdkmanager --install "system-images;android-23;google_apis;x86"`

    ### NOUGAT

    (7.0)
    ### NOUGAT (7.0) API 24

    `sdkmanager --install "system-images;android-24;google_apis;x86"`

    (7.1)
    ### NOUGAT (7.1) API 25

    `sdkmanager --install "system-images;android-25;google_apis;x86"`

    ### OREO

    (8.0)
    ### OREO (8.0) API 26

    `sdkmanager --install "system-images;android-26;google_apis;x86"`

    (8.1)
    ### OREO (8.1) API 27

    `sdkmanager --install "system-images;android-27;google_apis;x86"`

    ### PIE

    (9.0)
    ### PIE (9.0) API 28

    `sdkmanager --install "system-images;android-28;google_apis;x86"`

    ## Using AVDMANAGER to create emulator

    ### Pixel Emulator with Google Apis

    Note: Add this alias to ~/.bashrc or ~/.zshrc, or just run using the command for best results. `-skin 1080x1920` are useful to run Pixel at its desired resolution.

    `alias pixel_4.4 ='emulator @pixel_7.0_defaulttest -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 1080x1920 &'`
    ### Pixel Emulator with Google Apis and x86 architecture

    `echo "no" | avdmanager --verbose create avd --force --name "pixel_4.4" --device "pixel" --package "system-images;android-19;google_apis;x86" --tag "google_apis" --abi "x86"`

    @@ -104,15 +92,34 @@ Note: Add this alias to ~/.bashrc or ~/.zshrc, or just run using the command for
    **Note:** Add this alias to `~/.bashrc` or `~/.zshrc`, or just run using these parameters for best results. `-skin 768x1280` is useful to run default emulators successfully because they have a very low resolution out-of-the-box.

    `alias generic_4.4 ='emulator @generic_4.4 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`
    `alias generic_5.0 ='emulator @generic_5.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`
    `alias generic_5.1 ='emulator @generic_5.1 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`
    `alias generic_6.0 ='emulator @generic_6.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`
    `alias generic_7.0 ='emulator @generic_7.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`
    `alias generic_7.1 ='emulator @generic_7.1 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`
    `alias generic_8.0 ='emulator @generic_8.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`
    `alias generic_8.1 ='emulator @generic_8.1 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`
    `alias generic_9.0 ='emulator @generic_9.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`

    **Note:** Add this alias to `~/.bashrc` or `~/.zshrc`, or just run using these for best results. `-skin 1080x1920` is useful to run Pixel at its desired resolution.
    **Note:** Add this alias to `~/.bashrc` or `~/.zshrc`, or just run using these parameters for results. Pixel emulators should run at default resolution of 1080x1920 by default, but can specify this just in-case with the parameter: `-skin 1080x1920`

    `alias pixel_4.4 ='emulator @pixel_4.4 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 1080x1920 &'`

    ## TODO

    1) Certain emulators, like Pixel, need to be started at a higher resolution than default oem emulators. Either define this in the `~/.android/avd/{name of avd}/config.ini` file, or start emulator with `-skin {RESOLUTION}`.
    2) Find devices with `avdmanager list` `avdmanager list target` `avdmanager list devices` `avdmanager list avd`
    `alias pixel_5.0 ='emulator @pixel_5.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 1080x1920 &'`
    `alias pixel_5.1 ='emulator @pixel_5.1 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 1080x1920 &'`
    `alias pixel_6.0 ='emulator @pixel_6.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 1080x1920 &'`
    `alias pixel_7.0 ='emulator @pixel_7.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 1080x1920 &'`
    `alias pixel_7.1 ='emulator @pixel_7.1 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 1080x1920 &'`
    `alias pixel_8.0 ='emulator @pixel_8.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 1080x1920 &'`
    `alias pixel_8.1 ='emulator @pixel_8.1 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 1080x1920 &'`
    `alias pixel_9.0 ='emulator @pixel_9.0 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 1080x1920 &'`

    **Note** You can run all of the emulators above with a `-read-only` parameter to run multiple emulators at the same time, but this is an experimental feature right now.

    ## Other

    1) Certain emulators, like Pixel, need to be started at a higher resolution than default oem emulators. Either define this in the `~/.android/avd/{name of avd}/config.ini` file, or start emulator with `-skin {RESOLUTION}` as seen above.
    2) `emulator -list-avds` will print list of available devices
    3) `avdmanager list` `avdmanager list target` `avdmanager list devices` `avdmanager list avd`

    ``` text
    - avdmanager list : Lists existing targets or virtual devices.
  24. mrk-han revised this gist Feb 7, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions emulator-install-using-avdmanager.md
    Original file line number Diff line number Diff line change
    @@ -101,11 +101,11 @@ Note: Add this alias to ~/.bashrc or ~/.zshrc, or just run using the command for

    ### Aliases to run emulators more optimally

    *Note:* Add this alias to `~/.bashrc` or `~/.zshrc`, or just run using these parameters for best results. `-skin 768x1280` is useful to run default emulators successfully because they have a very low resolution out-of-the-box.
    **Note:** Add this alias to `~/.bashrc` or `~/.zshrc`, or just run using these parameters for best results. `-skin 768x1280` is useful to run default emulators successfully because they have a very low resolution out-of-the-box.

    `alias generic_4.4 ='emulator @generic_4.4 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`

    Note: Add this alias to `~/.bashrc` or `~/.zshrc`, or just run using these for best results. `-skin 1080x1920` is useful to run Pixel at its desired resolution.
    **Note:** Add this alias to `~/.bashrc` or `~/.zshrc`, or just run using these for best results. `-skin 1080x1920` is useful to run Pixel at its desired resolution.

    `alias pixel_4.4 ='emulator @pixel_4.4 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 1080x1920 &'`

  25. mrk-han revised this gist Feb 7, 2019. 1 changed file with 46 additions and 0 deletions.
    46 changes: 46 additions & 0 deletions emulator-install-using-avdmanager.md
    Original file line number Diff line number Diff line change
    @@ -57,12 +57,58 @@ X86 is the fastest architecture for emulators, though x86_64 would probably be b

    ### Pixel Emulator with Google Apis

    Note: Add this alias to ~/.bashrc or ~/.zshrc, or just run using the command for best results. `-skin 1080x1920` are useful to run Pixel at its desired resolution.

    `alias pixel_4.4 ='emulator @pixel_7.0_defaulttest -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 1080x1920 &'`

    `echo "no" | avdmanager --verbose create avd --force --name "pixel_4.4" --device "pixel" --package "system-images;android-19;google_apis;x86" --tag "google_apis" --abi "x86"`

    `echo "no" | avdmanager --verbose create avd --force --name "pixel_5.0" --device "pixel" --package "system-images;android-21;google_apis;x86" --tag "google_apis" --abi "x86"`

    `echo "no" | avdmanager --verbose create avd --force --name "pixel_5.1" --device "pixel" --package "system-images;android-22;google_apis;x86" --tag "google_apis" --abi "x86"`

    `echo "no" | avdmanager --verbose create avd --force --name "pixel_6.0" --device "pixel" --package "system-images;android-23;google_apis;x86" --tag "google_apis" --abi "x86"`

    `echo "no" | avdmanager --verbose create avd --force --name "pixel_7.0" --device "pixel" --package "system-images;android-24;google_apis;x86" --tag "google_apis" --abi "x86"`

    `echo "no" | avdmanager --verbose create avd --force --name "pixel_7.1" --device "pixel" --package "system-images;android-25;google_apis;x86" --tag "google_apis" --abi "x86"`

    `echo "no" | avdmanager --verbose create avd --force --name "pixel_8.0" --device "pixel" --package "system-images;android-26;google_apis;x86" --tag "google_apis" --abi "x86"`

    `echo "no" | avdmanager --verbose create avd --force --name "pixel_8.1" --device "pixel" --package "system-images;android-27;google_apis;x86" --tag "google_apis" --abi "x86"`

    `echo "no" | avdmanager --verbose create avd --force --name "pixel_9.0" --device "pixel" --package "system-images;android-28;google_apis;x86" --tag "google_apis" --abi "x86"`

    ### Generic Emulator with Google Apis

    `echo "no" | avdmanager --verbose create avd --force --name "generic_4.4" --package "system-images;android-19;google_apis;x86" --tag "google_apis" --abi "x86"`

    `echo "no" | avdmanager --verbose create avd --force --name "generic_5.0" --package "system-images;android-21;google_apis;x86" --tag "google_apis" --abi "x86"`

    `echo "no" | avdmanager --verbose create avd --force --name "generic_5.1" --package "system-images;android-22;google_apis;x86" --tag "google_apis" --abi "x86"`

    `echo "no" | avdmanager --verbose create avd --force --name "generic_6.0" --package "system-images;android-23;google_apis;x86" --tag "google_apis" --abi "x86"`

    `echo "no" | avdmanager --verbose create avd --force --name "generic_7.0" --package "system-images;android-24;google_apis;x86" --tag "google_apis" --abi "x86"`

    `echo "no" | avdmanager --verbose create avd --force --name "generic_7.1" --package "system-images;android-25;google_apis;x86" --tag "google_apis" --abi "x86"`

    `echo "no" | avdmanager --verbose create avd --force --name "generic_8.0" --package "system-images;android-26;google_apis;x86" --tag "google_apis" --abi "x86"`

    `echo "no" | avdmanager --verbose create avd --force --name "generic_8.1" --package "system-images;android-27;google_apis;x86" --tag "google_apis" --abi "x86"`

    `echo "no" | avdmanager --verbose create avd --force --name "generic_9.0" --package "system-images;android-28;google_apis;x86" --tag "google_apis" --abi "x86"`

    ### Aliases to run emulators more optimally

    *Note:* Add this alias to `~/.bashrc` or `~/.zshrc`, or just run using these parameters for best results. `-skin 768x1280` is useful to run default emulators successfully because they have a very low resolution out-of-the-box.

    `alias generic_4.4 ='emulator @generic_4.4 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 768x1280 &'`

    Note: Add this alias to `~/.bashrc` or `~/.zshrc`, or just run using these for best results. `-skin 1080x1920` is useful to run Pixel at its desired resolution.

    `alias pixel_4.4 ='emulator @pixel_4.4 -no-boot-anim -netdelay none -no-snapshot -wipe-data -skin 1080x1920 &'`

    ## TODO

    1) Certain emulators, like Pixel, need to be started at a higher resolution than default oem emulators. Either define this in the `~/.android/avd/{name of avd}/config.ini` file, or start emulator with `-skin {RESOLUTION}`.
  26. mrk-han revised this gist Feb 6, 2019. 1 changed file with 8 additions and 2 deletions.
    10 changes: 8 additions & 2 deletions emulator-install-using-avdmanager.md
    Original file line number Diff line number Diff line change
    @@ -35,7 +35,7 @@ X86 is the fastest architecture for emulators, though x86_64 would probably be b

    (7.1)

    `sdkmanager --install "system-images;android-24;google_apis;x86"`
    `sdkmanager --install "system-images;android-25;google_apis;x86"`

    ### OREO

    @@ -55,9 +55,15 @@ X86 is the fastest architecture for emulators, though x86_64 would probably be b

    ## Using AVDMANAGER to create emulator

    ### Pixel Emulator with Google Apis

    `echo "no" | avdmanager --verbose create avd --force --name "pixel_7.0" --device "pixel" --package "system-images;android-24;google_apis;x86" --tag "google_apis" --abi "x86"`

    ## TODO:
    ### Generic Emulator with Google Apis

    `echo "no" | avdmanager --verbose create avd --force --name "generic_7.0" --package "system-images;android-24;google_apis;x86" --tag "google_apis" --abi "x86"`

    ## TODO

    1) Certain emulators, like Pixel, need to be started at a higher resolution than default oem emulators. Either define this in the `~/.android/avd/{name of avd}/config.ini` file, or start emulator with `-skin {RESOLUTION}`.
    2) Find devices with `avdmanager list` `avdmanager list target` `avdmanager list devices` `avdmanager list avd`
  27. mrk-han revised this gist Feb 5, 2019. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions emulator-install-using-avdmanager.md
    Original file line number Diff line number Diff line change
    @@ -32,6 +32,7 @@ X86 is the fastest architecture for emulators, though x86_64 would probably be b
    (7.0)

    `sdkmanager --install "system-images;android-24;google_apis;x86"`

    (7.1)

    `sdkmanager --install "system-images;android-24;google_apis;x86"`
  28. mrk-han revised this gist Feb 5, 2019. 1 changed file with 28 additions and 1 deletion.
    29 changes: 28 additions & 1 deletion emulator-install-using-avdmanager.md
    Original file line number Diff line number Diff line change
    @@ -8,35 +8,62 @@ X86 is the fastest architecture for emulators, though x86_64 would probably be b
    ### KITKAT

    (4.4)

    `sdkmanager --install "system-images;android-19;google_apis;x86"`

    ### LOLLIPOP

    (5.0)

    `sdkmanager --install "system-images;android-21;google_apis;x86"`

    (5.1)

    `sdkmanager --install "system-images;android-22;google_apis;x86"`

    ### MARSHMELLOW

    (6.0)

    `sdkmanager --install "system-images;android-23;google_apis;x86"`

    ### NOUGAT

    (7.0)

    `sdkmanager --install "system-images;android-24;google_apis;x86"`
    (7.1)

    `sdkmanager --install "system-images;android-24;google_apis;x86"`

    ### OREO

    (8.0)

    `sdkmanager --install "system-images;android-26;google_apis;x86"`

    (8.1)

    `sdkmanager --install "system-images;android-27;google_apis;x86"`

    ### PIE

    (9.0)
    `sdkmanager --install "system-images;android-28;google_apis;x86"`

    `sdkmanager --install "system-images;android-28;google_apis;x86"`

    ## Using AVDMANAGER to create emulator

    `echo "no" | avdmanager --verbose create avd --force --name "pixel_7.0" --device "pixel" --package "system-images;android-24;google_apis;x86" --tag "google_apis" --abi "x86"`

    ## TODO:

    1) Certain emulators, like Pixel, need to be started at a higher resolution than default oem emulators. Either define this in the `~/.android/avd/{name of avd}/config.ini` file, or start emulator with `-skin {RESOLUTION}`.
    2) Find devices with `avdmanager list` `avdmanager list target` `avdmanager list devices` `avdmanager list avd`

    ``` text
    - avdmanager list : Lists existing targets or virtual devices.
    - avdmanager list avd : Lists existing Android Virtual Devices.
    - avdmanager list target : Lists existing targets.
    - avdmanager list device : Lists existing devices.
    ```
  29. Mark Han created this gist Feb 4, 2019.
    42 changes: 42 additions & 0 deletions emulator-install-using-avdmanager.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,42 @@
    # How to Install and Create Emulators using AVDMANAGER and SDKMANAGER

    ## Installing system images

    We pre-install these system images on the base build agent to provide our project teams the ability to run emulators on a range of API levels, from API 19 to API 28.
    X86 is the fastest architecture for emulators, though x86_64 would probably be better to test against because most phones are 64 bit now.

    ### KITKAT

    (4.4)
    `sdkmanager --install "system-images;android-19;google_apis;x86"`

    ### LOLLIPOP

    (5.0)
    `sdkmanager --install "system-images;android-21;google_apis;x86"`
    (5.1)
    `sdkmanager --install "system-images;android-22;google_apis;x86"`

    ### MARSHMELLOW

    (6.0)
    `sdkmanager --install "system-images;android-23;google_apis;x86"`

    ### NOUGAT

    (7.0)
    `sdkmanager --install "system-images;android-24;google_apis;x86"`
    (7.1)
    `sdkmanager --install "system-images;android-24;google_apis;x86"`

    ### OREO

    (8.0)
    `sdkmanager --install "system-images;android-26;google_apis;x86"`
    (8.1)
    `sdkmanager --install "system-images;android-27;google_apis;x86"`

    ### PIE

    (9.0)
    `sdkmanager --install "system-images;android-28;google_apis;x86"`