All My Brain Where stuff from my brain lands

April 25, 2011

Pulling libraries off Android phones

Filed under: Programming — Tags: , , , — Dennis @ 11:08 am

Well, have you ever wanted to pull a bunch of libraries off an Android phone? I bet you wish you could execute the command like this:

> adb pull /system/lib/*.so

Sorry. A no go. What about this then:

> for file in `adb ls /system/lib/`; do adb pull /system/lib/$file; done

Well, almost, but adb ls attaches the \n\r to the files. That wouldn’t be a problem if adb pull didn’t attach them to the names, so you have to get rid of the white space. This can work:

> for file in `adb ls /system/lib`; do adb pull `echo /system/lib/$file | tr -d '\n\r'`; done

Yea. Enjoy.

Powered by WordPress

%d bloggers like this: