Skip to content

Instantly share code, notes, and snippets.

@bsharper
Created June 7, 2019 22:47
Show Gist options
  • Save bsharper/ae46000ed63a6e35bc6d26d4c27470c6 to your computer and use it in GitHub Desktop.
Save bsharper/ae46000ed63a6e35bc6d26d4c27470c6 to your computer and use it in GitHub Desktop.
Install Pavlov on the Quest in macOS / Linux
#!/bin/bash
function error_exit {
echo ""
echo "There was an error installing the game or the obb file. Look above for more info."
echo ""
echo "Things to try:"
echo "Check that the device (and only the device) is listed with "adb devices" from a command prompt."
echo "Make sure all Developer options look normal on the device"
echo "Check that the device has an SD card."
exit 1
}
function pause {
read -n1 -r -p "Press any key to continue..."
}
ADB=$(command -v adb)
RV=$?
if [[ $RV != 0 ]]; then
echo "Could not find 'adb' binary in path, please verify you have it installed"
exit 2
fi
DEVICE=""
if [[ ${#1} -gt 0 ]]; then
DEVICE="-s $1"
fi
STORAGE=$($ADB $DEVICE shell "echo \$EXTERNAL_STORAGE")
if [[ $DEBUG == 1 ]]; then
echo "===================="
echo " Variables"
echo "===================="
echo "ADB: $ADB"
echo "DEVICE: $DEVICE"
echo "STORAGE: $STORAGE"
echo "===================="
fi
if [[ $DRYRUN == 1 ]]; then
exit 0
fi
echo ""
echo "Uninstalling existing application. Failures here can almost always be ignored."
$ADB $DEVICE uninstall com.davevillz.pavlov
echo ""
echo "Installing existing application. Failures here indicate a problem with the device (connection or storage permissions) and are fatal."
$ADB $DEVICE install Pavlov-Android-Shipping-armv7-es2.apk
RV=$?
if [[ $RV != 0 ]]; then
error_exit
fi
$ADB $DEVICE shell rm -r $STORAGE/UE4Game/Pavlov
$ADB $DEVICE shell rm -r $STORAGE/UE4Game/UE4CommandLine.txt
$ADB $DEVICE shell rm -r $STORAGE/obb/com.davevillz.pavlov
$ADB $DEVICE shell rm -r $STORAGE/Android/obb/com.davevillz.pavlov
$ADB shell pm grant com.davevillz.pavlov android.permission.RECORD_AUDIO
echo ""
echo "Installing new data. Failures here indicate storage problems (missing SD card or bad permissions) and are fatal."
$ADB $DEVICE push main.1.com.davevillz.pavlov.obb $STORAGE/Download/obb/com.davevillz.pavlov/main.1.com.davevillz.pavlov.obb
RV=$?
if [[ $RV != 0 ]]; then
error_exit
fi
$ADB $DEVICE shell mv $STORAGE/Download/obb/com.davevillz.pavlov $STORAGE/Android/obb/com.davevillz.pavlov
RV=$?
if [[ $RV != 0 ]]; then
error_exit
fi
echo ""
echo ""
echo "Installation successful"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment