diff --git a/.travis.yml b/.travis.yml index 236e274..458d80c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,17 +6,17 @@ services: - docker env: - - EMULATOR_SDK_VERSION=21 - - EMULATOR_SDK_VERSION=22 - - EMULATOR_SDK_VERSION=23 - - EMULATOR_SDK_VERSION=24 - - EMULATOR_SDK_VERSION=25 - - EMULATOR_SDK_VERSION=26 - - EMULATOR_SDK_VERSION=27 - - EMULATOR_SDK_VERSION=28 + - EMULATOR_API_LEVEL=21 EMULATOR_ARCH=x86_64 + - EMULATOR_API_LEVEL=22 EMULATOR_ARCH=x86_64 + - EMULATOR_API_LEVEL=23 EMULATOR_ARCH=x86_64 + - EMULATOR_API_LEVEL=24 EMULATOR_ARCH=x86_64 + - EMULATOR_API_LEVEL=25 EMULATOR_ARCH=x86_64 + - EMULATOR_API_LEVEL=26 EMULATOR_ARCH=x86_64 + - EMULATOR_API_LEVEL=27 EMULATOR_ARCH=x86 + - EMULATOR_API_LEVEL=28 EMULATOR_ARCH=x86_64 before_install: - - docker build --build-arg EMULATOR_SDK_VERSION -t android-emulator-$EMULATOR_SDK_VERSION android-emulator/ + - docker build --build-arg EMULATOR_API_LEVEL --build-arg EMULATOR_ARCH -t android-emulator-$EMULATOR_API_LEVEL android-emulator/ script: - - docker run -it --rm --env EMULATOR_SDK_VERSION --volume=$(pwd)/android-emulator:/opt/workspace --entrypoint /opt/workspace/start-emulator.sh android-emulator-$EMULATOR_SDK_VERSION + - docker run -it --rm --env EMULATOR_API_LEVEL --volume=$(pwd)/android-emulator:/opt/workspace --entrypoint /opt/workspace/start-emulator.sh android-emulator-$EMULATOR_API_LEVEL diff --git a/android-emulator/Dockerfile b/android-emulator/Dockerfile index 3f97d14..b944925 100644 --- a/android-emulator/Dockerfile +++ b/android-emulator/Dockerfile @@ -1,6 +1,7 @@ FROM debian:stretch -ARG EMULATOR_SDK_VERSION +ARG EMULATOR_API_LEVEL +ARG EMULATOR_ARCH # Install java and dependencies # to debug missing lib issues use ldconfig -p | grep libGL @@ -81,11 +82,11 @@ RUN echo "y" | sdkmanager "build-tools;28.0.3" \ "emulator" \ "platform-tools" \ "platforms;android-28" \ - "system-images;android-${EMULATOR_SDK_VERSION};google_apis;x86_64" \ + "system-images;android-${EMULATOR_API_LEVEL};google_apis;${EMULATOR_ARCH}" \ "tools" >/dev/null # Create AVD -RUN echo "no" | avdmanager --silent create avd --force --name android-emulator-$EMULATOR_SDK_VERSION --device "4in WVGA (Nexus S)" --package "system-images;android-${EMULATOR_SDK_VERSION};google_apis;x86_64" +RUN echo "no" | avdmanager --silent create avd --force --name android-emulator-$EMULATOR_API_LEVEL --device "4in WVGA (Nexus S)" --package "system-images;android-${EMULATOR_API_LEVEL};google_apis;${EMULATOR_ARCH}" # GO to workspace RUN mkdir -p /opt/workspace diff --git a/android-emulator/start-emulator.sh b/android-emulator/start-emulator.sh index d5ee3c8..f861944 100755 --- a/android-emulator/start-emulator.sh +++ b/android-emulator/start-emulator.sh @@ -10,7 +10,7 @@ sdkmanager --list emulator -list-avds emulator-check accel hyper-v cpu-info # https://developer.android.com/studio/run/emulator-commandline#startup-options -emulator -verbose -avd android-emulator-${EMULATOR_SDK_VERSION} \ +emulator -verbose -avd android-emulator-${EMULATOR_API_LEVEL} \ -no-accel \ -no-audio \ -no-window \