Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Deadolus/android-studio-docker
Android Studio + flutter in Docker. Emulator works too - with or without Display, even over SSH if you forward the display
https://github.com/Deadolus/android-studio-docker
android android-studio docker flutter
Last synced: 3 days ago
JSON representation
Android Studio + flutter in Docker. Emulator works too - with or without Display, even over SSH if you forward the display
- Host: GitHub
- URL: https://github.com/Deadolus/android-studio-docker
- Owner: Deadolus
- License: apache-2.0
- Created: 2017-09-19T06:28:02.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-11-09T19:26:32.000Z (12 months ago)
- Last Synced: 2024-04-09T12:00:04.810Z (7 months ago)
- Topics: android, android-studio, docker, flutter
- Language: Shell
- Homepage:
- Size: 41 KB
- Stars: 112
- Watchers: 6
- Forks: 44
- Open Issues: 3
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
Android-Studio docker container
============
Complete Android-Studio in a Docker container.
You can even start an Emulator inside it.If you don't have a display the Emulator can run with a "dummy" display - perfect for continous integration.
Tested on Linux only.
Building without docker compose
-------------
Just run "./build.sh", or "docker build -t deadolus/android-studio ." directly.
An already built version is also on Docker Hub. So you may also run "docker pull deadolus/android-studio".
You may of course change the name of the container.Running without docker compose
-------------
Run"HOST_DISPLAY=1 ./run.sh"
or run directly via
"docker run -i $AOSP_ARGS -v `pwd`/studio-data:/studio-data --privileged --group-add plugdev deadolus/android-studio"
run.sh has some options which you can set via Environment variables.
* NO_TTY - Do not run docker with -t flag
* DOCKERHOSTNAME - set Docker Hostname. I use it to run tests headless
* HOST_USB - Use the USB of the Host (useful if you want your physical device to be recognized by adb inside the container)
* HOST_NET - Use the network of the host
* HOST_DISPLAY - Allow the container to use the Display of the host. E.g. Let the emulator run on the Hosts Display environment.You may use a Variable like this: "HOST_NET=1 ./run.sh"
The default docker entrypoint tries to start android-studio.
So it probably does not make sense to try starting via run.sh without
HOST_DISPLAY=1.
If you just want a shell in the container, without starting Android Studio, run "./run.sh bash" to bypass starting Android StudioRunning and Building with docker compose:
-------------1. Comment/uncomment the appropriate lines in the compose.yaml depending on if you are running this natively in linux or in WSL.
2. To build: `docker compose build android_emulator`
3. To run: `docker compose run android_emulator`Additional information - continous integration
-------------
I included a script under provisioning/ndkTests.sh which demonstrates how you may use this container in a CI environment.
The script starts a headless container, if the HOSTNAME variable is set to CI.
It then changes in to a directory (workspace/GoogleTestApp) where it builds and installs an app.
It parses logcat for lines containing a string (GoogleTest), uninstalls the app and does some analysis on the parsed lines.
While this script probably does not make much sense FOR YOU, it might be useful as a guiding point for you.Contributors
------------
[@Deadolus](https://github.com/Deadolus)
[@guilhermelinhares](https://github.com/guilhermelinhares)
[@mtomcanyi](https://github.com/mtomcanyi)
[@Naveenkhegde](https://github.com/Naveenkhegde)
[@BenBlumer](https://github.com/BenBlumer)