在Linux中运行Android软件

想要在PC上运行Android软件就需要模拟器,Windows版的Android模拟器软件很多,但是Linux平台的就不多了,今天推荐一款Linux下的Android模拟器软件Anbox

Anbox官方介绍为Android in a Box,Run Android applications on any GNU/Linux operating system.

Anbox现在还处于测试阶段,很多功能还不完善和稳定,请谨慎使用。

安装Anbox Link to heading

首先得安装Snaps,官方地址为https://snapcraft.io/

LinuxMint中安装Snaps和必须包

sudo apt install snapd
sudo apt install pulseaudio

接下来按照官方指南安装Anbox

snap install --classic anbox-installer && anbox-installer

我试着通过snap来安装一直存在权限问题,一般权限不能运行snap install --classic anbox-installer,root运行完snap install --classic anbox-installer后,但运行anbox-installer又提示不能使用root权限,一般权限根本无法运行anbox-installer,搞了半天都没有成功,于是就有了下文。

通过常规方法安装Anbox

wget https://raw.githubusercontent.com/anbox/anbox-installer/master/installer.sh -O anbox-installer
chmod +x ./anbox-installer
./anbox-installer

安装完成后会有重启系统的提示

To ensure all changes made to your system you should now reboot your system. If you don’t do this no Android applications will show up in the system application launcher.

重启后就会在系统菜单中找到Anbox,点击打开,见下图(注意Cuto是我自己安装的,原来没有)

org.anbox.appmgr

一个基本的Android系统已经成功了,可以看看系统信息Settings

anbox_settings

可以看到,Android版本为7.1.1,很新咯!

在Anbox中安装Android软件 Link to heading

首先需要安装adb工具

sudo apt install adb

安装成功后,可以使用adb来识别模拟器是否链接

adb devices

List of devices attached
emulator-6663	device

可以看到出现了一个名为emulator-6663的设备

下来安装Android软件

alair@vbs ~/下载 $ ls
Cuto-1.2.1-28-for-30644-o_1bgano4o21gjj1l1v183893n1sdkr-uid-423508.apk
nautilus_nutstore_amd64.deb
alair@vbs ~/下载 $ adb install ./Cuto-1.2.1-28-for-30644-o_1bgano4o21gjj1l1v183893n1sdkr-uid-423508.apk 
18112 KB/s (7389673 bytes in 0.398s)
Success
alair@vbs ~/下载 $ 

以上以安装Cuto为例,安装完成后就可以点击运行咯。