In the build script of Samsung's Gear VR framework there's a line:
android update lib-project -p .
What's this "android" and where to get it? Obviously this is a bit hard to google :)
This tool can be found in the SDK. Take a look at this:
http://developer.android.com/tools/projects/projects-cmdline.html