Compile, Install, Run Linux Apps on Android

The advantage of using a POSIX based mobile OS is that you can run and install any Linux applications on your mobile (smartphone) with ease. And thanks to Open Source, its even easier to Compile, Install & Run Linux Applications on Android.

To get basic Linux apps running on Android, you need BusyBox. To give you some background, BusyBox is a software application that provides many standard Unix tools, much like the larger (but more capable) GNU Core Utilities. BusyBox is designed to be a small executable for use with the Linux kernel, which makes it ideal for use with embedded devices. It has been self-dubbed “The Swiss Army Knife of Embedded Linux”.

Using this guide, you’ll be able to:

  • Compile Linux C, C++ app directly on Android
  • Install, Run Linux apps on Android.

How to Compile, Run Linus Apps on Android

Step 1. Install BusyBox from Play Store (requires root). If you don’t have Root access, you can follow steps mentioned in the video which involves adb push for busybox binary to /data/ and setting permissions.

BusyBox would allow you to install various Linux apps on Android coz BusyBox is bundled with all the runtime dependecies.

Step 2. To make your environment even more capable, lets go ahead and install BostBrew Basil from Play store.

BostBrew Basil bootstraps the base system and do some basic package management by using uses Dpkg and Apt instead of Opkg. This will let you install various linux packages, this is where BostBrew shines.

Step 3. Install Linux apps using APT Package manager

To install apps using apt package manager, all you need to do is:

su
bostbrew
apt-get install gcc g++

This will install gcc, g++ compilers and you can specify any other package name and ARM version should be automatically installed to your android.

Step 4. Compiling C, C++ source code on Android

Compile any source file using g++ and run it:

g++ ./sourceCode.cpp
./a.out

That’s it. You’ve successfully compiled and run your own C code.

You can watch the video below, it essentially covers the same steps in an easy to follow tutorial:

We write latest and greatest in Tech GuidesAppleiPhoneTabletsAndroid,  Open Source, Latest in Tech, subscribe to us @geeknizer OR on Facebook FanpageGoogle+.

VN:F [1.9.22_1171]
Rating: 6.7/10 (9 votes cast)
VN:F [1.9.22_1171]
Rating: +2 (from 4 votes)
Compile, Install, Run Linux Apps on Android, 6.7 out of 10 based on 9 ratings

Filed in: Android Tags: , ,

Related Posts

Bookmark and Promote!

  • http://bashyc.blogspot.com/ Alex

    I think you’ve made a mistake, It’s botbrew instead of bostbrew

    Regards

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • dfinly

    Recommending people who you don’t know and may not have much technical expertise to su instead of prefacing each command with sudo seems like asking for trouble

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • vmlinuz

    I’m a little bit confused about the C compilation. Do you have to compile the source from the program you got in APT? Or is that just an extra feature you can use?

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
© 2014 Geeknizer. All rights reserved. XHTML / CSS Valid.
Designed by taranfx.