Sign inSign up

anthonymonori/android-ci-emulator-image

By anthonymonori

•Updated almost 9 years ago

Just like anthonymonori/android-ci-image but with emulators!

Image
0

718

anthonymonori/android-ci-emulator-image repository overview

⁠android-ci-emulator-image

Container set up with build tools in order to run Android connected builds in a Docker setup.

⁠Contains

⁠Usage

⁠Including this in your ci.yml
image: anthonymonori/android-ci-emulator-image:latest

Note: Currently supporting Travis CI and GitLab CI.

⁠Creating a docker container
docker login
docker pull anthonymonori/android-ci-emulator-image:latest
docker run -it -d -p <port>:<port-internal> --name <container-name> anthonymonori/android-ci-emulator-image:latest

Note: of course, you need to change [port],[port-internal],[container-name] to run the above command lines. You also might want to enable the [port] variable on whatever cloud solutions you are running.

⁠Gradle

Because the Fastlane gradle action⁠ is used, bundling Gradle into this Docker image would always take priority over the gradlew coming with your project. This de-coupling is helpful so we don't need to update and depend on this image, but rather let the incoming project to have its gradle wrapper execute the tasks. It is necessary to use gradle 2.2.0 and above in order to auto-download missing SDK packages and tools during build-time. You can specify this in your top-level build.gradle file, under dependencies:

dependencies {
  classpath 'com.android.tools.build:gradle:2.2+'
}

Read more⁠

⁠Running androidConnectedTest

In your .gitlab-ci.yml file, add the following lines to ensure the virtual devices are started up:

- emulator <@DEVICE_NAME> -wipe-data -verbose -logcat '*:e *:w' -netfast -no-boot-anim -no-audio -no-window &&
- /opt/scripts/android-wait-for-emulator.sh
- adb shell input keyevent 82

Possible device names:

  • @Nexus6P

For the full list, please see create-devices.sh⁠

⁠Build image

docker build .

⁠Deploy image

docker push anthonymonori/android-ci-emulator-image

⁠Problems

Use the Issues tab above.

Tag summary

Content type

Image

Digest

Size

2.3 GB

Last updated

almost 9 years ago

docker pull anthonymonori/android-ci-emulator-image