Build and run Android NDK applications without Eclipse

If you already have a development environment and do not wish to use Eclipse, you can easily build and run your NDK application from makefiles or the command line.

First of all, you need to set the ANDROID_NDK_ROOT environment variable and ensure the SDK and NDK binary directories are in PATH. Here are my definitions:


This is best defined in one of your shell’s startup scripts such as .zshenv.

Build and install package

Now, whenever you are in an NDK project’s directory, build the project using:

ndk-build && ant release

And to upload it to the emulator or to a connected device:

ant release install

That’s all! Those two simple commands can easily be launched from your preferred development environment.

Update: ant compile no longer exists in recent SDKs; replaced with ant release.

Run package

You can use adb to run any application remotely. For instance:

adb shell am start -a android.intent.action.MAIN -n $PACKAGENAME/.$ACTIVITYNAME

Both package name and activity name can be found in your AndroidManifest.xml.

  • Posted: 2011-03-11 01:26 (Updated: 2012-09-23 18:55)
  • Author: sam
  • Categories: android code tip


1. anonymous -- 2012-09-20 17:13

This is only build and install, how about run?!

2. sam -- 2012-09-23 18:56

@anonymous: you’re right, I lied about the running! I added the relevant information.

130. jzakCoame -- 2017-01-02 11:37

kv9396 cheap generic levitra online ao4079dz2028sg7619 wz3647

133. BiesCaw -- 2017-01-02 14:46

Hello, I just wanted to say hi, great to be here, engaging comunity! In come what may you interested, my website:

138. udtpBleby -- 2017-01-02 21:03

jx3405 buy levitra online australia ye5877wv6144cl6031 wf7338

141. ieotCoame -- 2017-01-03 04:45

ea3796 sildenafil pediatric dosing ng2269qy4351bn880 kt4780lt7728

148. Smitha414 -- 2017-01-03 16:11

Howdy would you mind sharing which blog platform you're working bedbffecaekeakge

163. Smithc114 -- 2017-01-04 23:36

Thanks for this article. I might also like to say that it can end up being hard if you find yourself in school and merely starting out to create a long credit rating. There are many learners who are only trying to endure and have long or good credit history are often a difficult issue to have. aagkdefdgeeedabe

203. Smithg23 -- 2017-02-20 18:50

Your style is really unique compared to other folks I've read stuff from. kekacafkddackabb

204. Loriyar -- 2018-01-22 05:48

You style of writing is unique and more clear itself. Really nice. I am trying to make rating about my credit. You can get good report from

205. anonymous -- 2018-07-16 18:21

They are leading the review due to the expanded rivalry, organizations are upgrading visitor fulfillment and keeping their current visitors as opposed to designating extra assets to pursue new ones on the grounds that the exertion of holding existing visitor is significantly less demanding than getting new ones.

206. feetyrider -- 2018-09-04 12:25

This blog will contain various articles about the development of the Lol Engine, game development and development in general.

207. autocad online help -- 2018-09-08 12:56

I Am So Happy To Read This. This Is The Kind Of Manual That Needs To Be Given And Not The Random Misinformation That's At The Other Blogs.

208. ebook writing  -- 2018-09-08 14:11

Such A Nice Post, Keep Providing Good Resources.

209. anonymous -- 2018-09-24 04:04

How about run?

210. anonymous -- 2018-09-24 04:04

How about run?

Add New Comment