anbox安装

1.安装内核模块

1.1从ppa安装

$ sudo add-apt-repository ppa:morphis/anbox-support
$ sudo apt update
$ sudo apt install linux-headers-generic anbox-modules-dkms

1.2加载内核模块

$ sudo modprobe ashmem_linux
$ sudo modprobe binder_linux

1.3 检测内核模块加载情况

$ ls -1 /dev/{ashmem,binder}
/dev/ashmem
/dev/binder

2.安装anbox

2.1 配置snap使用socks5代理

sudo gedit /etc/environment

添加如下内容:

http_proxy="socks5://127.0.0.1:1080"
https_proxy="socks5://127.0.0.1:1080"

2.2刷新snapd服务

sudo systemctl daemon-reload


sudo systemctl restart snapd.service

2.3安装anbox

2.3.1 安装

$ sudo snap install --devmode --beta anbox

2.3.2 更新

$ snap refresh --beta --devmode anbox

 

3.安装amr兼容

Install Google Play Store and enable ARM applications / games support on Anbox (Android in a Box)

Update (February, 2019): The script to install Google Play Store and enable ARM (libhoudini) support for Anbox was updated to automatically download the latest open-gapps, fixing an issue that caused Google Play Store to close immediately after starting in some cases (when the Google Play Store version downloaded by the script was too old).

These instructions will obviously not work if Anbox is not already installed on your Linux desktop. If you haven’t already, install Anbox by following the installation instructions found here. Also, make sure you run anbox.appmgr at least once after installing Anbox and before using this script, to avoid running into issues. Also, make sure Anbox is not running when executing the script below (I suspect this is what causes this issue mentioned in the comments).

1. Install the required dependencies (wgetlzipunzip and squashfs-tools).

In Debian, Ubuntu or Linux Mint, use this command to install the required dependencies:

sudo apt install wget curl lzip tar unzip squashfs-tools

2. Download and run the script that automatically downloads and installs Google Play Store (and Google Play Services) and libhoudini (for ARM apps / games support) on your Android in a Box installation.

Warning: never run a script you didn’t write without knowing what it does. Before running this script, check out its code

To download the script and make it executable, use these commands in a terminal:

wget https://raw.githubusercontent.com/geeks-r-us/anbox-playstore-installer/master/install-playstore.sh
chmod +x install-playstore.sh


Now you can run the script:

./install-playstore.sh

Initially the script needed to run with superuser privileges, but that’s no longer the case. After it’s done installing Google Play Store and libhoudini, you can clean the leftovers – remove the anbox-work folder created by the script.

4. To get Google Play Store to work in Anbox, you need to enable all the permissions for both Google Play Store and Google Play Services

To do this, run Anbox:

anbox.appmgr

Then go to Settings > Apps > Google Play Services > Permissions and enable all available permissions. Do the same for Google Play Store!

You should now be able to login using a Google account into Google Play Store.

Without enabling all permissions for Google Play Store and Google Play Services, you may encounter an issue when trying to login to your Google account, with the following error message: “Couldn’t sign in. There was a problem communicating with Google servers. Try again later“, as you can see in this screenshot:

After logging in, you can disable some of the Google Play Store / Google Play Services permissions.

If you’re encountering some connectivity issues when logging in to your Google account on Anbox, make sure the anbox-bride.sh is running:

  • to start it:
sudo /snap/anbox/current/bin/anbox-bridge.sh start

 

  • to restart it:
sudo /snap/anbox/current/bin/anbox-bridge.sh restart

You may also need to install the dnsmasq package if you continue to have connectivity issues with Anbox, according to this user. But this wasn’t required on my Ubuntu 18.04 desktop.