Porting iw tools to Android

June 13th, 2012


This posts is a guide for porting iw to Android ICS.

iw is a new utility for wireless devices on Linux. It developed by linuxwireless.org.

You can see more detail about how to use it in here.

1.Build requirements: libnl

Frist, you need Grab the tree for libnl:

Be sure to make ANDROID_PATH point to your android build environment.

Download the android.sh, and apply it.

Apply this libnl.patch to your ./lib/Makefile and build it.

It will have error happen during the compile process, but if you’re lucky enough, you will find 4 file in ./lib folder (libnl.a libnl-genl.a libnl-nf.a libnl-route.a) . That is exactly what we want. We will static build iw, and wrap those files in iw.

2.Build iw

Make $LIBNL point to your libnl folder.
Download the iw.patch, and apply it to iw/Makefile

Finally, we get iw binary file in current folder, if you want know more detail, please read the 2 patch file and android.sh. All compile progress was run in Ubuntu 10.10. Hope you lucky.

* The iw’s Makefile is very unfriendly for cross compile.

* You can add V=1 option when build Android. This option will let build process output full command, I collected all output compiler options and put them in Android.sh.

* Also you can just download this binary file on iw.tar, which is I compiled for my android ics. Hope you lucky enough.

25 thoughts on “Porting iw tools to Android

  1. an error occur when excute “configure” in step1

    configure: error: unrecognized option: `-I/home/dangku/samsung/lenovo/basewin/A2105/bionic/libc/arch-arm/include\’

    1. You can try to run the options of the android.sh file in command line. Don’t source the android.sh

  2. Hey,
    trying to compile using your instructions…
    you have some excessive \’s in your script and you don’t really use the $ANDROID_PATH, you might want to fix that..
    but never mind that, I’m now at the stage where it tells me the test binaries can’t be run and that I should use –host to set the target… what did you put there? it seems a bit backwards to my intuition (build should be android and host should be i686, isn’t it?)

    1. Thank you remind me about the $ANDROID_PATH things, I will fix it. I upload the iw’s binary file on this page, It should be ok on android ICS. You can try it.

  3. Hi,
    Could you show me how to add iw support into android source code “external” directory? I need iw as a part of android system not as an external binary. Thanks in advance!

  4. Pingback: Homepage
  5. Pingback: więcej
  6. Pingback: more information
  7. Pingback: SignUp Today
  8. Hi,
    the pre-built binaries looks to be broken as the tar package is bad.

    Is there any other android arm package to try?


  9. good moning.
    I did not understand. that for the variable ANDROID_PATH .
    This is the core or what? Could explain.

  10. Hello,

    I am getting command failed operation not supported on transport endpoint (-95) while changing bitrates using iw. I am using CM11 4.4.2 on my phone. Could you help me with this ?

    Thank You.

  11. Aw, this was a very nice post. Spending some time and actual effort to make a really good article… but what can I
    say… I put things off a whole lot and never manage to get anything done.

Leave a Reply

Your email address will not be published. Required fields are marked *