
Android in Docker with out QEMU/emulator
English | 简体中文
- Overview
- Getting Started
- Configuration
- Native Bridge Red meat up
- GMS Red meat up
- WebRTC Streaming
- How To Form
- Troubleshooting
- Expose
- Contact Me
- License
Overview
ReDroid (Remote anDroid) is a GPU accelerated AIC (Android In Container) answer. It’s possible you’ll also boot many
cases in Linux host (Docker
, podman
, k8s
etc.). ReDroid supports every arm64
and amd64
architectures.
ReDroid is lawful for Cloud Gaming, VMI (Virtual Cell Infurstrure), Automation Test and extra.
Currently supported:
- Android 12 (
redroid/redroid: 12.0.0-most popular
,redroid/redroid: 12.0.0-amd64
,redroid/redroid: 12.0.0-arm64
) - Android 12 64bit most productive (
redroid/redroid: 12.0.0_64most productive-most popular
,redroid/redroid: 12.0.0_64most productive-amd64
,redroid/redroid: 12.0.0_64most productive-arm64
) - Android 11 (
redroid/redroid: 11.0.0-most popular
,redroid/redroid: 11.0.0-amd64
,redroid/redroid: 11.0.0-arm64
) - Android 10 (
redroid/redroid: 10.0.0-most popular
,redroid/redroid: 10.0.0-amd64
,redroid/redroid: 10.0.0-arm64
) - Android 9 (
redroid/redroid:9.0.0-most popular
,redroid/redroid:9.0.0-amd64
,redroid/redroid:9.0.0-arm64
) - Android 8.1 (
redroid/redroid:8.1.0-most popular
,redroid/redroid:8.1.0-amd64
,redroid/redroid:8.1.0-arm64
)
Examined Platforms:
- Ubuntu 16.04 / 18.04 / 20.04 (amd64 / arm64)
- Amazon Linux 2 (amd64 / arm64)
- Alibaba Cloud Linux 2 (amd64)
- Alibaba Cloud Linux 3 (amd64 / arm64)
- WSL 2 (Ubuntu) (amd64)
- CentOS (amd64*, arm64*)
- OpenEuler 20.03 (amd64, arm64*)
means need personalized kernel
Getting Started
ReDroid requires some kernel modules (binderfs
, ashmem
etc.).
Test kernel modules to put in these modules.
required params (already added in docker image)
- qemu=1
- androidboot.hardware=redroid
uncover params
- redroid.width=720
- redroid.top=1280
- redroid.fps=15
- ro.sf.lcd_density=320
- redroid.enable_built_in_display=[0|1]
- redroid.overlayfs=[0|1]
- internet.eth0.dns1=
GPU accelerating
ReDroid use mesa3d to toddle 3D rendering.
Currently tested platforms:
- AMD (arm64, amd64 with
amdgpu
driver) - Intel (amd64 with
i915
driver) - virtio-gpu (supplier agnostic, arm64 and amd64)
params:
- redroid.gpu.mode=[auto|host|guest]
- redroid.gpu.node=[/dev/dri/renderDxxx]
Virtual WiFi (Experiment in ReDroid 10, make broken, repair quickly)
- ro.kernel.qemu.wifi=1
Virtual WiFi is still below development, be suremac80211_hwsim
exist (modprobe mac80211_hwsim
).
checkoutredroid-10-wifi
insupplier/redroid
andredroid-10.0.0
inmachine/generic/goldfish
to make
your make. bustledocker exec
ip r add default via 192.168.232.1 dev wlan0
NOTE: you might well override machine props prefixed with qemu.
or ro.
. for instance, you might well quandary ro.stable=0
, then
you might well also fetch root adb shell by default.
Native Bridge Red meat up
It’s that you just might well imagine to bustle arm
Apps in x86
ReDroid instance via libhoudini
, libndk_translator
or QEMU translator
.
Fetch libndk_translator
for instance:
# grab libndk_translator libs from Android 11 Emulator bag /machine ( -title 'libndk_translation*' -o -title '*arm*' -o -title 'ndk_translation*' ) | tar -cf native-bridge.tar -T - # example development, watch out the file proprietor and mode machine/ ├── bin │ ├── arm │ └── arm64 ├── etc │ ├── binfmt_misc │ └── init ├── lib │ ├── arm │ └── libnb.so └── lib64 ├── arm64 └── libnb.so
# Dockerfile FROM redroid/redroid: 11.0.0-amd64 ADD native-bridge.tar / COPY manufacturing facility.prop /manufacturing facility/manufacturing facility.prop
# manufacturing facility.prop
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.allow.native.bridge.exec=1
ro.dalvik.vm.native.bridge=libndk_translation.so
ro.ndk_translation.version=0.2.2
# make docker image docker make . -t redroid: 11.0.0-amd64-nb
GMS Red meat up
It’s that you just might well imagine to add GMS (Google Cell Service) toughen in ReDroid via Start GApps
or MicroG.
WebRTC Streaming
CALL FOR HELP
Idea to port WebRTC
alternate choices from cuttlefish
, including frontend (HTML5), backend and plenty digital HALs.
How To Form
It’s Identical as AOSP building course of. Nonetheless I indicate to utilize docker
to make.
Test android-builder-docker for runt print.
Troubleshooting
- Container disappeared at the moment
be sure the required kernel modules are establish in; bustle
dmesg -T
for detailed logs
- Container working, but adb can not connect (machine offline etc.)
bustle
docker exec -it
, then testsh ps -A
andlogcat
attempt
dmesg -T
if can not fetch a container shell
Expose
- Kernel 5.7+, need allow
binderfs
/ashmem
redroid
requirepid_max
lower than 65535, or else might additionally merely bustle into issues. Substitute in host OS, or addpid_max
separation toughen in PID namespace- SElinux is disabled in ReDroid; that you just might well imagine enabled with selinuxns POC
sdcardfs
currently no longer carried out, usefuse
as a change; might additionally need bustlemodprobe fuse
first in some OS (AmazonLinux2 ?)- CGroups errors left out; some (
stune
for instance) no longer supported in generic linux. procfs
no longer totally seperated with host OS; Community uselxcfs
and a few cloud supplier (TencentOS) enhanced of their very own kernel.- vintf test disabled (since no kernel)
Contact Me
- ziyang.zhou@outlook.com
- some distance off-android.slack.com (invite hyperlink: https://join.slack.com/t/some distance off-android/shared_invite/zt-q40byk2o-YHUgWXmNIUC1nweQj0L9gA)
License
ReDroid itself is below