From 460e0b8daf37c1b306b5f8f9f08f0c363e8a7206 Mon Sep 17 00:00:00 2001 From: App-Test Date: Sat, 28 Jul 2018 16:53:26 +0430 Subject: [PATCH 1/5] Update Google Play Services and some other useful stuff by adb --- src/utils.sh | 30 ++++++++++++++++++++++++++++++ supervisord.conf | 7 +++++++ 2 files changed, 37 insertions(+) create mode 100644 src/utils.sh diff --git a/src/utils.sh b/src/utils.sh new file mode 100644 index 0000000..bd3392e --- /dev/null +++ b/src/utils.sh @@ -0,0 +1,30 @@ +#!/bin/bash +BOOT () +{ + A=$(adb wait-for-device shell getprop sys.boot_completed | tr -d '\r') + while [[ $A != "1" ]]; do + sleep 1; + A=$(adb wait-for-device shell getprop sys.boot_completed | tr -d '\r') + done; +} + +Get_Google_Play_Services () +{ + wget "https://www.apklinker.com/wp-content/uploads/uploaded_apk/5b51570a214a8/com.google.android.gms_12.8.74-040700-204998136_12874026_MinAPI23_(x86)(nodpi)_apklinker.com.apk" +} + +Update_Google_Play_Services () +{ + adb install -r "$PWD/com.google.android.gms_12.8.74-040700-204998136_12874026_MinAPI23_(x86)(nodpi)_apklinker.com.apk" +} +Disable_animations () +{ + # this is for demonstration what other amazing staff can be done here + adb shell "settings put global window_animation_scale 0.0" + adb shell "settings put global transition_animation_scale 0.0" + adb shell "settings put global animator_duration_scale 0.0" +} +BOOT +Get_Google_Play_Services +Update_Google_Play_Services +Disable_animations diff --git a/supervisord.conf b/supervisord.conf index 1e206a2..9ef4949 100644 --- a/supervisord.conf +++ b/supervisord.conf @@ -55,3 +55,10 @@ autorestart=false stdout_logfile=%(ENV_LOG_PATH)s/video-recording.stdout.log stderr_logfile=%(ENV_LOG_PATH)s/video-recording.stderr.log priority=4 + +[program:adb-utils] +command=./src/utils.sh +autorestart=false +stdout_logfile=%(ENV_LOG_PATH)s/adb-utils.stdout.log +stderr_logfile=%(ENV_LOG_PATH)s/adb-utils.stderr.log +priority=5 From de71e5156c6207310b40f45b600e7f563b96d9b4 Mon Sep 17 00:00:00 2001 From: App-Test Date: Mon, 30 Jul 2018 16:19:05 +0430 Subject: [PATCH 2/5] Update Google Play Services and some other useful stuff by adb --- README.md | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 2a54982..a628b44 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Docker-Android is a docker image built to be used for everything related to mobi

Appium Conference 2018 -

+

