前言
市面上已经存在很多云手机厂商如多多云、雷电云、河马云手机等
但是如果自己有现成的服务器的话 可以直接搭建云手机
技术方案
Ubuntu 20.04 上运行docker,docker运行ReDroid,scrcpy连接模拟的手机。
安装:
安装docker
1
| curl -fsSL https://get.docker.com | bash
|
安装依赖
1
2
3
| apt install linux-modules-extra-`uname -r`
modprobe binder_linux devices="binder,hwbinder,vndbinder"
modprobe ashmem_linux
|
安装adb
运行docker
1
2
3
4
5
6
| ## running redroid
docker run -itd --rm --privileged \
--pull always \
-v ~/data:/data \
-p 5555:5555 \
redroid/redroid:11.0.0-latest
|
adb 连接
1
2
3
4
5
6
| mac:/ $ adb connect ip:5555
mac:/ $ adb -s ip:5555 shell
redroid_x86_64:/ $ ls
acct bin cache d data_mirror default.prop etc init.environ.rc linkerconfig metadata odm proc sdcard sys system_ext
apex bugreports config data debug_ramdisk dev init ipc lost+found mnt oem product storage system vendor
|
下载QtScrcpy
安装app
1、安装momo 成功
2、安装某小说 失败
1
2
3
| adb -s ip:5555 install ~/Downloads/shuqi116.apk
Performing Streamed Install
adb: failed to install /Users/mengmugai/Downloads/shuqi116.apk: Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]
|
补环境 arm桥
安装依赖
1
| sudo apt install curl rsync zip unzip binwalk p7zip-full
|
下载项目
1
| git clone https://gitlab.com/android-generic/android_vendor_google_emu-x86 vendor/google/emu-x86
|
执行
1
| . vendor/google/emu-x86/update.sh x86_64
|
最后提示的目录下找到native-bridge.tar
新建一个 Dockerfile文件
1
2
3
| FROM redroid/redroid:11.0.0-amd64
# 这里后面是你这个压缩包的路径
ADD native-bridge.tar /
|
编译一下
1
2
| # build docker image
docker build . -t redroid:11.0.0-amd64-nb
|
运行
1
2
3
4
5
6
7
8
9
10
11
12
13
| # running
docker run -itd --rm --privileged \
-v ~/data11-nb:/data \
-p 5555:5555 \
redroid:11.0.0-amd64-nb \
ro.product.cpu.abilist=x86_64,arm64-v8a,x86,armeabi-v7a,armeabi \
ro.product.cpu.abilist64=x86_64,arm64-v8a \
ro.product.cpu.abilist32=x86,armeabi-v7a,armeabi \
ro.dalvik.vm.isa.arm=x86 \
ro.dalvik.vm.isa.arm64=x86_64 \
ro.enable.native.bridge.exec=1 \
ro.dalvik.vm.native.bridge=libndk_translation.so \
ro.ndk_translation.version=0.2.2
|
安装xposed
还没研究完 之后再补充
安装Magisk参考
https://github.com/remote-android/redroid-doc/issues/207
https://gist.github.com/assiless/a23fb52e8c6156db0474ee8973c4be66
本文参考https://github.com/remote-android/redroid-doc