How to install and run Android Apps (APKs) on Linux with Shashlik

Shashlik is basically a set of software components that allow Linux users to install and run Android APKs right on their GNU/Linux distribution. Shashlik achieves that by using a stripped down version of Android instead of emulating one, which is nested inside the user session upon the launching of an installed Android application. The rendering of the graphics in the app is undertaken by the OpenGL infrastructure of our system, so the performance is good for what is well supported.

Unfortunately, Shashlik is still under heavy development and doesn't support many applications yet, but still you may find many useful apps that are working like a charm. The only absolute prerequisites are that you are not running another virtualization process in the same time that you are trying to run Shashlik, that the APK used in Shashlik was built to run on x86 architecture, and that Shashlik is installed on a 64-bit Linux system. Its developers also suggest running their software on the KDE Plasma environment, as they are testing it on this only, but I can also confirm that it works on Pantheon as well (with some relevant error messages).

Installing Shashlik

Shashik's latest version at the time of writing this is 0.9.3 which you can download from this web page. There are Debian (Ubuntu) and Arch pre-built packages that you may use depending on your system, while several users of Fedora and Suse systems report that alien-generated RPMs work as well. Ubuntu users may install the downloaded package by opening a terminal on the download location and typing the following command:

sudo dpkg -i shashlik_0.9.3.deb

Install Shashlik.

You may also try to compile Shashlik from source by following the instructions found on the official website, but I wouldn't recommend this option as you will have to move the binaries and libraries in the right locations yourself – at least for now.

Installing and Running Android APKs

After Shashlik is installed, visit an APK database and download the application that you want to run with Shashlik. Then open a terminal on the location of the downloaded APKs and type the following command to install it to your system: “/opt/shashlik/bin/shashlik-install name_of_apk_file”. As an example, I installed the Viber apk as shown in the following screenshot:

Install Viber APK in Sashlik.

Next step is to run the APK by typing the following command on the same terminal session: “/opt/shashlik/bin/shashlik-run name_of_splash_png name_of_apk_file”. One important thing to note at this point is that during the installation, Shashlik has created and stored some required files in /.local/share/shashlik. Those files include the splash png image file and the userdata.img. Upon launching an APK, Shashlik looks for the file you have indicated in the command. So, if there is a splash.png corresponding to an application named test.apk, the command becomes: “/opt/shashlik/bin/shashlik-run splash test.apk”. Here's how I did it for Viber

Running Viber in Shashlik.

Viber started

To make things simpler, I should point out that the APKs are installed in our system with the command I showed previously, so if you look for them in the applications menu/dash you should find them and run them with a simple click. This however, may not work well for all apps, but if it does it's quite handy. Whatever the case, you should know how to run it from the terminal in order to get the insight needed to solve any issues.

Shashlik applications.

As there is currently no uninstall function implemented, you can manually remove the binaries installed by Shashlik by navigating to /.local/share/applications and deleting the corresponding files. This should remove them from your applications menu.

Landscape Tip

As the software hasn't even reached its first stable version, you can't fiddle with any options that could be critical to the user experience with certain apps. The case of setting the emulator to the landscape screen mode is a usual one, so here's how to do it. Open your file manager as administrator and navigate to /opt/shashlik/bin and open “shashlik.run with your favorite text editor. Then locate the “-noskin” argument and replace it with “-skin 480x320” or any other resolution in the standard ratios.

Use Apps in Landscape mode in Shashlik.

Conclusion

Shashlik may be unstable and not very powerful just yet, but the fact that it is very simple to use doesn't go unnoticed and unappreciated. With time, I am sure that it will become even leaner and even more successful in regards to how many apps it can run. People report demanding 3D games running well on Shashlik which is indicative of what the software can already do. Have fun testing Android apps on Linux, and good luck running them!

Share this page:

21 Comment(s)

Add comment

Comments

From: doancongtuan111

Yeah! thanks you so much :)

From: Shawn

This is amazing!!  Thank you for posting this.

From: vitor

thank you!

From: Hadi

not working in ubuntu unity 15.10 64bit

From: Chris

not working on linux mint mate 17

(maybe that's obvious?  it would be helpful to list the large categories of linux dists that should obviously not work - e.g. is it dependent on kde or just that just happened to be what you used)

thanks for trying though - looking forward to seeing it get further!

Chris

From: chris

I guess there IS a dependency on kde?  Although it was erroring out trying to tell me it was successfully installed!(?!)

Successfully installed Threema

Traceback (most recent call last):

  File "/opt/shashlik/bin/shashlik-install", line 109, in <module>

    message ("Successfully installed %s" % app_name)

  File "/opt/shashlik/bin/shashlik-install", line 22, in message

    "--msgbox", msg])

  File "/usr/lib/python3.4/subprocess.py", line 533, in call

    with Popen(*popenargs, **kwargs) as p:

  File "/usr/lib/python3.4/subprocess.py", line 848, in __init__

    restore_signals, start_new_session)

  File "/usr/lib/python3.4/subprocess.py", line 1446, in _execute_child

    raise child_exception_type(errno_num, err_msg)

