Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
VirtualBoyGo powershell
Downloads VirtualBoyGo source code
Gathers all dependencies and places them in the correct folders!
Author : Benjamin McLean
# Warning: Getting this to build and work properly in Android Studio may require not only your ANDROID_HOME environment variable to be set for your Android SDK, but also ANDROID_NDK_HOME for your Android NDK. If you fail to do this, you may have signing problems.
1. Make sure you have 7-zip installed in the default location because my PowerShell depends on it.
2. Make sure you have Git for Windows installed. Might as well also grab GitExtensions , GitHub Desktop and Notepad++ because these tools are nice to have, but not required. Git for Windows is required, however.
3. Get Android Studio and the Android SDK. The way I recommend doing this is through the JetBrains Toolbox app because it will keep your tools updated for you.
4. Set your ANDROID_HOME and ANDROID_NDK_HOME environment variables. Yes, you need ANDROID_NDK_HOME set for this to build.
5. Make yourself a folder to work in, such as C:\Oculus which I used.
6. Get Oculus Mobile SDK 1.23 which comes as a zip file called "" and save it in your working folder. My PowerShell will unzip it for you, so just save the zip in the folder.
7. Get this, my awesome PowerShell script and save it in your working folder as "VirtualBoyGo.ps1"
8. Get my easy PowerShell launcher and save it in your working folder as "VirtualBoyGo.bat"
9. Run "VirtualBoyGo.bat" The batch file will launch the PowerShell for you if the names match. Hopefully it should run without errors. :)
10. In Android Studio, import the gradle project in your working folder\ovr_sdk_mobile_1.23\VrSamples\VirtualBoyGo\Android and build it. I used Gradle version 4.4
Now it'll build!
# Setting ErrorAction
$ProgressPreference = "SilentlyContinue" # Progress bar can significantly impact Invoke-WebRequest cmdlet performance, see issue:
# Module Import
Import-Module Microsoft.PowerShell.Archive
# Setting Variables
$path = Split-Path -Parent $PSCommandPath
$mobileSdkFolder = "ovr_sdk_mobile_1.23"
# Checking required environmental application supports
Write-Output "Checking for 7zip"
if (-not (Test-Path "$env:ProgramFiles\7-Zip\7z.exe")) {throw "$env:ProgramFiles\7-Zip\7z.exe needed"}
set-alias sz "$env:ProgramFiles\7-Zip\7z.exe"
Write-Output "Extracting Oculus Mobile SDK"
if (-not (test-path "$path\$")) {throw "$path\$ needed. Please download it from"}
Expand-Archive "$" -Destination "$path/$mobileSdkFolder"
Write-Output "Editing"
Set-Location "$path\$mobileSdkFolder\"
Set-Content "" -Value (Get-Content "" | Select-String -Pattern "Werror" -NotMatch) # Removes any line with the word "Werror" in it
Add-Content "" "`nLOCAL_CFLAGS += -Wno-format`nLOCAL_CFLAGS += -Wno-unused-variable`nLOCAL_CFLAGS += -Wno-ignored-qualifiers`nLOCAL_CFLAGS += -frtti`nLOCAL_CFLAGS += -Wno-sign-compare`nLOCAL_CFLAGS += -Wno-unused-function`n`nCFLAGS += -Wall`nCFLAGS += -mword-relocations`nCFLAGS += -mtune=mpcore`nCFLAGS += -mfloat-abi=hard`nCFLAGS += -fomit-frame-pointer`nCFLAGS += -ffast-math`n"
Write-Output "download this repo and copy it into ""$path\$mobileSdkFolder\VrSamples\"""
Set-Location "$path\$mobileSdkFolder\VrSamples\"
git clone
Write-Output "download and copy it into ""$path\$mobileSdkFolder\VrSamples\"""
git clone
Write-Output "download and copy it into ""$path\$mobileSdkFolder\VrEmulators\"""
New-Item -Path "$path\$mobileSdkFolder\" -Name "VrEmulators" -ItemType "directory"
Set-Location "$path\$mobileSdkFolder\VrEmulators\"
git clone
Write-Output "download ""FreeType 2.10.0"" and copy the ""include"" and the ""src"" folder into ""$mobileSdkFolder/VrEmulators/FreeType/"" folder"
New-Item -Path "$path\$mobileSdkFolder\VrEmulators" -Name "FreeType" -ItemType "directory"
Set-Location "$path\$mobileSdkFolder\VrEmulators\"
Invoke-WebRequest -Uri "" -OutFile "$path\$mobileSdkFolder\VrEmulators\freetype-2.10.0.tar.gz"
sz e "$path\$mobileSdkFolder\VrEmulators\freetype-2.10.0.tar.gz" "-aoa"
sz x -r "$path\$mobileSdkFolder\VrEmulators\freetype-2.10.0.tar" "-aoa"
Copy-Item "$path\$mobileSdkFolder\VrEmulators\freetype-2.10.0\include\" -Destination "$path\$mobileSdkFolder\VrEmulators\FreeType\" -Recurse -Force
Copy-Item "$path\$mobileSdkFolder\VrEmulators\freetype-2.10.0\src\" -Destination "$path\$mobileSdkFolder\VrEmulators\FreeType\" -Recurse -Force
Remove-Item "freetype-2.10.0.tar" -Force
Remove-Item "$path\$mobileSdkFolder\VrEmulators\freetype-2.10.0" -Recurse -Force
Write-Output "Also copy the """" and the """" files from the FrontendGo repo and copy them into ""$path\$mobileSdkFolder\VrEmulators\FreeType\"""
Copy-Item "$path\$mobileSdkFolder\VrSamples\FrontendGo\freetype mk\" "$path\$mobileSdkFolder\VrEmulators\FreeType\" -Force
Copy-Item "$path\$mobileSdkFolder\VrSamples\FrontendGo\freetype mk\" "$path\$mobileSdkFolder\VrEmulators\FreeType\" -Force
Write-Output "download ""gli"" and copy the gli folder (the one next to doc, test, util, etc.) into ""$mobileSdkFolder/VrEmulators/"""
Set-Location "$path\$mobileSdkFolder\VrEmulators\"
Invoke-WebRequest -Uri "" -OutFile ""
Expand-Archive "" -Destination "gli-"
Copy-Item "gli-\gli\gli" "$path\$mobileSdkFolder\VrEmulators\" -Recurse -Force
Remove-Item "$path\$mobileSdkFolder\VrEmulators\gli-" -Recurse -Force
Write-Output "download ""glm"" and copy the glm folder (the one next to doc, test, util, etc.) into ""$mobileSdkFolder/VrEmulators/"""
Set-Location "$path\$mobileSdkFolder\VrEmulators\"
Invoke-WebRequest -Uri "" -OutFile ""
Expand-Archive "" -Destination "glm-"
Copy-Item "glm-\glm\glm" "$path\$mobileSdkFolder\VrEmulators\" -Recurse -Force
Remove-Item "$path\$mobileSdkFolder\VrEmulators\glm-" -Recurse -Force
Write-Output "open the VirtualBoyGo project in Android Studio"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.