android-sdk-docker/README.md

31 lines
1.4 KiB
Markdown
Raw Permalink Normal View History

# Docker for Android SDK
2020-10-07 23:58:47 +02:00
Docker for Android SDK with preinstalled build tools and emulator image
2020-10-07 23:58:47 +02:00
> Edit from [docker-android-sdk/android-31](https://github.com/docker-android-sdk/android-31)
2020-10-07 23:58:47 +02:00
**Usage**
- Interactive way
```bash
$ docker run -it --rm --device /dev/kvm git.cuernodehipnos.es/marown/android-sdk-docker:latest bash
2020-10-07 23:58:47 +02:00
# check installed packages
$ sdkmanager --list
# create and run emulator
$ avdmanager --verbose create avd --force --name "generic_34" --package "system-images;android-34;google_apis;x86_64" --tag "google_apis" --abi "x86_64"
$ emulator -avd "generic_34" -no-window -no-audio -no-boot-anim -netdelay none -no-snapshot -wipe-data &
2020-10-07 23:58:47 +02:00
$ adb devices
# You can also run other Android platform tools, which are all added to the PATH environment variable
```
2021-07-13 06:33:41 +02:00
To connect the emulator using `adb` on the docker host machine, start the container with `--network host` as well.
2020-10-07 23:58:47 +02:00
You could also use [`scrcpy`](https://github.com/Genymobile/scrcpy) to do a screencast of the emulator.
- Non-interactive way
```bash
# check installed packages
$ docker run -it --rm git.cuernodehipnos.es/marown/android-sdk-docker:latest sdkmanager --list
2020-10-07 23:58:47 +02:00
# list existing emulators
$ docker run -it --rm git.cuernodehipnos.es/marown/android-sdk-docker:latest avdmanager list avd
2020-10-07 23:58:47 +02:00
# You can also run other Android platform tools, which are all added to the PATH environment variable
```