Last active
July 3, 2019 13:55
-
-
Save IvanJamesVR/3175265b047dad61c817ea0a08cd5dd1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import time | |
import os | |
gameName = "MyQuestGame" | |
companyName = "YourCompany" | |
maxTries = 20 | |
# Reboot Quest | |
subprocess.run("adb reboot") | |
print("\nQuest rebooting ...") | |
# Check for device | |
time.sleep(20) | |
print("\nWaiting for Quest ...") | |
connected = False | |
offlineTries = maxTries | |
while not connected: | |
result = subprocess.check_output("adb devices") | |
result = (str(result).replace('\\r','').split('\\n')[1]) | |
if 'device' in result: | |
print("\nQuest connected") | |
connected = True | |
elif 'offline' in result: | |
if offlineTries == 0: | |
print("\nTry to unplug/replug your Quest") | |
offlineTries = maxTries | |
else: | |
offlineTries = offlineTries - 1 | |
time.sleep(1) | |
else: | |
time.sleep(1) | |
subprocess.run("adb shell am start -n com."+companyName+"."+gameName+"/com.epicgames.ue4.GameActivity") | |
print("\n------------- Game", gameName,'launched ! -------------\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment