sh
#检查是否支持kvm虚拟化
grep -c -w "vmx\|svm" /proc/cpuinfo
#ARM机器
find /dev -name kvm
#安装cuttle fish
sh
sudo apt-get install -y proxychains4
sudo nano /etc/proxychains4.conf
sudo apt update
sudo apt install pkg-config zip g++ zlib1g-dev unzip python3 python3-pip
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg
sudo mv bazel.gpg /etc/apt/trusted.gpg.d/
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
sudo apt update
sudo apt install bazel
sudo apt install -y git devscripts equivs config-package-dev debhelper-compat golang curl
sudo apt install -y clang libfmt-dev libgflags-dev libjsoncpp-dev libcurl4-openssl-dev libgoogle-glog-dev libgtest-dev libxml2-dev uuid-dev libprotobuf-c-dev libz3-dev bazel
sudo npm install -g n
sudo n stable
sudo npm install npm@latest -g
git clone https://github.com/google/android-cuttlefish
cd android-cuttlefish
#关闭漏洞分析
cd ~/android-cuttlefish/frontend/src/operator/webui
npm audit --prod
npm config set audit false
npm config set fund false
sudo npm set audit false
sudo npm set audit-level high
npm install --no-audit
export proxy="http://192.168.2.12:7890"
export http_proxy=$proxy
export https_proxy=$proxy
sudo su
for dir in base frontend; do
pushd $dir
# Install build dependencies
sudo mk-build-deps -i
dpkg-buildpackage -uc -us
popd
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 usermod -aG kvm,cvdnetwork,render root
sudo reboot
下载镜像 https://ci.android.com/builds/branches/aosp-main/grid
https://ci.android.com/builds/submitted/11952689/aosp_cf_x86_64_phone-trunk_staging-userdebug_coverage/latest 下载 aosp_cf_x86_64_phone-img-11952689.zip cvd-host_package.tar.gz
sh
mkdir cf
cd cf
tar -xvf cvd-host_package.tar.gz
unzip aosp_cf_x86_64_phone-img-11952689.zip
#启动
sh
sudo HOME=$PWD ./bin/launch_cvd --daemon –start_webrtc=true
sudo HOME=$PWD ./bin/launch_cvd --vm_manager=qemu_cli --start_webrtc=true --gpu_mode=guest_swiftshader
sudo HOME=$PWD ./bin/launch_cvd --vm_manager=qemu_cli --start_webrtc=true --gpu_mode=drm_virgl
sudo HOME=$PWD ./bin/launch_cvd --vm_manager=qemu_cli -start_vnc_server
sudo HOME=$PWD ./bin/stop_cvd
sudo apt install scrcpy
sudo apt install qemu-kvm
sudo apt-get install libgbm-dev
sudo usermod -a -G video $USER
sudo usermod -a -G render $USER