Search code examples
androidadb

Start youtube video with adb?


How do I open youtube application and start playing some video? For example this video: http://www.youtube.com/watch?v=YRhFSWz_J3I

I tried to launch other applications successfully (for example playing local video on sdcard), but can't seem to find right way to start youtube (com.google.android.youtube).

Played local file

am start -n com.android.gallery3d/.app.MovieActivity -d "file:///sdcard/VideoTest/sample.mp4"

Solution

  • What about this:

    adb shell am start -a android.intent.action.VIEW "http://www.youtube.com/watch?v=YRhFSWz_J3I"
    

    I'm not sure, if -d is necessary for the URI, try this if it does not work:

    adb shell am start -a android.intent.action.VIEW -d "http://www.youtube.com/watch?v=YRhFSWz_J3I"
    

    It may open the Chooser activity on first run though.