Windows有WSA,Linux有Waydroid,两者的性能损失之小都相当可观。
虽然两者目前都不够成熟,有许多需要改进之处,但还是非常好用的。
环境
$ uname -a |
安装waydroid
yay -S waydroid |
下载完成后将.img
文件解压到/usr/share/waydroid-extra/images
目录下,文件夹若不存在则创建。
sudo waydroid init |
此时应该可以正常使用了。
常用命令
确保 waydroid-container.service
正在运行,然后执行:
waydroid session start |
Waydroid 会话现在已处于活动状态,这里有一些与 Waydroid 交互的实用命令:
启动 GUI:
waydroid show-full-ui |
启动 shell:
waydroid shell |
安装应用程序:
waydroid app install $path_to_apk |
运行应用程序:
waydroid app launch $package-name #Can be retrieved with `waydroid app list` |
注意,安装的安卓应用可能会显示在linux系统的应用中,但最好不要直接点击它来启动应用,而是使用命令行:
➜ ~ sudo systemctl status waydroid-container
● waydroid-container.service - Waydroid Container
Loaded: loaded (/usr/lib/systemd/system/waydroid-container.service; enable>
Active: active (running) since Wed 2023-07-05 01:02:16 CST; 3min 56s ago
Main PID: 574 (python3)
Tasks: 2 (limit: 9204)
Memory: 35.9M
CPU: 229ms
CGroup: /system.slice/waydroid-container.service
└─574 python3 /usr/bin/waydroid -w container start
7月 05 01:02:15 dionysen-latitude7430 systemd[1]: Starting Waydroid Container...
7月 05 01:02:16 dionysen-latitude7430 systemd[1]: Started Waydroid Container.
# 确保服务正在运行
waydroid session start
# 然后再去点击Waydroid的应用图标
另:由于系统对应的架构是x86_64,因此最好去一些网站下载此架构的应用,如appmirror(需梯子)。
Setting up a shared folder
User @wachidadinugroho has worked out the details on how to setup a shared folder to be used between Waydroid and your host filesystem.
Setting up a shared folder will allow the user to copy/paste files from the host and they appear inside waydroid/android. sudo mount --bind <source> ~/.local/share/waydroid/data/media/0/<target>
Then verify that the target folder exists:
sudo ls ~/.local/share/waydroid/data/media/0/
Examples:
sudo mount --bind ~/Documents ~/.local/share/waydroid/data/media/0/Documents |
You can also make your own custom mount point to cater to your needs.
- 本文标题:使用Waydroid在Linux上运行x86_64的安卓软件
- 创建时间:2023-07-04 21:07:00
- 本文链接:2023/07/04/note/Experience/waydroid/
- 版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!