How to launch Youtube application to open a playlist? - android

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"

Related

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?

How to launch AFW badge apps from adb shell command?

I am unable to launch Android For work enabled apps from Adb shell command?
Can some one plz give example?
Refer attached screen, I want to launch Playstore app.
Without badge ICON play store app has the same activity info with the badged playstore app as well(com.android.vending/com.google.android.finsky.activities.MainActivity).
And I am unable to launch the Badge play store activity. Please help me.
I have tried by using below command:
adb shell am start com.android.vending/com.google.android.finsky.activities.MainActivity
It is always launching Non-Badged playstore app only.
Then I have tried as per the AFW blog by Google:
https://developer.android.com/work/managed-profiles.html
adb shell pm list users
UserInfo{0:Drew:13} running
UserInfo{10:Work profile:30} running
adb shell am start --user 10 -n "com.android.vending/com.google.android.finsky.activities.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
So, I got the java.lang.SecurityException: Shell does not have permission to access user 10 error. Please someone help me.
I have found a way to launch the Apps.
Make the app in debug mode and add clearUserRestriction of the provision client as below.
dpm.clearUserRestriction(adminName,UserManager.DISALLOW_DEBUGGING_FEATURES
if we have these changes then I am able to launch the Android For Work badged apps by using the below commands. Where the --user 10 is the AFW Provisioned User.
adb shell am start --user 10 -n
"com.android.vending/com.google.android.finsky.activities.MainActivity"
-a android.intent.action.MAIN -c android.intent.category.LAUNCHER

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 can I launch the App Info screen for my app through ADB?

I want to launch the App Info screen for my app through adb. I tried to fire an intent using "adb shell am start" but nothing seems to work. I need something that works at least for API levels 18 and 19. Can anyone help?
Open App Info
adb shell am start -a android.settings.APPLICATION_DETAILS_SETTINGS package:com.your.packagename
For Example: if you want to open Chrome App Info
adb shell am start -a android.settings.APPLICATION_DETAILS_SETTINGS package:com.android.chrome
adb shell am start -n yourpackagename/.activityname

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"
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"

Categories

Resources