当前位置: 首页 > news >正文

[Android] ubuntu虚拟机上搭建 Waydroid 环境

1.安装虚拟机




2.安装waydroid

Ubuntu/Debian and derivatives

For Droidian and Ubuntu Touch, skip directly to the last step

  • Install pre-requisites

sudo apt install curl ca-certificates -y
  • Add the official repository

curl https://repo.waydro.id | sudo bash

If the script fails to detect your distribution, you can provide a valid option by appending -s <DISTRO>. Currently supported values are: focal, jammy, kinetic, lunar, mantic, bookworm, bullseye, sid

  • Install waydroid

sudo apt install waydroid -y

Then start Waydroid from the applications menu.

 至此,waydroid已经安装完毕,如何使用见:Install Instructions - Waydroidicon-default.png?t=N7T8https://docs.waydro.id/usage/




3.下载waydoird 对应的 lineage 源码&&编译 lineage 源码

Getting started

To get started with Android/LineageOS, you'll need to get familiar with Repo and its Git workflow.

Initializing

To initialize your local repository using the LineageOS trees, use a command like this:

repo init -u https://github.com/LineageOS/android.git -b lineage-18.1 --git-lfs

repo sync build/make

Then we grab the Waydroid local_manifests

wget -O - https://raw.githubusercontent.com/waydroid/android_vendor_waydroid/lineage-18.1/manifest_scripts/generate-manifest.sh | bash

Syncing

Then to sync up:

repo sync

Then we setup the local build environment:

. build/envsetup.sh

Patching

After that is complete, we apply the Waydroid patches:

apply-waydroid-patches

How to build

Please see the LineageOS Wiki for building environment setup.

Waydroid AOSP Lunch Options:

lineage_waydroid_arm-userdebug

lineage_waydroid_arm64-userdebug

lineage_waydroid_x86-userdebug

lineage_waydroid_x86_64-userdebug

Waydroid Build Commands:

. build/envsetup.sh

lunch lineage_waydroid_arm64-userdebug

make systemimage -j$(nproc --all)

make vendorimage -j$(nproc --all)

Image Generation From Sparse Image:

The default output of the AOSP build system is an "Android Sparse Image". We need raw fileystems instead. From the same terminal where you just built a system and a vendor image, run:

simg2img $OUT/system.img ~/system.img

simg2img $OUT/vendor.img ~/vendor.img

to obtain your target raw images at ~/system.img and ~/vendor.img

Troubleshooting

Local Manifest:

To manually regenerate the local_manifests, we also have added a function to do so

waydroid-generate-manifest

After doing that you will want to resync (this will wipe out any local changes, so make sure you save your work to a different branch)

参考:

Compile Waydroid - Lineage OS based images - Waydroidicon-default.png?t=N7T8https://docs.waydro.id/development/compile-waydroid-lineage-os-based-images#how-to-build




 4.替换自己编译的 lineage 镜像,替换原有 waydroid 默认android 镜像

In order to get custom images to work on Waydroid, there are just a couple extra steps needed.

First, download the images (e.g. x86_64 gapps system and mainline vendor) manually from sourceforge or use your custom built system.img and vendor.img produced from following the Compile Instructions.

Then copy/move them to the following folder:

/etc/waydroid-extra/images/

/usr/share/waydroid-extra/images/ used to be the previously preferred path before waydroid --version 1.3.3 (it still is perfectly valid however right now as well).

An example of setting up from downloaded sourceforce zips (assuming terminal open in the directory where they were downloaded):

sudo mkdir -p /etc/waydroid-extra/images

sudo unzip lineage-*-system.zip -d /etc/waydroid-extra/images

sudo unzip lineage-*-vendor.zip -d /etc/waydroid-extra/images

rm lineage-*-system.zip lineage-*-vendor.zip

Then we need to re-init Waydroid in order for it to use the custom images:

sudo waydroid init -f

参考:Using custom Waydroid images - Waydroidicon-default.png?t=N7T8https://docs.waydro.id/faq/using-custom-waydroid-images

http://www.lryc.cn/news/262140.html

相关文章:

  • LeedCode刷题---滑动窗口问题(二)
  • pycharm依赖管理(不要用pip freeze)
  • [Kafka 常见面试题]如何保证消息的不重复不丢失
  • Java中System.setProperty()用法
  • Eclipse 自动生成注解,如果是IDEA可以参考编译器自带模版进行修改
  • 微信小程序vant安装使用过程中遇到无法构建npm的问题
  • [python]用python获取EXCEL文件内容并保存到DBC
  • Spring Boot 如何配置 log4j2
  • 如何安装docker
  • Linux 之 性能优化
  • 用Go汇编实现一个快速排序算法
  • Spring-整合MyBatis
  • sql宽字节注入
  • 开源 LLM 微调训练指南:如何打造属于自己的 LLM 模型
  • Android hilt使用
  • 2023/12/17 初始化
  • 【算法Hot100系列】三数之和
  • CSS 简介
  • myBatis-plus自动填充插件
  • 746. 使用最小花费爬楼梯 --力扣 --JAVA
  • 使用Verdaccio搭建私有npm仓库
  • 87 GB 模型种子,GPT-4 缩小版,超越ChatGPT3.5,多平台在线体验
  • Golang 数组 移除元素 双指针法 leetcode27 小记
  • c# OpenCV 图像裁剪、调整大小、旋转、透视(三)
  • Kafka相关知识
  • gitlab 通过svn hook 触发
  • 设计模式详解---单例模式
  • 毕设之-Hlang后端架构-双系统交互
  • 什么同源策略?
  • 破译模式:模式识别在计算机视觉中的作用