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"
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.
you can find such a definition in the file AndroidManifest.xml of youtube play app:
<data android:scheme="vnd.youtube"/>
so, add "vnd.youtube:" to the head of youtube URL, for example: "vnd.youtube:https://youtube.com/STH"
then run the adb command:
adb shell am start -a android.intent.action.VIEW -d "vnd.youtube:https://youtube.com/STH"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With