Restart PMS via adb (remotely)

server-nvidia-shield

#1

Hey,
for everybody who want to restart PMS on Shield TV remotely. Here is a solution.

1) Activate developer mode on Shield TV; Settings -> About -> Click Build 10 times;Enabl you will get a notification
2) Enable debugging; Settings -> Developer Options -> Debugging -> Enable Debugging
3) Enable debugging over USB; Settings -> Developer Options -> Debugging -> Toggle USB debugging on
4) Enable debugging over network; Settings -> Developer Options -> Debugging -> Toggle network debugging on

Now you have to install Googles debugging tools on the PC/MAC to restart the PMS from there.
You will get it here: developer.android.com/studio/releases/platform-tools.html
After extracted, navigate to the folder.
pc:~ name$ cd /Users/name/Downloads/platform-tools
Now you have to connect to your SHIELD TV.
pc:platform-tools user$ ./adb connect IP.OF.SHIELD.TV
* daemon not running; starting now at tcp:5037
* daemon started successfully
connected to 172.16.173.95:5555
You can shutdown your server with following command.
pc:platform-tools user$ ./adb shell am force-stop com.plexapp.mediaserver.smb
You server should be offline now.
pc:platform-tools user$ ./adb shell am start com.plexapp.mediaserver.smb/com.plexapp.mediaserver.ui.main.MainActivity
And your server comes online again.

Hope this guide helps someone!

best regards,
frezy

edit: with update 12.1 there are a new activity path. updated


#2

Thanks man, his is exactly what I have been looking for! I was able to stop the server the server so far, but didn't have the right command to start it back up.
This also works from a machine that you ssh into, for example I use my Rasperry Pi, that has a dynamic DNS, so I can access it from outside my network.


#3

Again, thank you! I came back here to ask you for help, since I couldn't start up the server via ADB anymore. But you beat me to the punch :)


#4

Where is the problem? The method works flawlessly with Android Oreo and the latest version of PMS.


#5

@hofstaetter said:
Where is the problem? The method works flawlessly with Android Oreo and the latest version of PMS.

Earlier versions of Plex Media Server used a different activity path. The original post by hoffstaetter has already been updated to reflect that. I was trying to use the old path on the new server unsuccessfully until I checked back here.