Big restructuring by moving to python

This commit is contained in:
budtmo
2023-05-09 19:34:44 +02:00
parent abcdf3f4d1
commit 6767970307
448 changed files with 2493 additions and 5679 deletions
+19
View File
@@ -0,0 +1,19 @@
# Git
.git/
# IDE
**/*.idea
backup
# Python
**/*.egg-info
**/*.pyc
**/__pycache__
**/venv
# Unit Test
**/.coverage
**/coverage.xml
**/xunit.xml
**/coverage
tmp/
-1
View File
@@ -1 +0,0 @@
*.mp4 filter=lfs diff=lfs merge=lfs -text
Executable → Regular
+1 -15
View File
@@ -1,17 +1,3 @@
# These are supported funding model platforms
# Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
github: [budtmo]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
# Bitcoin (BTC)
custom:
- "paypal.me/budtmo"
- "paypal.me/budtmo"
-28
View File
@@ -1,28 +0,0 @@
---
name: 🐛 Bug report
about: Report a bug to improve the tool
---
## 🐛 Bug Report
Operating System:
<!-- OSX Yosemite, Ubuntu 18.04, Windows 10 etc -->
Docker Image:
<!-- budtmo/docker-android-x86-7.1.1, budtmo/docker-android-real-device etc -->
Docker Version:
<!-- 17.09.0-ce, 17.06.2-ce etc -->
Docker-compose version (Only if you use it):
<!-- 1.16.1 etc -->
Docker Command to start docker-android:
<!-- docker run ... -->
## Expected Behavior
<!-- Explaination about expected behaviour goes here -->
## Actual Behavior
<!-- Explaination about actual behaviour goes here -->
+45
View File
@@ -0,0 +1,45 @@
name: 🐛 Bug Report
description: File a bug report
title: "[🐛 Bug ]: "
labels: [bug]
body:
- type: input
id: operating-system
attributes:
label: Operating System
description: Which host operating system do you use?
placeholder: e.g. OSX Yosemite / Ubuntu 20.04 / Windows 10 etc
validations:
required: true
- type: input
id: docker-image
attributes:
label: Docker Image
description: Which docker image do you use?
placeholder: e.g. budtmo/docker-android:emulator_10.0_v2.0 / budtmo/docker-android:genymotion_v2.0 etc
validations:
required: true
- type: textarea
id: expected-behaviour
attributes:
label: Expected behaviour
description: |
What behaviour that you expected?
validations:
required: true
- type: textarea
id: actual-behaviour
attributes:
label: Actual behaviour
description: |
What is the actual behaviour?
validations:
required: true
- type: textarea
id: logs
attributes:
label: Logs
description: |
Please provide logs here
validations:
required: false
@@ -0,0 +1,45 @@
name: 🐛 [Pro version] Bug Report
description: File a bug report
title: "[🐛 PRO | Bug ]: "
labels: [bug, pro]
body:
- type: input
id: operating-system
attributes:
label: Operating System
description: Which host operating system do you use?
placeholder: e.g. OSX Yosemite / Ubuntu 20.04 / Windows 10 etc
validations:
required: true
- type: input
id: docker-image
attributes:
label: Docker Image
description: Which docker image do you use?
placeholder: e.g. budtmo/docker-android-pro:emulator_10.0_v2.0 / budtmo/docker-android-pro:emulator_headless_10.0_v2.0 etc
validations:
required: true
- type: textarea
id: expected-behaviour
attributes:
label: Expected behaviour
description: |
What behaviour that you expected?
validations:
required: true
- type: textarea
id: actual-behaviour
attributes:
label: Actual behaviour
description: |
What is the actual behaviour?
validations:
required: true
- type: textarea
id: logs
attributes:
label: Logs
description: |
Please provide logs here
validations:
required: false
+5
View File
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: 📖 Docker-Android Documentation
url: https://github.com/budtmo/docker-android
about: Please read the whole project README before filling out an issue.
-16
View File
@@ -1,16 +0,0 @@
---
name: 🚀 Feature Request
about: Submit your idea to have cool features
---
## 🚀 Feature Request
Idea:
<!-- A clear explanation about the feature -->
Problems that want to be solved:
<!-- A clear explanation about why we need that feature -->
Note:
<!-- Additional note -->
+29
View File
@@ -0,0 +1,29 @@
name: 🚀 Feature Request
description: Submit your idea to have cool feature(s)
title: "[🚀 Feature Request ]: "
labels: [feature-request]
body:
- type: textarea
id: idea
attributes:
label: Idea
description: |
What is the idea that you want to share to improve the project?
validations:
required: true
- type: textarea
id: problem
attributes:
label: Probelm to solve
description: |
What is the problem that you want to solve with requested feature?
validations:
required: true
- type: textarea
id: Note
attributes:
label: Additional Note
description: |
Please share any additional information here if needed
validations:
required: false
-9
View File
@@ -1,9 +0,0 @@
---
name: 💬 Questions / Help
about: If you have questions, please check the group chat
---
## 💬 Questions and Help
**Please make sure that it is an issue / a feature request. If it is a question / help wanted, please visit [our group chat](https://gitter.im/budtmo/docker-android). Thank you!**
Executable → Regular
+2 -6
View File
@@ -1,12 +1,8 @@
### Purpose of changes
<!-- Please describe why this change is required / What problem you want to solve. -->
### Types of changes
_Put an `x` in the boxes that apply_
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
### How has this been tested?
<!-- Please describe in detail how you tested your changes. -->
### Purpose of changes
<!-- Please describe why this change is required / What problem you want to solve. -->
+82
View File
@@ -0,0 +1,82 @@
name: Release
on:
push:
tags:
- 'v*.*-*'
jobs:
run_test:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.8"]
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
cd cli
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run test
run: |
cd cli && nosetests -v
release_base:
runs-on: ubuntu-20.04
needs: run_test
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- name: Get release version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Build and push base image (${RELEASE_VERSION})
run: |
docker login -u=${{secrets.DOCKER_USERNAME}} -p=${{secrets.DOCKER_PASSWORD}}
./app.sh push base ${RELEASE_VERSION}
docker logout
release_emulator:
runs-on: ubuntu-20.04
needs: release_base
strategy:
matrix:
android: ["9.0", "10.0", "11.0", "12.0", "13.0"]
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- name: Get release version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Build and push emulator image ${{ matrix.android }} (${RELEASE_VERSION})
run: |
docker login -u=${{secrets.DOCKER_USERNAME}} -p=${{secrets.DOCKER_PASSWORD}}
./app.sh push emulator ${RELEASE_VERSION} ${{ matrix.android }}
docker logout
release_genymotion:
runs-on: ubuntu-20.04
needs: release_base
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- name: Get release version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Build and push genymotion image (${RELEASE_VERSION})
run: |
docker login -u=${{secrets.DOCKER_USERNAME}} -p=${{secrets.DOCKER_PASSWORD}}
./app.sh push genymotion ${RELEASE_VERSION}
docker logout
+25
View File
@@ -0,0 +1,25 @@
name: Run Test
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build_and_test:
runs-on: ubuntu-20.04
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- name: Build base image
run: script -e -c "./app.sh build base test"
- name: Build emulator image and run unit-test
run: script -e -c "./app.sh test emulator test 11.0 && sudo mv tmp/* . && ls -al"
- name: Publish test result
run: script -e -c "bash <(curl -s https://codecov.io/bash)"
+19 -8
View File
@@ -1,9 +1,20 @@
.idea/*
.DS_Store
*.pyc
# IDE
**/*.idea
backup
# Coverage
.coverage
coverage.xml
xunit.xml
coverage/*
# Python
**/*.egg-info
**/*.pyc
**/__pycache__
**/venv
# Unit Test
**/.coverage
**/coverage.xml
**/xunit.xml
**/coverage
tmp/
# Dev-files
n*.txt
test-*.sh
-37
View File
@@ -1,37 +0,0 @@
# Docker-Android's Anonymous Aggregate User Behaviour Analytics
Docker-Android has begun gathering anonymous aggregate user behaviour analytics and reporting these to Google Analytics. You are notified about this when you start Docker-Android.
## Why?
Docker-Android is provided free of charge for our internal and external users and we don't have direct communication with its users nor time resources to ask directly for their feedback. As a result, we now use anonymous aggregate user analytics to help us understand how Docker-Android is being used, the most common used features based on how, where and when people use it. With this information we can prioritize some features over other ones.
## What?
Docker-Android's analytics record some shared information for every event:
- The Google Analytics version i.e. `1` (https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#v)
- The Google Analytics anonymous IP setting is enabled i.e. `1` (https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#aip)
- The Docker-Android analytics tracking ID e.g. `UA-133466903-1` (https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#tid)
- The release version of machine, e.g. `Linux_version_4.4.16-boot2docker_(gcc_version_4.9.2_(Debian_4.9.2-10)_)_#1_SMP_Fri_Jul_29_00:13:24_UTC_2016` This does not allow us to track individual users but does enable us to accurately measure user counts vs. event counts (https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#cid)
- Docker-Android analytics hit type, e.g. `event` (https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#t)
- Application type, e.g. `Emulator` (https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#ec)
- Description will contains information about Emulator configuration, e.g. `Processor type`. (https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#el)
- Docker-Android application name, e.g. `docker-android` (https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#an)
- Docker-Android application version, e.g. `1.5-p0` (https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#av)
With the recorded information, it is not possible for us to match any particular real user.
As far as we can tell it would be impossible for Google to match the randomly generated analytics user ID to any other Google Analytics user ID. If Google turned evil the only thing they could do would be to lie about anonymising IP addresses and attempt to match users based on IP addresses.
## When/Where?
Docker-Android's analytics are sent throughout Docker-Android's execution to Google Analytics over HTTPS.
## Who?
Docker-Android's analytics are accessible to Docker-Android's current maintainers. Contact [@budtmo](https://github.com/budtmo) if you are a maintainer and need access.
## How?
The code is viewable in [this script](./src/appium.sh).
## Opting out before starting Docker-Android
Docker-Android analytics helps us, maintainers and leaving it on is appreciated. However, if you want to opt out and not send any information, you can do this by using passing environment variable GA=false to the Docker container.
## Disclaimer
This document and the implementation are based on the great idea implemented by [Homebrew](https://github.com/Homebrew/brew/blob/master/docs/Analytics.md)
+20 -10
View File
@@ -1,6 +1,6 @@
## License Information
Copyright 2016 budi utomo
Copyright 2023 budi utomo
This program is subject to the terms of the Apache License, Version 2.0 AND the following amendments on forks and data processing. Thus, this is a Custom Apache 2.0 License, NOT a dual-license model you may choose from.
@@ -12,10 +12,10 @@ Unless required by applicable law or agreed to in writing, software distributed
## Forks
Additionally to Apache-2.0, when you fork this repo you are required to either remove our Google Analytics tracking ID: UA-133466903-1 or stop usage gathering completely.
Additionally to Apache-2.0, when you fork this repo you are required to either remove our Google Form ID: 1FAIpQLSdrKWQdMh6Nt8v8NQdYvTIntohebAgqWCpXT3T9NofAoxcpkw or stop usage gathering completely.
## Data processing agreement
By using this software you agree that the following non-PII (non personally identifiable information) data will be collected, processed and used by the maintainers for the purpose of improving the docker-android project. Anonymisation with respect of the IP address means that only the first two octets of the IP address are collected.
By using this software you agree that the following non-PII (non personally identifiable information) data will be collected, processed and used by the maintainers for the purpose of improving the docker-android project.
By using this software you also grant us a nonexclusive, irrevocable, world-wide, perpetual royalty-free permission to use, modify and publish these data for all purposes, internally or publicly, including the right to sub-license said permission rights.
@@ -23,14 +23,24 @@ By using this software you also grant us a nonexclusive, irrevocable, world-wide
We collect, process and use the following data:
* Release version of Docker-Android
* Anonymized IP address (only first two octets)
* Country and city
* Date and time when Docker-Android started
* User (it will collect the information about Release Version of Machine)
* Application type, e.g. Emulator or Device or Genymotion
* Emulator configuration, e.g. Processor type, Device name, Appium mode, Selenium grid mode and mobile test mode
* User (it will collect the information about Release Version of Machine), e.g. Linux-5.4.0-146-generic-x86_64-with-glibc2.29_#163-Ubuntu_SMP_Fri_Mar_17_18:26:02_UTC_2023. This does not allow us to track individual users but does enable us to accurately measure user counts
* City (the information come from https://ipinfo.io)
* Region (the information come from https://ipinfo.io)
* Country (the information come from https://ipinfo.io)
* Release version of Docker-Android
* Appium (Whether user use Appium or not - The possible value will be "true" or "false")
* Appium Additional Arguments
* Web-Log (Whether user use Web-Log feature or not - The possible value will be "true" or "false")
* Web-Vnc (Whether user use Web-Vnc feature or not - The possible value will be "true" or "false")
* Screen-Resolution
* Device Type (Which docker image is used - The possible value will be "emulator" or "geny_cloud" or "geny_aws")
* Emulator Device (Which device profile and skin is used if the user use device_type "emulator")
* Emulator Android Version (Which Android version is used if the user use device_type "emulator"
* Emulator No-Skin feature (Whether user use no-skin feature or not - The possible value will be "true" or "false")
* Emulator Data Partition
* Emulator Additional Arguments
## End of License Information
More information about anonymized data collection can be seen [here](Analytics.md)
More information about anonymized data collection can be seen [here](./documentations/USER_BEHAVIOR_ANALYTICS.md)
View File
+63 -226
View File
@@ -1,60 +1,32 @@
<p align="center">
<img id="header" src="./images/logo_dockerandroid_small.png" />
<img id="header" src="./images/logo_docker-android.png" />
</p>
[![Analytics](https://ga-beacon.appspot.com/UA-133466903-1/github/budtmo/docker-android/README.md)](https://github.com/igrigorik/ga-beacon "Analytics")
[![Join the chat at https://gitter.im/budtmo/docker-android](https://badges.gitter.im/budtmo/docker-android.svg)](https://gitter.im/budtmo/docker-android?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://dev.azure.com/budtmoos/budtmoos/_apis/build/status/budtmo.docker-android.test?branchName=master)](https://dev.azure.com/budtmoos/budtmoos/_build/latest?definitionId=7&branchName=master)
[![codecov](https://codecov.io/gh/budtmo/docker-android/branch/master/graph/badge.svg)](https://codecov.io/gh/budtmo/docker-android)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/3f000ffb97db45a59161814e1434c429)](https://www.codacy.com/app/butomo1989/docker-appium?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=butomo1989/docker-appium&amp;utm_campaign=Badge_Grade)
[![GitHub release](https://img.shields.io/github/release/budtmo/docker-android.svg)](https://github.com/budtmo/docker-android/releases)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fbudtmo%2Fdocker-android.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fbudtmo%2Fdocker-android?ref=badge_shield)
[![Paypal Donate](https://img.shields.io/badge/paypal-donate-blue.svg)](http://paypal.me/budtmo)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
[![Paypal Donate](https://img.shields.io/badge/paypal-donate-blue.svg)](http://paypal.me/budtmo) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![Join the chat at https://gitter.im/budtmo/docker-android](https://badges.gitter.im/budtmo/docker-android.svg)](https://gitter.im/budtmo/docker-android?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![codecov](https://codecov.io/gh/budtmo/docker-android/branch/master/graph/badge.svg)](https://codecov.io/gh/budtmo/docker-android) [![GitHub release](https://img.shields.io/github/release/budtmo/docker-android.svg)](https://github.com/budtmo/docker-android/releases)
Docker-Android is a docker image built to be used for everything related to mobile website testing and Android project.
Docker-Android is a docker image built to be used for everything related to Android. It can be used for Application development and testing (native, web and hybrid-app).
Emulator - Samsung Device | Emulator - Nexus Device | Real Device
:---------------------------:|:---------------------------:|:---------------------------:
![][emulator samsung] |![][emulator nexus] |![][real device]
Purposes
--------
1. Run UI tests for mobile websites with [appium]
2. Build Android project and run unit tests with the latest build-tools
3. Run UI tests for Android applications with different frameworks ([appium], [espresso], [robotium], etc.)
4. Run monkey / stress tests
5. SMS testing
Advantages compare with other docker-android projects
-----------------------------------------------------
1. noVNC to see what happen inside docker container
2. Emulator for different devices / skins, such as Samsung Galaxy S6, LG Nexus 4, HTC Nexus One and more.
3. Ability to connect to Selenium Grid
Advantages of using this projects
---------------------------------
1. Emulator with different device profile and skins, such as Samsung Galaxy S6, LG Nexus 4, HTC Nexus One and more.
2. Support vnc to be able to see what happen inside docker container
3. Support log sharing feature where all logs can be accessed from web-UI
4. Ability to control emulator from outside container by using adb connect
5. Support real devices with screen mirroring
6. Ability to record video during test execution for debugging
7. Integrated with other cloud solutions, e.g. [Genymotion Cloud](https://www.genymotion.com/cloud/)
8. Open source with more features coming
5. Integrated with other cloud solutions, e.g. [Genymotion Cloud](https://www.genymotion.com/cloud/)
6. It can be used to build Android project
7. It can be used to run unit and UI-Test with different test-frameworks, e.g. Appium, Espresso, etc.
List of Docker images
List of Docker-Images
---------------------
|OS |Android |API |Browser |Browser version |Chromedriver |Image |Size |
|:---|:---|:---|:---|:---|:---|:---|:---|
|Linux|6.0|23|browser|44.0|2.18|budtmo/docker-android-x86-6.0|[![](https://images.microbadger.com/badges/image/budtmo/docker-android-x86-6.0.svg)](https://microbadger.com/images/budtmo/docker-android-x86-6.0 "Get your own image badge on microbadger.com")|
|Linux|7.0|24|chrome|51.0|2.23|budtmo/docker-android-x86-7.0|[![](https://images.microbadger.com/badges/image/budtmo/docker-android-x86-7.0.svg)](https://microbadger.com/images/budtmo/docker-android-x86-7.0 "Get your own image badge on microbadger.com")|
|Linux|7.1.1|25|chrome|55.0|2.28|budtmo/docker-android-x86-7.1.1|[![](https://images.microbadger.com/badges/image/budtmo/docker-android-x86-7.1.1.svg)](https://microbadger.com/images/budtmo/docker-android-x86-7.1.1 "Get your own image badge on microbadger.com")|
|Linux|8.0|26|chrome|58.0|2.31|budtmo/docker-android-x86-8.0|[![](https://images.microbadger.com/badges/image/budtmo/docker-android-x86-8.0.svg)](https://microbadger.com/images/budtmo/docker-android-x86-8.0 "Get your own image badge on microbadger.com")|
|Linux|8.1|27|chrome|61.0|2.33|budtmo/docker-android-x86-8.1|[![](https://images.microbadger.com/badges/image/budtmo/docker-android-x86-8.1.svg)](https://microbadger.com/images/budtmo/docker-android-x86-8.1 "Get your own image badge on microbadger.com")|
|Linux|9.0|28|chrome|66.0|2.40|budtmo/docker-android-x86-9.0|[![](https://images.microbadger.com/badges/image/budtmo/docker-android-x86-9.0.svg)](https://microbadger.com/images/budtmo/docker-android-x86-9.0 "Get your own image badge on microbadger.com")|
|Linux|10.0|29|chrome|74.0|74.0.3729.6|budtmo/docker-android-x86-10.0|[![](https://images.microbadger.com/badges/image/budtmo/docker-android-x86-10.0.svg)](https://microbadger.com/images/budtmo/docker-android-x86-10.0 "Get your own image badge on microbadger.com")|
|Linux|11.0|30|chrome|83.0|83.0.4103.39|budtmo/docker-android-x86-11.0|[![](https://images.microbadger.com/badges/image/budtmo/docker-android-x86-11.0.svg)](https://microbadger.com/images/budtmo/docker-android-x86-11.0 "Get your own image badge on microbadger.com")|
|Linux|12.0|31|chrome|93.0|93.0.4577.15|budtmo/docker-android-x86-12.0|[![](https://images.microbadger.com/badges/image/budtmo/docker-android-x86-12.0.svg)](https://microbadger.com/images/budtmo/docker-android-x86-12.0 "Get your own image badge on microbadger.com")|
|All |-|-|-|-|-|budtmo/docker-android-real-device|[![](https://images.microbadger.com/badges/image/budtmo/docker-android-real-device.svg)](https://microbadger.com/images/budtmo/docker-android-real-device "Get your own image badge on microbadger.com")|
|All|All|All|All|All|All|budtmo/docker-android-genymotion|[![](https://images.microbadger.com/badges/image/budtmo/docker-android-genymotion.svg)](https://microbadger.com/images/budtmo/docker-android-genymotion "Get your own image badge on microbadger.com")|
|Android |API |Image with latest release version |Image with specific release version|
|:---|:---|:---|:---|
|9.0|28|budtmo/docker-android:emulator_9.0|budtmo/docker-android:emulator_9.0_<release_version>|
|10.0|29|budtmo/docker-android:emulator_10.0|budtmo/docker-android:emulator_10.0_<release_version>|
|11.0|30|budtmo/docker-android:emulator_11.0|budtmo/docker-android:emulator_11.0_<release_version>|
|12.0|32|budtmo/docker-android:emulator_12.0|budtmo/docker-android:emulator_12.0_<release_version>|
|13.0|33|budtmo/docker-android:emulator_13.0|budtmo/docker-android:emulator_13.0_<release_version>|
|-|-|budtmo/docker-android:genymotion|budtmo/docker-android:genymotion_<release_version>|
List of Devices
---------------
@@ -76,162 +48,45 @@ Tablet | Nexus 7
Requirements
------------
Docker is installed in your system.
1. Docker is installed on your system.
Quick Start
-----------
1. Your machine need to support virtualization. To check it:
1. If you use ***Ubuntu OS*** on your host machine, you can skip this step. For ***OSX*** and ***Windows OS*** user, you need to use Virtual Machine that support Virtualization with Ubuntu OS because the image can be run under ***Ubuntu OS only***.
```
sudo apt install cpu-checker
kvm-ok
```
2. Run Docker-Android
- For ***Linux OS***, please use image name that contains "x86"
```bash
docker run --privileged -d -p 6080:6080 -p 5554:5554 -p 5555:5555 -e DEVICE="Samsung Galaxy S6" --name android-container budtmo/docker-android-x86-8.1
```
- For ***OSX*** and ***Windows OS***, please use Virtual Machine that support Virtualization with Ubuntu OS
3. Verify the ip address of docker host.
- For OSX, you can find out by using following command:
```bash
docker-machine ip default
```
- For different OS, localhost should work.
4. Open ***http://docker-host-ip-address:6080*** from web browser. Note: Adding ```?view_only=true``` will give user only view only permission.
Custom configurations
---------------------
[This document](README_CUSTOM_CONFIG.md) contains custom configurations of Docker-Android that you might need, e.g. Proxy, Changing language on fly, etc.
Build Android project
---------------------
Docker-Android can be used for building Android project and executing its unit test. This following steps will illustrate how to build Android project:
1. Clone [this sample test project](https://github.com/android/testing-samples).
```bash
git clone git@github.com:android/testing-samples.git
2. Your machine should support virtualization. To check if the virtualization is enabled is:
```
sudo apt install cpu-checker
kvm-ok
```
2. Build the project
```bash
docker run -it --rm -v $PWD/testing-samples/ui/espresso/BasicSample:/tmp -w /tmp budtmo/docker-android-x86-8.1 /tmp/gradlew build
3. Run Docker-Android container
```
docker run -d -p 6080:6080 -e EMULATOR_DEVICE="Samsung Galaxy S10" -e WEB_VNC=true --device /dev/kvm --name android-container budtmo/docker-android:emulator_11.0
```
Control Android connected to host (Emulator or Real Device)
-----------------------------------------------------------
1. Create a docker container with this command
4. Open ***http://localhost:6080*** to see inside running container.
```
$ docker run --privileged -d -p 6080:6080 -p 5554:5554 -p 5555:5555 -p 4723:4723 --name android-container-appium budtmo/docker-android-real-device
```
5. To check the status of the emulator
```
docker exec -it android-container cat device_status
```
2. Open noVNC [http://localhost:6080](http://localhost:6080)
Use-Cases
---------
3. Open terminal by clicking right on **noVNC** window >> **Terminal emulator**
1. [Build Android project](./documentations/USE_CASE_BUILD_ANDROID_PROJECT.md)
2. [UI-Test with Appium](./documentations/USE_CASE_APPIUM.md)
3. [Control Android emulator on host machine](./documentations/USE_CASE_CONTROL_EMULATOR.md)
4. [SMS Simulation](./documentations/USE_CASE_SMS.md)
5. [Jenkins](./documentations/USE_CASE_JENKINS.md)
6. [Deploying on cloud (Azure, AWS, GCP)](./documentations/USE_CASE_CLOUD.md)
4. To connect to host's adb (make sure your host have adb and connected to the device.)
Custom-Configurations
---------------------
```
$ adb -H host.docker.internal devices
```
To specify port, just add `-P port_number`
```
$ adb -H host.docker.internal -P 5037 devices
```
5. Now your container can access your host devices. But, you need to add `remoteAdbHost` and `adbPort` desired capabilities to make **Appium** can recognise those devices.
Appium and Selenium Grid
------------------------
If you want to use Appium and Selenium Grid, you can follow [this document](README_APPIUM_AND_SELENIUM.md). It also contains sample and use cases.
Control android emulator outside container
------------------------------------------
```bash
adb connect <docker-machine-ip-address>:5555
```
![][adb_connection]
**Note:** You need to have Android Debug Bridge (adb) installed in your host machine.
SMS Simulation
--------------
1. Using telnet
- Find the auth_token and copy it.
```bash
docker exec -it android-container cat /root/.emulator_console_auth_token
```
- Access emulator using telnet and login with auth_token
```bash
telnet <docker-machine-ip-address> 5554
```
- Login with given auth_token from 1.step
```bash
auth <auth_token>
```
- Send the sms
```bash
sms send <phone_number> <message>
```
2. Using adb
```bash
docker exec -it android-container adb emu sms send <phone_number> <message>
```
3. You can also integrate it inside project using adb library.
![][sms]
Google Play Services and Google Play Store
------------------------------------------
Not installed at this time.
Jenkins
-------
This [document](README_JENKINS.md) gives you information about custom plugin that supports Docker-Android.
VMWARE
------
This [document](README_VMWARE.md) shows you how to configure Virtual Machine on VMWARE to be able to run Docker-Android.
Cloud
-----
This [document](README_CLOUD.md) contains information about deploying Docker-Android on cloud services.
This [document](./documentations/CUSTOM_CONFIGURATIONS.md) contains information about configurations that can be used to enable some features, e.g. log-sharing, etc.
Genymotion
----------
@@ -240,52 +95,34 @@ Genymotion
<img id="geny" src="./images/logo_genymotion_and_dockerandroid.png" />
</p>
For you who do not have ressources to maintain the simulator or to buy machines or need different device profiles, you need to give a try to [Genymotion Cloud](https://www.genymotion.com/cloud/). Docker-Android is integrated with Genymotion on different cloud services, e.g. Genymotion Cloud, AWS, GCP, Alibaba Cloud. Please follow [this document](README_GENYMOTION.md) or [this blog](https://medium.com/genymobile/run-your-appium-tests-using-docker-android-genymotion-cloud-e4817132ccd8) for more detail.
Troubleshooting
---------------
All logs inside container are stored under folder **/var/log/supervisor**. you can print out log file by using **docker exec**. Example:
```bash
docker exec -it android-container tail -f /var/log/supervisor/docker-android.stdout.log
```
For you who do not have ressources to maintain the simulator or to buy machines or need different device profiles, you can give a try by using [Genymotion SAAS](https://cloud.geny.io/). Docker-Android is [integrated with Genymotion](https://www.genymotion.com/blog/partner_tag/docker/) on different cloud services, e.g. Genymotion SAAS, AWS, GCP, Alibaba Cloud. Please follow [this document](./documentations/THIRD_PARTY_GENYMOTION.md) for more detail.
Emulator Skins
--------------
The Emulator skins are taken from [Android Studio IDE](https://developer.android.com/studio) and [Samsung Developer Website](https://developer.samsung.com/)
Monitoring
----------
You can use [cadvisor](https://github.com/google/cadvisor) combined with influxdb / prometheus and grafana if needed to monitor each running container.
PRO VERSION
-----------
Users
-----
Docker-Android are being used by 100+ countries around the world.
Due to high requests for help and to be able to actively maintain the projects, the creator has decided to create docker-android-pro. Docker-Android-Pro is a sponsor based project which mean that the docker image of pro-version can be pulled only by [active sponsor](https://github.com/sponsors/budtmo).
[![ga-datastudio-docker-android](./images/docker-android_users.png)](https://datastudio.google.com/s/ht7HVKHKAQE)
The differences between normal version and pro version are:
Stargazers over time
--------------------
|Feature |Normal |Pro |Comment|
|:---|:---|:---|:---|
|user-behavior-analytics|Yes|No|-|
|proxy|No|Yes|Set up company proxy on Android emulator on fly|
|language|No|Yes|Set up language on Android emulator on fly|
|root-privileged|No|Yes|Able to run command with security privileged|
|headless-mode|No|Yes|Save resources by using headless mode|
|multiple Android-Simulators|No|Yes (soon)|Save resources by having multiple Android-Simulators on one docker-container|
|Google Play Store|No|Yes (soon)|-|
|Video Recording|No|Yes (soon)|Helpful for debugging|
[![Stargazers over time](https://starchart.cc/budtmo/docker-android.svg)](https://starchart.cc/budtmo/docker-android)
This [document](./documentations/DOCKER-ANDROID-PRO.md) contains detail information about how to use docker-android-pro.
Special Thanks
--------------
- [Gian Christanto] for creating a great logo!
LICENSE
--------------
-------
See [License](LICENSE.md)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fbudtmo%2Fdocker-android.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fbudtmo%2Fdocker-android?ref=badge_large)
[appium]: <https://appium.io>
[espresso]: <https://developer.android.com/training/testing/espresso/>
[robotium]: <https://github.com/RobotiumTech/robotium>
[emulator samsung]: <images/emulator_samsung_galaxy_s6.png>
[emulator nexus]: <images/emulator_nexus_5.png>
[real device]: <images/real_device.png>
[adb_connection]: <images/adb_connection.png>
[sms]: <images/SMS.png>
[gian christanto]: <https://www.linkedin.com/in/gian-christanto-0b398b131/>
-56
View File
@@ -1,56 +0,0 @@
Run Appium Server
-----------------
Appium is automation test framework to test mobile website and mobile application, including Android. To be able to use Appium, you need to run appium-server. You run Appium-Server inside docker-android container by ***opening port 4723*** and ***passing an environment variable APPIUM=true***.
```bash
docker run --privileged -d -p 6080:6080 -p 5554:5554 -p 5555:5555 -p 4723:4723 -e DEVICE="Samsung Galaxy S6" -e APPIUM=true --name android-container budtmo/docker-android-x86-8.1
```
### Share Volume
If you want to use appium to test UI of your android application, you need to share volume where the APK is located to folder ***/root/tmp***.
```bash
docker run --privileged -d -p 6080:6080 -p 4723:4723 -p 5554:5554 -p 5555:5555 -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 budtmo/docker-android-x86-8.1
```
### Connect to Selenium Grid
It is also possible to connect appium server that run inside docker-android with selenium grid by passing following environment variables:
- CONNECT\_TO\_GRID=true
- APPIUM_HOST="\<host\_ip\_address>"
- APPIUM_PORT=\<port\_number>
- SELENIUM_HOST="\<host\_ip\_address>"
- SELENIUM_PORT=\<port\_number>
- SELENIUM_TIMEOUT=\<timeout\_in\_seconds>
- SELENIUM_PROXY_CLASS=\<selenium\_proxy\_class\_name>
To run tests for mobile browser, following parameter can be passed:
- MOBILE\_WEB\_TEST=true
```bash
docker run --privileged -d -p 6080:6080 -p 4723:4723 -p 5554:5554 -p 5555:5555 -e DEVICE="Samsung Galaxy S6" -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 -e MOBILE_WEB_TEST=true --name android-container budtmo/docker-android-x86-8.1
```
### Video Recording
You can deactivate auto_record by changing the value to "False" in docker-compose file. e.g. change value to "False" in this [line](docker-compose.yml#L70).
### Relaxed Security
Pass environment variable RELAXED_SECURITY=true to disable additional security check to use some advanced features.
### Docker-Compose
![][compose]
There is [example of compose file](docker-compose.yml) to run complete selenium grid and docker-android container as nodes. [docker-compose](https://docs.docker.com/compose/install/) version [1.13.0](https://github.com/docker/compose/releases/tag/1.13.0) or higher is required to be able to execute that compose file.
```bash
docker-compose up -d
```
[compose]: <images/compose.png>
-88
View File
@@ -1,88 +0,0 @@
VNC pass
--------
Passing ```VNC_PASSWORD="your_pass_here"``` will secure your vnc connection.
Proxy
-----
You can enable proxy inside container and Android emulator by passing following environment variables:
- HTTP_PROXY="http://\<docker\_bridge\_ip>:<port>"
- HTTPS_PROXY=""http://\<docker\_bridge\_ip>:<port>"
- NO_PROXY="localhost"
- ENABLE_PROXY_ON_EMULATOR=true
Proxy with authentication
----
You can set proxy with authentication by passing following environment variable:
- HTTP_PROXY_USER="\<username>"
- HTTP_PROXY_PASSWORD="\<password>"
Language
--------
You can change the language setting of Android Emulator on the fly by passing following environment variable:
- LANGUAGE="\<language>"
- COUNTRY="\<country>"
Data partition size
-------------------
The size of the data partition can be set by passing the following environment variable:
- DATAPARTITION="\<size>"
The value can be specified in the same format that is used by the emulator config file (`disk.dataPartition.size`), e.g. `800m`.
Camera
------
Passing following environment variable to be able to connect laptop / pc camera to Android emulator:
- EMULATOR_ARGS="-camera-back webcam0"
Custom Avd name Arguments
-------------------------
Passing following environment variable to set a custom avd name
- AVD_NAME="customName"
Custom Emulator Arguments
-------------------------
If you want to add more arguments for running emulator, you can ***pass an environment variable EMULATOR_ARGS*** while running docker command.
```bash
docker run --privileged -d -p 6080:6080 -p 4723:4723 -p 5554:5554 -p 5555:5555 -e DEVICE="Samsung Galaxy S6" -e EMULATOR_ARGS="-no-snapshot-load -partition-size 512" --name android-container budtmo/docker-android-x86-8.1
```
SaltStack
---------
You can enable [SaltStack](https://github.com/saltstack/salt) to control running containers by passing environment variable SALT_MASTER=<ip_address_of_salt_master>.
Back & Restore
--------------
If you want to backup/reuse the avds created with furture upgrades or for replication, run the container with two extra mounts
- -v local_backup/.android:/root/.android
- -v local_backup/android_emulator:/root/android_emulator
```bash
docker run --privileged -d -p 6080:6080 -p 4723:4723 -p 5554:5554 -p 5555:5555 -v local_backup/.android:/root/.android -v local_backup/android_emulator:/root/android_emulator -e DEVICE="Nexus 5" --name android-container budtmo/docker-android-x86-8.1
```
For the first run, this will create a new avd and all the changes will be accessible in the `local_backup` directory. Now for all future runs, it will reuse the avds. Even this should work with new releases of `docker-android`
Nginx
-----
Sample nginx configuration can be found [here](nginx)

Some files were not shown because too many files have changed in this diff Show More