Skip to content

Instantly share code, notes, and snippets.

@carlos-algms
Created June 4, 2021 09:42
Show Gist options
  • Save carlos-algms/f2b14c90d012634b06234f9fe605b1b5 to your computer and use it in GitHub Desktop.
Save carlos-algms/f2b14c90d012634b06234f9fe605b1b5 to your computer and use it in GitHub Desktop.
Control Spotify via ADB commands

Control Spotify via ADB commands

Working:

Open a specific playlist in Spotify via ADB:

adb am start -a android.intent.action.VIEW spotify:playlist:4bfj9Go9YnSq7L4YeWTWeY:play

Home assistant service:

service: androidtv.adb_command
target:
    entity_id: media_player.adb_percee_tv
data:
  command: 'am start -a android.intent.action.VIEW spotify:playlist:4bfj9Go9YnSq7L4YeWTWeY:play'

Tested but not working:

adb am start -n com.spotify.tv.android/.SpotifyTVActivity -a MediaStore.INTENT_ACTION_MEDIA_PLAY_FROM_SEARCH -e SearchManager.QUERY "bowie"
adb am start -a "android.media.action.MEDIA_PLAY_FROM_SEARCH" -e android.intent.extra.focus "vnd.android.cursor.item/*" -e query "bowie" -n com.spotify.tv.android/.SpotifyTVActivity
@hvsombrilla
Copy link

Adding shell works for me
adb shell am start -a android.intent.action.VIEW spotify:playlist:4bfj9Go9YnSq7L4YeWTWeY:play

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment