Build Instructions

GearVRf app requirements, build instructions, building and running, and sample apps

In order to build and and run GearVRf applications (your own or sample apps) in Android Studio, you have two options:

  • (Preferred) Download the latest release of previously built Gear VR Framework .aar files
  • Optionally, locally build the Gear VR Framework from the latest source code


For BOTH methods, locally building AND using a pre-built framework, the following prerequisites must be met.

1. Install Required SDKs

Make sure follow the Getting Started Guide and install all the required SDKs

2. Building Gear VR Framework

You can optionally locally build GearVRf from source code using Android Studio.

Here are the steps:

  1. Add OVR_MOBILE_SDK to and set it to the path to the Oculus Mobile SDK; recommended to use the global $HOMEPATH/.gradle/ or ~/.gradle/
  2. Add ANDROID_NDK_HOME to and set it to the path to the Android NDK installation.
  3. Navigate to the GearVR Framework and select the folder, and click OK
  4. Click Make Project (from the Build menu)

3. Building and Running GearVRf Applications

After you have the Gear VR Framework, by either locally building or using a pre-built framework, you can now import, build, and run GearVRf applications (your own or sample apps) in Android Studio. The specific procedure you use depends on whether you locally built the Gear VR Framework from source code files or used pre-built framework files.

  1. When building your own GearVRf apps from scratch, copy the appropriate device XML file from the GearVRf SDK to your application's assets folder. GearVRf provides an xml file for you to use: gvr.xml.
  2. Import the GearVRf application code.
    • Click File -> Open ...
    • Navigate to the project folder (for example, gvr-simplesample).
    • Click OK
  3. Clean and build the application.
    • Go to the Build menu and click Clean...
    • Click Make Project (from the Build menu)
  4. Run the application.
    • Connect an Android mobile device to your local machine.
    • Select your project in the project explorer
    • Click Run on the toolbar


You may need to apply to Oculus for a signature file for your device. For application and use details, refer to the online signature generator (

Generate Javadocs

When locally building the Gear VR Framework, you can optionally generate Javadoc files with details about the GearVRf API.

Optional: To get GearVRf API reference details by generating GearVRf Javadoc files in the specified directory:

  1. In Android Studio, click Project > Generate Javadoc...
  2. In the Generate Javadoc window:
    1. Javadoc command: (Pathname to the Javadoc executable file) Typically, in the bin directory of the Java directory.
    2. Click on the plus-icon to expand the Framework listing.
    3. Checkmark src
    4. Select Use standard doclet
    5. Destination: (Convenient local directory to contain the Javadoc files)
    6. Optional Specify VM options: NOTE: You may encounter errors if VM options is not specified.
      1. Click Next >
      2. Click Next >
      3. VM options: -bootclasspath path to your Android jar file
    7. Click Finish