Shashlik(https://github.com/shashlik)是开源的项目,使用它可以在Linux上运行Android应用程序。
Shashlik和模拟器的实现方式不同,官方的介绍:
The easiest way to run an Android app correctly is to simply run Android. It’s a linux base that we can nest inside our session. OpenGL and graphics are all rendered on the host ensuring fast performance.
Shashlik provides an incredibly stripped down Android base which boots directly into the loaded app, but with a running activity manager and daemons so that intents still work correctly.
Shashlik还在开发中,支持的应用有限。
安装Shashlik
你可以从http://www.shashlik.io/download/下载,我使用的是Ubuntu:
安装下载的deb包:
$ sudo dpkg -i shashlik_0.9.3.deb
如果有错误,一般是依赖包不满足。根据提示安装依赖包。
如果你要从源码编译安装,官网上列出了详细的编译步骤:http://www.shashlik.io/what-is/。
安装Android Apk
下载你要安装的apk;使用如下命令安装:
$ /opt/shashlik/bin/shashlik-install apk_file
注意:APK中必须包含x86架构编译,如果没有会爆如下错误:
message(“This package does not contain x86 native code, and can’t run. Please find another APK built for x86”)
运行安装的apk
$ /opt/shashlik/bin/shashlik-run splash_name apk_file
也可以从应用菜单中启动。
安装位置在~/.local/share/shashlik:
设置屏幕分辨率
使用任意文本编辑器打开/opt/shashlik/bin/shashlik-run文件,其实就是Python脚本。找到start_emulator函数,把emulator_args的”-noskin”改为”-skin 480×320″,大小可任意指定。