Start youtube video with adb? - android

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"

Related

How to launch Youtube application to open a playlist?

I want to open my YouTube playlist link in YouTube Android app, if YouTube app is installed on the device.
I try code bellow but not true.
Please help me
adb - s emulator - 5554 shell am start - a android.intent.action.VIEW - d \"vnd.youtube:/playlist/PL8mjSseObLTkEzNIGXqip-_NtkfDJM-Kk\" com.google.android.youtube
This is the adb command to use in order to launch the Youtube app showing the playlist provided as adb parameter:
adb -s emulator-5554 shell am start -a android.intent.action.VIEW -d "vnd.youtube:playlist/PL8mjSseObLTkEzNIGXqip-_NtkfDJM-Kk"

how to play video on vlc in a loop via adb shell

I'm trying to play a video on android via adb shell on vlc several times in a row.
When playing the video once the following command was sufficient:
adb shell am start -a android.intent.action.VIEW -d file:////storage/emulated/0/Download/bbb_sunflower_native_60fps_normal.mp4
But now I want to play the video several times/infinitely. Based on: How can I deliver parameters to a test function, that launched using adb shell am Instrumentation command , Start Android activity from command line with extra and https://wiki.videolan.org/VLC_command-line_help/ I tried:
adb shell am start -n org.videolan.vlc/org.videolan.vlc.gui.video.VideoPlayerActivity -e input-repeat 3 -a android.intent.action.VIEW -d file:////storage/emulated/0/Download/bbb_sunflower_native_60fps_normal.mp4
with various combinations including passing --input-repeat 3 and "input-repeat" 3 without success. E.g: the video would play but only once.
Also didn't help:
adb shell am start -n org.videolan.vlc/org.videolan.vlc.gui.video.VideoPlayerActivity -e PlaybackMode 1 -d file:////storage/emulated/0/Download/bbb_sunflower_native_60fps_normal.mp4
Does anyone know how it can be done?

adb shell command for playing audio on Genymotion

I would like to running an app automatically using adb command. I know how can I send command like, swip, touch, and etc. How can I play a audio file to simulating voice?
I have test following but none of them work.
>adb shell tinyplay bird.wav
Unable to open file 'bird.wav'
and
>adb shell stagefright -a -o bird.wav
Unable to create data source.
I using Genymotion as an android device.
You can start an activity with file location provided.
Try this-
adb shell am start -a android.intent.action.VIEW -d file:///storage/sdcard0/sample.mp3 -t audio/mp3

How to launch android gallery app using adb shell?

I tried a lot and got
adb shell am start -a android.intent.action.MAIN -n com.android.browser/.BrowserActivity
for launching browser so I tried the same with gallery and I'm stuck with this
adb shell am start -a android.intent.action.MAIN -n com.sec.android.gallery3d/.GalleryActivity</b><br/>
I know GalleryActivity is not available but what else can i use?
Note: I am using samsung Galaxy S3 mini so the package name is com.sec.android.gallery3d
We can use monkey to open any app through adb shell,
Try the below command,
$ adb shell monkey -p com.android.gallery3d 1
In my nexus4, Gallery app package name is com.android.gallery3d and we are just passing 1 event via monkey, So that monkey will just open the app and will not do anything further.
Also this approach helps you to open any app just with the package name. Monkey will pick the launcher activity by itself.
Hope it helps.
maybe
adb shell am start -t image/* -a android.intent.action.VIEW
also one more thing , this will open the default app selected for gallery in your device.

Launching movie playback via "am start"

I would like to launch a movie playback directly from the command line and the adb tools.
The way I do it, is with the instrumentation tool:
# am start -t video/mpeg -D /sdcard/Movies_3D/mymovie.mp4
But when I do that,
com.cooliris.media/.MovieView take the intent, doesn't crash, but "is waiting for the debugger to attach"
How to specify directly the Media Player? I cannot find the class name to call.
(uninstalling com.coloris is not an option)
Thanks,
Following works on Android ICS (4.0.3) version
am start -n com.android.gallery3d/.app.MovieActivity -d <URI>
For example, following command plays clip in /data/local/tests/ directory.
am start -n com.android.gallery3d/.app.MovieActivity -d file:////data//local//tests//big_buck_bunny_1080p_H264_AAC_25fps_7200K_short.MP4
This worked for me on Android 9.0
adb shell am start -a android.intent.action.VIEW -t video/mp4 -d file:///sdcard/DCIM/Camera/Video1.mp4

Categories

Resources