Porting iw tools to Android


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.

21 thoughts on “Porting iw tools to Android

  1. DK

    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. Kevin Post author

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

  2. Flow3d

    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. Flow3d

      I’ve guessed –host=arm

      applied the patch manually :)
      got only 2 out of 4 =\
      missing libnl-nf.a libnl-route.a..

    2. Kevin Post author

      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. Pingback: how to install and build “iw” for android 4.1? | BlogoSfera

  4. Pingback: compile and build “iw” for android 4.1 device? | BlogoSfera

  5. Pingback: porting wireless package to android need new ROM? - How-To Video

  6. Pingback: how to install and build “iw” for android 4.1? [closed] | Question and Answer

  7. Wei Si

    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!

  8. Pingback: Homepage

  9. Pingback: więcej

  10. Pingback: more information

  11. Pingback: SignUp Today

  12. amit

    the pre-built binaries looks to be broken as the tar package is bad.

    Is there any other android arm package to try?


  13. minoro

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

  14. Tejeet


    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.


Leave a Reply

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