Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android command-line photo

Tags:

android

photo

I have a nexus4 with a broken touchscreen. Controlling the bootloader with power and volume keys still works, so I put rootbox on it. Now I can login to the root prompt using adt. As I want to use it as timelapse camera, I wonder how is it possible to take a photo and save it to a specific folder using the command line? Then I could set up a cron job and download images using adt.

like image 550
Nick Fankhauser Avatar asked Jul 14 '14 23:07

Nick Fankhauser


1 Answers

Take a look at this: How can I run Android camera application from adb shell?

In short:

  1. Image capture mode: adb shell "am start -a android.media.action.IMAGE_CAPTURE"
  2. Video capture mode: adb shell "am start -a android.media.action.VIDEO_CAPTURE"
  3. To focus: adb shell "input keyevent KEYCODE_FOCUS"
  4. To take a photo or start/stop recording: adb shell "input keyevent KEYCODE_CAMERA"
like image 128
Udnaan Y Avatar answered Oct 27 '22 09:10

Udnaan Y