Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Extract create avd step
Browse files Browse the repository at this point in the history
  • Loading branch information
plastiv committed Mar 16, 2019
1 parent 7293e20 commit ec799b3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ before_install:

script:
- docker build --build-arg EMULATOR_API_LEVEL --build-arg EMULATOR_VARIANT --build-arg EMULATOR_ARCH -t android-emulator-$EMULATOR_API_LEVEL android-emulator/
- docker run -it --rm --env EMULATOR_API_LEVEL --volume=$(pwd)/android-emulator:/opt/workspace --entrypoint /opt/workspace/check-image.sh android-emulator-$EMULATOR_API_LEVEL
- docker run -it --rm --env EMULATOR_API_LEVEL --env EMULATOR_VARIANT --env EMULATOR_ARCH --volume=$(pwd)/android-emulator:/opt/workspace --entrypoint /opt/workspace/check-image.sh android-emulator-$EMULATOR_API_LEVEL
7 changes: 0 additions & 7 deletions android-emulator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,5 @@ RUN yes 'y' | sdkmanager --licenses >/dev/null \
"system-images;android-${EMULATOR_API_LEVEL};${EMULATOR_VARIANT};${EMULATOR_ARCH}" \
"tools" >/dev/null

# Create AVD
RUN yes 'n' | avdmanager --silent create avd \
--name android-emulator-${EMULATOR_API_LEVEL} \
--device "4in WVGA (Nexus S)" \
--package "system-images;android-${EMULATOR_API_LEVEL};${EMULATOR_VARIANT};${EMULATOR_ARCH}" \
--sdcard 64M

# GO to workspace
WORKDIR /opt/workspace
1 change: 1 addition & 0 deletions android-emulator/check-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

java -Xmx32m -version
sdkmanager --list
./create-avd.sh
avdmanager list avd
emulator-check accel hyper-v cpu-info window-mgr desktop-env
./start-emulator.sh &
Expand Down
7 changes: 7 additions & 0 deletions android-emulator/create-avd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

yes 'n' | avdmanager --silent create avd \
--name android-emulator-${EMULATOR_API_LEVEL} \
--device "4in WVGA (Nexus S)" \
--package "system-images;android-${EMULATOR_API_LEVEL};${EMULATOR_VARIANT};${EMULATOR_ARCH}" \
--sdcard 64M

0 comments on commit ec799b3

Please sign in to comment.