redroid 安装笔记

64次阅读

redroid 安卓容器

https://hub.docker.com/r/redroid/redroid
https://github.com/remote-android/redroid-doc?tab=readme-ov-file

概述

redroid (Remote anDroid)是一种 GPU 加速的 AIC (Android In Cloud) 解决方案。您可以引导许多 Linux 主机中的实例(、 等)。 Redroid 同时支持 AND 架构。redroid 适用于云游戏、虚拟化手机、自动化测试等。Docker podman k8s arm64 amd64

初始设置

更新

apt update

安装所需的内核模块

apt install linux-modules-extra-`uname -r`
modprobe binder_linux devices="binder,hwbinder,vndbinder"
modprobe ashmem_linux

新建docker-compose.yml

#version: '3.8'

services:
  redroid:
    #image: redroid/redroid:11.0.0-latest
    image: docker.cnb.cool/wdaipc/docker-sync/redroid-redroid:11.0.0-latest_amd64
    container_name: redroid-11
    restart: unless-stopped
    pull_policy: always
    privileged: true
    #sysctls: # 开启网络转发
    #  - net.ipv4.conf.all.forwarding=1
    #dns:  # 显式配置 DNS,避免解析问题
    #  - 223.5.5.5
    #  - 119.29.29.29
    networks:
      - redroid-net
    volumes:
      - ./redroid/data:/data
      #- /lib/modules/6.8.0-79-generic:/lib/modules/6.8.0-79-generic:ro
    #ports:
    #  - "5555:5555"
    command:
      - androidboot.hardware=mt6891
      - ro.secure=0
      - ro.boot.hwc=GLOBAL
      - ro.ril.oem.imei=861503068361145
      - ro.ril.oem.imei1=861503068361145
      - ro.ril.oem.imei2=861503068361148
      - ro.ril.miui.imei0=861503068361148
      - ro.product.manufacturer=Xiaomi
      - ro.build.product=chopin
      - redroid.width=720
      - redroid.height=1280
      #- androidboot.redroid_width=1080
      #- androidboot.redroid_height=1920
      - androidboot.redroid_dpi=240
      - androidboot.redroid_net_ndns=1
      - androidboot.redroid_net_dns1=119.29.29.29
      - androidboot.redroid_gpu_mode=guest
    tty: true
    stdin_open: true
    #remove: true
    #devices:
    #  - /dev/tty:/dev/tty
    #environment:
    #  - TERM=xterm
    
  scrcpy-web:
        #image: emptysuns/scrcpy-web:v0.1
        image: docker.cnb.cool/wdaipc/docker-sync/emptysuns-scrcpy-web:v0.1_amd64
        stdin_open: true
        tty: true
        privileged: true
        volumes:
            - ./scrcpy-web/data:/data
        container_name: scrcpy-web-redroid-11
        ports:
            - 123456:8000/tcp
        environment:
            - ADBCONN=redroid:5555
        depends_on:
            - redroid
        networks:
            - redroid-net 

networks:
  redroid-net:
    external: false
    ipam:
      config:
        - subnet: 172.111.0.0/16
          gateway: 172.111.0.1

后台运行docker-compose

docker-compose up -d

停止运行docker-compose

docker-compose down

scrcpy-web 连接adb

docker exec -it scrcpy-web-redroid-11 adb connect 172.111.0.2:5555

使用scrcpy-web安装apk文件

docker exec -it scrcpy-web-redroid-11 adb install /data/xx.apk

打开 ip:123456 就可以连接了

正文完
 0