Cuttlefish安装和运行

1.验证KVM可用性(X86机器)

grep -c -w "vmx\|svm" /proc/cpuinfo

如果返回非0值,则说明kvm已经配置好。

2.安装Cuttlefish模拟器

sudo apt install git devscripts config-package-dev debhelper-compat golang curl

git clone https://github.com/google/android-cuttlefish

cd android-cuttlefish

for dir in base frontend; do

  cd $dir

  debuild -i -us -uc -b -d

  cd ..

done

sudo dpkg -i ./cuttlefish-base_*_*64.deb || sudo apt-get install -f

sudo dpkg -i ./cuttlefish-user_*_*64.deb || sudo apt-get install -f

sudo usermod -aG kvm,cvdnetwork,render $USER

sudo reboot
  • 这里面有go语言环境的坑,修改以下配置

  • vim android-cuttlefish/frontend/src/goutil
    
    # 将下面这一行注释掉,添加后面的两行
    # export GOPROXY="proxy.golang.org|proxy.golang.org|direct"
    export GO111MODULE=on
    export GOPROXY=https://goproxy.io

    3.编译Android镜像

  • source build/envsetup.sh
    
    lunch aosp_cf_x86_64_phone-userdebug
    
    m

    4.Cuttlefish模拟器加载镜像开机

  • launch_cvd --start_webrtc=true

  • WebRTC流式传输显示画面优点。

  • 1.无需在客户端计算机中安装任何其他软件。 

    2.比VNC 更高效的编码

    3.浏览器使用adb

    4.可扩展协议(摄像头、麦克风、传感器数据都可以通过WebRTC实现)

 5.在浏览器中查看

https://localhost:8443

6.Cuttlefish多屏显示

cvd start \

--display=width=1080,height=600 \

--display=width=400,height=600,dpi=120 \

--display=width=800,height=600,refresh_rate_hz=30



adb shell am start-activity -n com.android.dialer/.main.impl.MainActivity --display 1

 7.Cuttlefish启动多个模拟设备

 launch_cvd --start_webrtc=true --num_instances= 2

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值