How to access sensors and camera of android device from Shell
I haven't tried this, but since android isn't so different than the underlying Linux system, you might be able to do the same thing as described here. The device file name might be different though and you might need to be rooted.