0

I’m trying to push an image to an AVD’s SD-Card and open it from the adb shell.

First step:

adb push test.jpg /sdcard/Pictures/test.jpg

The image is transferred successfully. But here is the first problem: When I try to open the image manually in the gallery, no image can be found. I have to reboot the emulator, after that I can see the image. Is there a way to open the image on the AVD without rebooting? Remounting the SD-Card is not possible (→ https://stackoverflow.com/a/2825608).

Second step is to open the image from adb shell. I tried these commands:

am start -t image/* /sdcard/Pictures/test.jpg -n com.android.gallery/com.android.camera.ViewImage
am start -t image/* file:///sdcard/Pictures/test.jpg -n com.android.gallery/com.android.camera.ViewImage
am start -t image/* file://sdcard/Pictures/test.jpg -n com.android.gallery/com.android.camera.ViewImage

The first one brings up this error message:

Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] typ=image/* cmp=/sdcard/Pictures/test.jpg }
Error type 3
Error: Activity class {/sdcard/Pictures/test.jpg} does not exist.

The second/third will cause crashing the Camara-App:

Unfortunately, camera has stopped.

How can I open this image? Opening it manually works without any problem.

The device is an emulated Nexus 4 with Android 4.4.2.

Community
  • 1
  • 1
CFP
  • 359
  • 8
  • 17
  • http://stackoverflow.com/a/19435985/1778421 – Alex P. Jun 19 '14 at 17:01
  • Thanks for the idea but it did not change anything :( Result: Broadcasting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] pkg=android.intent.action.MEDIA_MOUNTED } Broadcast completed: result=0 – CFP Jun 19 '14 at 18:17

0 Answers0