1 Star 0 Fork 1

chengwenfeng/docker-android

forked from jobily/docker-android 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

Paypal Donate PRs Welcome codecov Join the chat at https://gitter.im/budtmo/docker-android GitHub release

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).

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. Integrated with other cloud solutions, e.g. Genymotion 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

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>
14.0 34 budtmo/docker-android:emulator_14.0 budtmo/docker-android:emulator_14.0_<release_version>
- - budtmo/docker-android:genymotion budtmo/docker-android:genymotion_<release_version>

List of Devices

Type Device Name
Phone Samsung Galaxy S10
Phone Samsung Galaxy S9
Phone Samsung Galaxy S8
Phone Samsung Galaxy S7 Edge
Phone Samsung Galaxy S7
Phone Samsung Galaxy S6
Phone Nexus 4
Phone Nexus 5
Phone Nexus One
Phone Nexus S
Tablet Nexus 7

Requirements

  1. Docker is installed on your system.

Quick Start

  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.

  2. Your machine should support virtualization. To check if the virtualization is enabled is:

    sudo apt install cpu-checker
    kvm-ok
    
  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
    
  4. Open http://localhost:6080 to see inside running container.

  5. To check the status of the emulator

    docker exec -it android-container cat device_status
    

Persisting data

The default behaviour is to destroy the emulated device on container restart. To persist data, you need to mount a volume at /home/androidusr: docker run -v data:/home/androidusr budtmo/docker-android:emulator_11.0

WSL2 Hardware acceleration (Windows 11 only)

Credit goes to Guillaume - The Parallel Interface blog

Microsoft - Advanced settings configuration in WSL

  1. Add yourself to the kvm usergroup.

    sudo usermod -a -G kvm ${USER}
    
  2. Add necessary flags to /etc/wsl2.conf to their respective sections.

    [boot]
    command = /bin/bash -c 'chown -v root:kvm /dev/kvm && chmod 660 /dev/kvm'
    
    [wsl2]
    nestedVirtualization=true
    
  3. Restart WSL2 via CMD prompt or Powershell

    wsl --shutdown
    

command = /bin/bash -c 'chown -v root:kvm /dev/kvm && chmod 660 /dev/kvm' sets /dev/kvm to kvm usergroup rather than the default root usergroup on WSL2 startup.

nestedVirtualization flag is only available to Windows 11.

Use-Cases

  1. Build Android project
  2. UI-Test with Appium
  3. Control Android emulator on host machine
  4. SMS Simulation
  5. Jenkins
  6. Deploying on cloud (Azure, AWS, GCP)

Custom-Configurations

This document contains information about configurations that can be used to enable some features, e.g. log-sharing, etc.

Genymotion

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. Docker-Android is integrated with Genymotion on different cloud services, e.g. Genymotion SAAS, AWS, GCP, Alibaba Cloud. Please follow this document for more detail.

Emulator Skins

The Emulator skins are taken from Android Studio IDE and Samsung Developer Website

USERS

docker-android-users

PRO VERSION

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.

The differences between normal version and pro version are:

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
Selenium 4.x integration No Yes Running Appium UI-Tests againt one (Selenium Hub) endpoint for Android- and iOS emulator(s) / device(s)
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

This document contains detail information about how to use docker-android-pro.

LICENSE

See License

## License Information 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. You can obtain a copy of the license at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ## Forks 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. 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. We collect, process and use the following data: * Date and time when Docker-Android started * 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](./documentations/USER_BEHAVIOR_ANALYTICS.md)

简介

Docker-android 是一个基于 Docker 镜像的解决方案,旨在支持 Android 应用的开发和测试。使用该镜像,用户可以在不同的设备和皮肤上运行 Android 模拟器,并支持一系列工具如 noVNC、adb、Appium、Selenium Grid 以及与真实设备和 Genymotion Cloud 的集成。 展开 收起
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/changfeng5285/docker-android.git
git@gitee.com:changfeng5285/docker-android.git
changfeng5285
docker-android
docker-android
master

搜索帮助