编程开源技术交流,分享技术与知识

网站首页 > 开源技术 正文

搭建云手机平台docker-android(搭建云手机大概要多少费用)

wxchong 2024-10-10 12:54:12 开源技术 33 ℃ 0 评论

项目的官方是这么介绍这个项目的:

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

Docker-Android 是一个构建来开发测试于安卓相关应用的Docker 镜像

来看看这个项目运行起来的效果

运行这个项目之前,需要先检查您服务器对于kvm的支持,运行下面的命令,如果得到KVM acceleration can be used的输出结果,则您的服务器支持kvm,可以部署这个项目。如果输出不是这个结果,请在bios中开启虚拟化的支持。如果是虚拟机也请开启对应的虚拟化。

demouser@demohosts:~$ sudo apt install -y cpu-checker
[sudo] demouser 的密码: 
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成                 
将会同时安装下列软件:
  msr-tools
下列【新】软件包将被安装:
  cpu-checker msr-tools
升级了 0 个软件包,新安装了 2 个软件包,要卸载 0 个软件包,有 3 个软件包未被升级。
需要下载 15.8 kB 的归档。
解压缩后会消耗 65.5 kB 的额外空间。
获取:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu noble/main amd64 msr-tools amd64 1.3-5build1 [9,610 B]
获取:2 http://mirrors.tuna.tsinghua.edu.cn/ubuntu noble/main amd64 cpu-checker amd64 0.7-1.3build2 [6,148 B]
已下载 15.8 kB,耗时 0秒 (54.9 kB/s)   
正在选中未选择的软件包 msr-tools。
(正在读取数据库 ... 系统当前共安装有 156724 个文件和目录。)
准备解压 .../msr-tools_1.3-5build1_amd64.deb  ...
正在解压 msr-tools (1.3-5build1) ...
正在选中未选择的软件包 cpu-checker。
准备解压 .../cpu-checker_0.7-1.3build2_amd64.deb  ...
正在解压 cpu-checker (0.7-1.3build2) ...
正在设置 msr-tools (1.3-5build1) ...
正在设置 cpu-checker (0.7-1.3build2) ...
正在处理用于 man-db (2.12.0-4build2) 的触发器 ...
demouser@demohosts:~$ kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used

下面的两个表为项目官方提供的支持的系统版本和设备的信息表。我们要运行的基于这个项目的一些容器,就需要从这两个表中的内容进行选择。

项目官方提供的镜像列表

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>

可用的设备列表

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

项目官方的运行例子采用的模拟设备为Samsung Galaxy S10,然后使用了android11(budtmo/docker-android:emulator_11.0)的系统。命令和运行结果如下,镜像比较大有8G左右,拉取镜像的时间比较长,请耐心等待:

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_14.0
Unable to find image 'budtmo/docker-android:emulator_14.0' locally
emulator_14.0: Pulling from docker-android
560c024910be: Pull complete 
64b77aed7b78: Pull complete 
3fd5b31e0aa9: Pull complete 
670e34ea6ccb: Pull complete 
4f4fb700ef54: Pull complete 
bc62e21c56f2: Pull complete 
c1c6959469d1: Pull complete 
42ef5ecdb1fb: Pull complete 
080a8e25227e: Pull complete 
2a7c79dd2c14: Pull complete 
e4fcde3bea74: Pull complete 
5e757c9070af: Pull complete 
5aee064462b8: Pull complete 
bd01987dc087: Pull complete 
52c6e53d1d42: Pull complete 
a61455b01e22: Pull complete 
1ad9373cd855: Pull complete 
71df122140ae: Pull complete 
da1b3d0aa212: Pull complete 
512b22658f4e: Pull complete 
87ba17eefda3: Pull complete 
a7a8fb0e7ec6: Pull complete 
213056b019a9: Pull complete 
834d8049b8a8: Pull complete 
ee1ed3039be2: Pull complete 
9c8f333fd573: Pull complete 
Digest: sha256:8ee737a9b06af29c8aedf7e28cb4e636444f3ad26d74d0ebdaf2b9912e9642ea
Status: Downloaded newer image for budtmo/docker-android:emulator_14.0
64f26dba38e180467d09057ed4a27f358c99a1718402113d99acd4f469c33f93

查看其启动情况

demouser@demohosts:~$ docker ps -a
CONTAINER ID   IMAGE                                             COMMAND                   CREATED         STATUS         PORTS                                                                                    NAMES
64f26dba38e1   192.168.10.70:5000/docker-android:emulator_14.0   "/home/androidusr/do…"   2 minutes ago   Up 2 minutes   4723/tcp, 5554-5555/tcp, 5900/tcp, 9000/tcp, 0.0.0.0:6080->6080/tcp, :::6080->6080/tcp   android-container

在浏览器中输入服务器IP加上6080

点击【 连接 】的按键,稍等一下,系统开机后,就可以进入到安卓系统中。右边有模拟的控制按键可以控制。也可以使用鼠标做触控的测试。

系统为原生的安卓系统。用起来肯定是没有那些换皮肤和优化过的系统用起来那么随手,但是那它来做应用的测试还是没有问题的。

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表