ADB command to toggle camera modes in android device

后端 未结 3 1503
醉话见心
醉话见心 2021-01-17 01:41

I am trying to figure out what is the command to load the camera app in different modes like following:

  1. Toggle between camera and video cam corder mode
  2. <
相关标签:
3条回答
  • 2021-01-17 02:07

    You can use following though:

    Intent action = new Intent("android.media.action.IMAGE_CAPTURE");  
            action.putExtra("android.intent.extras.CAMERA_FACING", 1);
    

    You can use adb command "am start" . Please read following: How to run a specific Android app using Terminal?

    0 讨论(0)
  • 2021-01-17 02:19

    For KK:

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

    Change the id 0 or 1 for front and back camera.

    0 讨论(0)
  • 2021-01-17 02:25

    You can pass an Extra with an integer value using the --ei flag to the am start command

    Front Camera

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

    Back Camera

    adb shell am start -a android.media.action.IMAGE_CAPTURE --ei android.intent.extras.CAMERA_FACING 0
    
    0 讨论(0)
提交回复
热议问题