enable connecting device to android-studio via adb
This commit is contained in:
parent
c37fe37e81
commit
4b194f98e9
27
.dockerfunc
27
.dockerfunc
|
@ -7,6 +7,8 @@
|
||||||
# Helper Functions
|
# Helper Functions
|
||||||
#
|
#
|
||||||
dcleanup() {
|
dcleanup() {
|
||||||
|
|
||||||
|
# TODO: add list of non-disposable containers (eclipse, intelliJ, ...?)
|
||||||
docker rm -v $(docker ps --filter status=exited -q 2>/dev/null) 2>/dev/null
|
docker rm -v $(docker ps --filter status=exited -q 2>/dev/null) 2>/dev/null
|
||||||
docker rmi $(docker images --filter dangling=true -q 2>/dev/null) 2>/dev/null
|
docker rmi $(docker images --filter dangling=true -q 2>/dev/null) 2>/dev/null
|
||||||
}
|
}
|
||||||
|
@ -36,24 +38,31 @@ relies_on() {
|
||||||
# Applications...
|
# Applications...
|
||||||
|
|
||||||
android-studio() {
|
android-studio() {
|
||||||
del_stopped android-studio
|
|
||||||
|
|
||||||
CURRENT_DIR="/home/fschl/projects/android"
|
ANDROID_DIR="/home/fschl/projects/android"
|
||||||
for dir in .studio-home .gradle .idea .android/avd; do
|
# for dir in .studio-home .gradle .idea .android/avd; do
|
||||||
mkdir -p $CURRENT_DIR/.docker-dev/$dir
|
# mkdir -p $ANDROID_DIR/.docker-dev/$dir
|
||||||
done
|
# done
|
||||||
|
|
||||||
|
# TODO: mount /home/developer/android-sdk-linux
|
||||||
|
# docker start android-studio
|
||||||
|
|
||||||
|
## You don't want to remove the container between uses, because many things installed
|
||||||
|
## via the _Android Studio GUI_ are only stored in the container.
|
||||||
|
# del_stopped android-studio
|
||||||
docker run -it \
|
docker run -it \
|
||||||
--net=host \
|
--net=host \
|
||||||
--name android-studio \
|
--name android-studio \
|
||||||
--privileged \
|
--privileged \
|
||||||
-e DISPLAY \
|
-e DISPLAY \
|
||||||
|
-e SHELL=/bin/bash \
|
||||||
-e GRADLE_USER_HOME='/workspace/.docker-dev/.gradle/home' \
|
-e GRADLE_USER_HOME='/workspace/.docker-dev/.gradle/home' \
|
||||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||||
-v $CURRENT_DIR/projects:/home/developer/AndroidStudioProjects \
|
-v /dev/bus/usb:/dev/bus/usb \
|
||||||
-v $CURRENT_DIR:/workspace \
|
-v $ANDROID_DIR/projects:/home/developer/AndroidStudioProjects \
|
||||||
-v $CURRENT_DIR/.docker-dev/.studio-home:/home/developer/.AndroidStudio1.2 \
|
-v $ANDROID_DIR:/workspace \
|
||||||
-v $CURRENT_DIR/.docker-dev/.android/avd:/home/developer/.android/avd \
|
-v $ANDROID_DIR/.docker-dev/.studio-home:/home/developer/.AndroidStudio1.2 \
|
||||||
|
-v $ANDROID_DIR/.docker-dev/.android/avd:/home/developer/.android/avd \
|
||||||
fschl/android-studio:latest \
|
fschl/android-studio:latest \
|
||||||
/bin/studio
|
/bin/studio
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue