Android 4.4 won't allow me to save a picture when captured using adb commands

大憨熊 提交于 2019-12-22 06:52:52

问题


My objective is to automate the process of capturing and saving a picture, with both front and back facing cameras.

I am using a Nexus 5 running Android version 4.4.2 and I have not rooted it.

I use the following commands to open the front and rear facing camera respectively:

>adb shell am start -a android.media.action.IMAGE_CAPTURE --ei android.intent.extras.CAMERA_FACING 1


>adb shell am start -a android.media.action.IMAGE_CAPTURE --ei android.intent.extras.CAMERA_FACING 0

(I found these commands in a previous stackoverflow post-> ADB command to toggle camera modes in android device)

The problem is that while the device is in either of these modes, it will only capture and not save an image when I execute this command:

>adb shell input keyevent KEYCODE_CAMERA

Once I run this command, the photo appears on the screen along with buttons to save, discard or retake the photo. However the save option does not appear to do anything.

I have two specific questions:

1.) Are there any alternative commands that I can use to open either camera?

2.) How can I make sure that the image is not being saved in some unexpected location?

I would really appreciate some help with this issue.

Edit: I don't need to store the picture on my pc, i expected it to be in /sd/card/DCIM/Camera or somewhere else on the phone.

来源:https://stackoverflow.com/questions/22387838/android-4-4-wont-allow-me-to-save-a-picture-when-captured-using-adb-commands

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!