Emulator - Samsung Device | Emulator - Nexus Device | Real Device :---------------------------:|:---------------------------:|:---------------------------: @@ -144,6 +144,14 @@ There is [example of compose file] to run complete selenium grid and docker-andr ```bash docker-compose up -d ``` +### Google Play Services +The Google play services (v12.8.74) will be downloaded from [apklinker](https://www.apklinker.com/wp-content/uploads/uploaded_apk/5b51570a214a8/com.google.android.gms_12.8.74-040700-204998136_12874026_MinAPI23_(x86)(nodpi)_apklinker.com.apk) in src/utils.sh file when emulator booted . you can edit utils.sh as you need any adb stuffs and mount it as follow in docker-compose file : + volumes: + - $PWD//videos:/tmp/video + - $PWD/src/utils.sh:/root/src/utils.sh + +or when run directly +docker run --privileged -d -p 6080:6080 -p 4723:4723 -p 5554:5554 -p 5555:5555 -v $PWD/src/utils.sh:/root/src/utils.sh -v $PWD/example/sample_apk:/root/tmp -e DEVICE="Nexus 5" -e APPIUM=true -e CONNECT_TO_GRID=true -e APPIUM_HOST="127.0.0.1" -e APPIUM_PORT=4723 -e SELENIUM_HOST="172.17.0.1" -e SELENIUM_PORT=4444 --name android-container butomo1989/docker-android-x86-8.1 Build Android project --------------------- @@ -181,9 +189,9 @@ Genymotion ![Genymotion](images/logo_genymotion.png) -Docker-Android supports [Genymotion Cloud]. +Docker-Android supports [Genymotion Cloud]. -You can easily scale your Appium tests on Genymotion Android virtual devices in the cloud. +You can easily scale your Appium tests on Genymotion Android virtual devices in the cloud. Use [device.json] to define the device to start. You can specify the port on which the device will start so you don't need to change the device name in your tests every time you need to run those tests. Then run following command ```bash @@ -279,7 +287,7 @@ The following instructions are used for OS X. You'll need [docker-machine-parall ```bash $ docker-machine create --driver=parallels prl-dev ``` - + This utility `docker-machine-parallels` will fetch boot2docker.iso to create a vm of VMWare fusion or Parallels Desktop. When the vm is created, you'll see it's booted with VMWare fusion or Parallels Desktop where the network of vm is set to NAT and one IP is assigned. You'll be able to connect to vnc service inside the docker image through that IP. Say it's `10.211.55.3` and we'll use it later. 3. Setup the virtual machine for nested virtualization support @@ -290,11 +298,11 @@ The following instructions are used for OS X. You'll need [docker-machine-parall ``` If you use VMWare Fusion, go to menu bar > Vitual Machine > Settings > Processors and Memory, expand Advanced options, and select `Enable hypervisor applications in this virtual machine`. - + ![Enable nested virtualization for VMWare Fusion](images/vmwarefusion_enable_nested_virtualization.png) - + If you use Parallels Desktop, open settings screen of that vm and go to `CPU & Memory` under `hardware` tab, expand Advanced settings and select `Enable nested virtualization`. - + ![Enable nested virtualization for Parallels Desktop](images/parallels_enable_nested_virtualization.png) 4. Enable kvm inside virtual machine From a8f7fd2d0255c9f240052d46683fa94951438b6a Mon Sep 17 00:00:00 2001 From: App-Test Date: Mon, 30 Jul 2018 16:26:57 +0430 Subject: [PATCH 3/5] Update Google Play Services and some other useful stuff by adb --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a628b44..8f3b68b 100644 --- a/README.md +++ b/README.md @@ -145,12 +145,15 @@ There is [example of compose file] to run complete selenium grid and docker-andr docker-compose up -d ``` ### Google Play Services -The Google play services (v12.8.74) will be downloaded from [apklinker](https://www.apklinker.com/wp-content/uploads/uploaded_apk/5b51570a214a8/com.google.android.gms_12.8.74-040700-204998136_12874026_MinAPI23_(x86)(nodpi)_apklinker.com.apk) in src/utils.sh file when emulator booted . you can edit utils.sh as you need any adb stuffs and mount it as follow in docker-compose file : - volumes: - - $PWD//videos:/tmp/video + +The Google play services (v12.8.74) will be downloaded from [apklinker](https://www.apklinker.com/wp-content/uploads/uploaded_apk/5b51570a214a8/com.google.android.gms_12.8.74-040700-204998136_12874026_MinAPI23_(x86)(nodpi)_apklinker.com.apk) in [utils bash file] file when emulator booted . you can edit [utils bash file] as you need any adb stuffs and mount it as follow in docker-compose file : + + volumes: + - $PWD/videos:/tmp/video - $PWD/src/utils.sh:/root/src/utils.sh or when run directly +```bash docker run --privileged -d -p 6080:6080 -p 4723:4723 -p 5554:5554 -p 5555:5555 -v $PWD/src/utils.sh:/root/src/utils.sh -v $PWD/example/sample_apk:/root/tmp -e DEVICE="Nexus 5" -e APPIUM=true -e CONNECT_TO_GRID=true -e APPIUM_HOST="127.0.0.1" -e APPIUM_PORT=4723 -e SELENIUM_HOST="172.17.0.1" -e SELENIUM_PORT=4444 --name android-container butomo1989/docker-android-x86-8.1 Build Android project @@ -359,6 +362,7 @@ Special Thanks [compose]: [line]: [example of compose file]: +[utils bash file]: [docker-compose]: [1.13.0]: [Genymotion Cloud]: From 81af88e7a4aee673ff3a5d6d314581c54c4e1a2d Mon Sep 17 00:00:00 2001 From: App-Test Date: Mon, 30 Jul 2018 16:28:41 +0430 Subject: [PATCH 4/5] Update Google Play Services and some other useful stuff by adb --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8f3b68b..1b0bff1 100644 --- a/README.md +++ b/README.md @@ -155,6 +155,7 @@ The Google play services (v12.8.74) will be downloaded from [apklinker](https:// or when run directly ```bash docker run --privileged -d -p 6080:6080 -p 4723:4723 -p 5554:5554 -p 5555:5555 -v $PWD/src/utils.sh:/root/src/utils.sh -v $PWD/example/sample_apk:/root/tmp -e DEVICE="Nexus 5" -e APPIUM=true -e CONNECT_TO_GRID=true -e APPIUM_HOST="127.0.0.1" -e APPIUM_PORT=4723 -e SELENIUM_HOST="172.17.0.1" -e SELENIUM_PORT=4444 --name android-container butomo1989/docker-android-x86-8.1 +``` Build Android project --------------------- From 9d71ecded7e9440d5b6abefae543d940c8ca5ac4 Mon Sep 17 00:00:00 2001 From: App-Test Date: Mon, 30 Jul 2018 16:30:19 +0430 Subject: [PATCH 5/5] Update Google Play Services and some other useful stuff by adb --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1b0bff1..815f7d7 100644 --- a/README.md +++ b/README.md @@ -146,7 +146,13 @@ docker-compose up -d ``` ### Google Play Services -The Google play services (v12.8.74) will be downloaded from [apklinker](https://www.apklinker.com/wp-content/uploads/uploaded_apk/5b51570a214a8/com.google.android.gms_12.8.74-040700-204998136_12874026_MinAPI23_(x86)(nodpi)_apklinker.com.apk) in [utils bash file] file when emulator booted . you can edit [utils bash file] as you need any adb stuffs and mount it as follow in docker-compose file : +The Google play services (v12.8.74) will be downloaded from [apklinker](https://www.apklinker.com/wp-content/uploads/uploaded_apk/5b51570a214a8/com.google.android.gms_12.8.74-040700-204998136_12874026_MinAPI23_(x86)(nodpi)_apklinker.com.apk) in [utils bash file] file when emulator booted . you can edit [utils bash file] as you need any adb stuffs as the following to disable emulators animation to increase performance: + + adb shell "settings put global window_animation_scale 0.0" + adb shell "settings put global transition_animation_scale 0.0" + adb shell "settings put global animator_duration_scale 0.0" + + mount it as follow in docker-compose file : volumes: - $PWD/videos:/tmp/video