diff --git a/README-zh.md b/README-zh.md new file mode 100644 index 0000000000000000000000000000000000000000..2fa8b97eb49c5825f83ac8306198fab8e2cef604 --- /dev/null +++ b/README-zh.md @@ -0,0 +1,174 @@ +# Anbox + +此代码仓是从https://github.com/anbox/anbox链接中fork而来,并将在欧拉开源社区安卓中间件下进行维护。我们致力于在本地Arm PC上运行Anbox。 + +Anbox采用基于容器的方式,在 Ubuntu 等常规 GNU/Linux操作系统上启动完整的安卓系统。换言之:Anbox可以让您在Linux操作系统中运行安卓系统,并且不像虚拟化那样缓慢。 + +## 产品概述 + +Anbox使用Linux 命名空间(如user、pid、uts、net、mount、ipc)在容器中运行完整的安卓系统,并在任何基于 GNU/Linux 操作系统的平台上提供安卓应用程序。 + +容器内的安卓端无法直接访问任何硬件。所有硬件都是通过主机上的 anbox daemon程序进行访问。我们正在重新利用安卓端在基于 QEMU 的模拟器中实现的 OpenGL ES 加速渲染。容器内的安卓系统使用不同的管道与主机系统进行通信,并通过这些管道发送所有硬件访问命令。 + +您可以查看以下文件了解更多信息: + + * [Android Hardware OpenGL ES 仿真设计概述](https://android.googlesource.com/platform/external/qemu/+/emu-master-dev/android/android-emugl/DESIGN) + * [Android QEMU 高速管道](https://android.googlesource.com/platform/external/qemu/+/emu-master-dev/android/docs/ANDROID-QEMU-PIPE.TXT) + * [The Android "qemud" 复用守护进程](https://android.googlesource.com/platform/external/qemu/+/emu-master-dev/android/docs/ANDROID-QEMUD.TXT) + * [Android qemud 服务](https://android.googlesource.com/platform/external/qemu/+/emu-master-dev/android/docs/ANDROID-QEMUD-SERVICES.TXT) + +Anbox 目前适用于电脑桌面,但也可用于移动操作系统,如 Ubuntu Touch、Sailfish OS 或 Lune OS。然而,由于安卓应用程序的映射目前是针对桌面的,因此也需要对支持的堆叠窗口用户界面进行额外操作。 + +安卓运行时环境附带基于 [安卓开源项目](https://source.android.com/) 的最小化定制安卓系统镜像。 + +使用的镜像目前基于Android 7.1.1版本。 + +## 支持的Linux发行版本 + +目前我们支持以下Linux发行版本: + + * Ubuntu 16.04 (xenial) + * Ubuntu 18.04 (bionic) + * UOS + +其他发行版只要提供必需的内核模块就能正常工作(请参阅内核参数)。 + + * [版本说明书](docs/release-notes/anbox-release-notes.md) + + +## 从源代码编译 + +### 要求 + +建议在ARM64架构上运行。 + +构建Anbox运行时本身无需多言。我们使用Cmake编译工具作为编译系统。您的主机系统上需要安装以下编译依赖: + + * libdbus + * google-mock + * google-test + * libboost + * libboost-filesystem + * libboost-log + * libboost-iostreams + * libboost-program-options + * libboost-system + * libboost-test + * libboost-thread + * libcap + * libsystemd + * mesa (libegl1, libgles2) + * libsdl2 + * libprotobuf + * protobuf-compiler + * lxc (>= 3.0) + * libasound + +在 Ubuntu 系统上,您可以使用以下命令安装所有编译依赖: + +``` +$ sudo apt install build-essential cmake cmake-data debhelper dbus google-mock \ + libboost-dev libboost-filesystem-dev libboost-log-dev libboost-iostreams-dev \ + libboost-program-options-dev libboost-system-dev libboost-test-dev \ + libboost-thread-dev libcap-dev libsystemd-dev libegl1-mesa-dev \ + libgles2-mesa-dev libglm-dev libgtest-dev liblxc1 \ + libproperties-cpp-dev libprotobuf-dev libsdl2-dev libsdl2-image-dev lxc-dev \ + pkg-config protobuf-compiler libasound2-dev +``` +建议您使用Ubuntu 18.04(仿生)和 **GCC 7.x**作为编译环境。 + +在 UOS 系统上,您可以使用以下命令安装所有编译依赖: + +``` +$ sudo apt install gcc libncurses-dev bison flex libssl-dev cmake dkms build-essential \ + cmake-data debhelper dbus google-mock libboost-dev libboost-filesystem-dev libboost-log-dev \ + libboost-iostreams-dev libboost-program-options-dev libboost-thread-dev libcap-dev \ + libsystemd-dev libegl1-mesa-dev libgles2-mesa-dev libglm-dev libgtest-dev liblxc1 \ + libproperties-cpp-dev libprotobuf-dev libsdl2-dev libsdl2-image-dev lxc-dev libdw-dev \ + libbfd-dev libdwarf-dev pkg-config protobuf-compiler libboost-test-dev +``` + +### 编译 + +``` +$ mkdir -p /home/compile/ +$ cd /home/compile/ +$ git clone https://gitee.com/openeuler/anbox +``` + + * [应用SDL补丁](docs/apply_SDL_patch.md) + * [安装binder & ashmem 模块](docs/kernel_module.md) + +之后,您可以使用以下命令编译 Anbox: + +``` +$ cd /home/compile/anbox +$ mkdir build +$ cd build +$ cmake .. -DCMAKE_CXX_FLAGS="-DENABLE_TOUCH_INPUT -Wno-error=implicit-fallthrough \ + -Wno-error=missing-field-initializers" -DCMAKE_BUILD_TYPE=Release -DWerror=OFF +$ make -j8 + +``` + +如果您要选择版本,请执行以下操作: + +``` +$ git clone https://gitee.com/openeuler/anbox -b anbox-v1.0-rc3 +``` + +anbox-v1.0-rc3 版本会在以后更新,请确保它与 AOSP 的版本匹配(请参阅 build-android.md)。 + +示例 + +``` +$ sudo make install +``` + +运行以上命令会在在您的系统上安装必要的位数。 + +## 运行Anbox + +步骤1:启动容器管理器,以ROOT用户运行命令,你必须有一个android.img。 + +``` +$ bash /usr/local/bin/anbox-bridge.sh start +$ anbox container-manager --android-image=//android.img \ + --data-path=//anbox-data --privileged --daemon & + +``` + +步骤2:启动会话管理器,以非ROOT用户运行命令,并运行从桌面用户界面打开的shell终端。 + +``` +$ export EGL_PLATFORM=x11 +$ export EGL_LOG_LEVEL=fatal +$ anbox session-manager --gles-driver=host & + +``` + +等待30s,在应用栏中的“其他应用”中打开安卓APP。 + +## 文档 + +您将在项目源的 *docs* 子目录中找到 Anbox 的其他文档。 + +其他说明可查看: + + * [运行时准备](docs/runtime-setup.md) + +## 漏洞报告 + +如果您发现 Anbox出现问题,请[提单](https://gitee.com/openeuler/anbox/issues)。 + +## 保持联系 + +仓库maintainer: + +https://gitee.com/openeuler/community/tree/master/sig/sig-android-middleware + +## 版权和许可 + +Anbox 重用了其他项目(如 Android QEMU 模拟器)的代码。这些项目位于external/ 子目录中。子目录中包含许可条款。 + +Anbox 源本身,如果在相关源文件中没有另外说明,则根据 GPLv3 许可条款获得许可。 \ No newline at end of file diff --git a/README.md b/README.md index 3c8826f184a65fae863c1bf0250ddf87221a94e3..3be7adfd7c6f35fe494f2dd20ee1ca6e9b09814b 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Anbox This code repository is forked from https://github.com/anbox/anbox and -will be maintained under openEuler android middleware community.We aim -to run anbox on Arm PC natively. +will be maintained under openEuler Android middleware community. We aim +to run Anbox on ARM PCs natively. Anbox is a container-based approach to boot a full Android system on a regular GNU/Linux system like Ubuntu. In other words: Anbox will let @@ -52,7 +52,7 @@ well as long as they provide the mandatory kernel modules (see kernel/). * [Release notes](docs/release-notes/anbox-release-notes.md) -## Build from source +## Build from Source ### Requirements @@ -132,11 +132,11 @@ $ make -j8 ``` -If you want to choose a version, please do: +If you want to choose a version, please do: $ git clone https://gitee.com/openeuler/anbox -b anbox-v1.0-rc3 -The version anbox-v1.0-rc3 will update in the future, make sure it matches the version of AOSP(see build-android.md). +The version anbox-v1.0-rc3 will update in the future, make sure it matches the version of AOSP(see build-android.md). A simple @@ -149,7 +149,7 @@ will install the necessary bits into your system. ## Run Anbox -Step1:start container manager,run the commands as the ROOT user and you must have a android.img. +Step 1:Start container manager, and run the commands as the ROOT user. You must have a android.img. ``` $ bash /usr/local/bin/anbox-bridge.sh start @@ -158,8 +158,7 @@ $ anbox container-manager --android-image=//android.img \ ``` -Step2:start session manager,run the commands as the NON-ROOT user, -and run the shell terminal opened from desktop UI. +Step 2:Start session manager, run the commands as the NON-ROOT user, and run the shell terminal opened from desktop UI. ``` $ export EGL_PLATFORM=x11 @@ -179,7 +178,7 @@ Interesting things to have a look at * [Runtime Setup](docs/runtime-setup.md) -## Reporting bugs +## Reporting Bugs If you have found an issue with Anbox, please [file a bug](https://gitee.com/openeuler/anbox/issues).