Python class for controlling Nvidia Shield over a network
Python 3.6 or higher with python-adb installed
Install Python
Download and install Python from here
Install python-adb
pip install adb
Nvidia Shield in Developer Mode with Network Debugging turned on
Turn on developer mode
Settings → About → Build (click Build 7 times - "You are now a developer" message will pop up)
Turn on Network debugging
Settings → Developer Options → Network debugging
The DNS name (recommended) or IP address and the debug port of your Nvidia Shield
Get the DNS name
The DNS name is usually just the Device name of your Shield. Unless you have changed it, it is SHIELD.
The device name is found at Settings → About → Device name
Get the IP address and debug port
Settings → Developer Options → Network debugging
When you select this option the IP address and port will be shown
Public and private adb keys
adb connect SHIELD:5555 # use the DNS name (or IP address) and Port from the previous step
A message will pop up on your Shield asking you to confirm the connection.
Files
adbkey
and adbkey.pub
will be added to the .android
directory of your home folder Linux/Mac: ~/.android
Windows: /users/<username>/.android
Copy these two files to the directory containing nvidia.py
import nvidia
device = nvidia.shield( 'SHIELD:5555' ) # device name (or IP address) and port
device.press( 'power' ) # turn the Shield on or off
device.press( 'home' ) # press the home button
device.launch( 'hbo' ) # launch HBO Now app
nvidia.shield
has two methods:
press( button )
Button is one of:
power, sleep, wake, home, back, search, up, down, left, right, center, volume up, volume down, rewind, ff, play/pause, previous, next
launch( app )
App is one of:
hbo, prime, music, youtube, ted, games
Questions, feedback, bug reports, and feature requests are all welcome.