FileNotFoundError: [Errno 2] No such file or directory: 'kdialog'

 

From: Rached.Noureddine

how come you installed fedy on your debian OS ?!!

From: Darksurf

Super excited! Cant wait for resizable windows or at least per application settings such as video players landscape and some apps portrait with different resolutions.

From: Dan

starting emulatorunknown option: -skin 1280x720please use -help for a list of valid options

From: Dan

"Then locate the “-noskin” argument and replace it with “-skin 480x320” or any other resolution in the standard ratios."

Need "-skin", "1280x720"

From: Mohit

Your desktop setup kinda' appears cool. Is it gnome modified.

Which theme are you using for your desktop environment?

From: br

On ubuntu 12.04 fails with python3-xdg dependency .... ans trying to get it gives error  sudo apt-get install python3-xdg Reading package lists... DoneE: Unable to locate package python3-xdg

From: Sherif

I get this error whenever I try to install an app:

 

W/asset   (13887): Asset path preschool.apk is neither a directory nor file (type=1).

ERROR: dump failed because assets could not be loaded

Could not get APK info. Broken setup?

Traceback (most recent call last):

  File "/opt/shashlik/bin/shashlik-install", line 30, in

    universal_newlines=True)

  File "/usr/lib/python3.5/subprocess.py", line 626, in check_output

    **kwargs).stdout

  File "/usr/lib/python3.5/subprocess.py", line 708, in run

    output=stdout, stderr=stderr)

subprocess.CalledProcessError: Command '['/opt/shashlik/bin/aapt', 'dump', 'badging', 'preschool.apk']' returned non-zero exit status 1

 

During handling of the above exception, another exception occurred:

 

Traceback (most recent call last):

  File "/opt/shashlik/bin/shashlik-install", line 32, in

    message("Could not get APK info. Broken setup?")

  File "/opt/shashlik/bin/shashlik-install", line 22, in message

    "--msgbox", msg])

  File "/usr/lib/python3.5/subprocess.py", line 557, in call

    with Popen(*popenargs, **kwargs) as p:

  File "/usr/lib/python3.5/subprocess.py", line 947, in __init__

    restore_signals, start_new_session)

  File "/usr/lib/python3.5/subprocess.py", line 1541, in _execute_child

    raise child_exception_type(errno_num, err_msg)

FileNotFoundError: [Errno 2] No such file or directory: 'kdialog'

From: cristofer amezquita

I can't found the directory  /.local/share/shashlik ist correct ?. Successfully installed WhatsApp

WhatsApp (most recent call last):

  File "/opt/shashlik/bin/shashlik-install", line 109, in <module>

    message ("Successfully installed %s" % app_name)

  File "/opt/shashlik/bin/shashlik-install", line 22, in message

    "--msgbox", msg])

  File "/usr/lib/python3.4/subprocess.py", line 533, in call

    with Popen(*popenargs, **kwargs) as p:

  File "/usr/lib/python3.4/subprocess.py", line 848, in __init__

    restore_signals, start_new_session)

  File "/usr/lib/python3.4/subprocess.py", line 1446, in _execute_child

    raise child_exception_type(errno_num, err_msg)

FileNotFoundError: [Errno 2] No such file or directory: 'kdialog'

From: Chafic Abisaid

Thank you

From: Fred Jones

I'm afraid that shashlik only works if using x86 ONLY apk's, and being that ALL Android apk's I know of run on ARM processors, which makes shashlik useless, sorry.

ERROR: This package does not contain x86 native code, and can't run. Please find another APK built for x86

 

Quote from above text:- "After Shashlik is installed, visit an APK database and download the application that you want to run with Shashlik." here's an APK download site:- https://www.apkfiles.com/

From: Tim

Thank you very much! I've been struggling to play some android games on my laptop since I'm using a BlackBerry10 phone which doesn't run android apps very well. Shashlik is very smooth on my fairly weak laptop (celeron cpu, 2gb of memory, hdd). I'm running bunsenlabs linux btw.

From: wixxer

Okay

From: [email protected]

Thanks you so much ^^

From: hamdeen

Thank u for Really Amazing work, Keep it up

From: sherif rad

what i got is a black screen