Before you begin developing for Gear VR in Unity, you must set up your development environment.
You will need the following hardware to develop for Gear VR in Unity:
- Samsung Gear VR and Samsung Galaxy S7, Galaxy S7 edge, Galaxy Note 5, Galaxy S6 edge+, Galaxy S6, or Galaxy S6 edge
- Samsung Gear VR Innovator Edition for S6 and Samsung Galaxy S6 or S6 edge
- Samsung Gear VR Innovator Edition for Note 4 and Samsung Galaxy Note 4
The following software is required for Gear VR development in Unity:
NOTE: Oculus Mobile SDK 1.0.0 is now required for submission to the Oculus store. If using Unity v.5.2.2p4 or later, this version of the SDK is already included and does not have to be downloaded and manually integrated. If using an earlier version of Unity, you may need to update the Oculus Mobile SDK to the latest version.
Java SE Development Kit 8
- Navigate to the Java SE Development Kit 8 download page.
- In the Java SE Development Kit 8u31 section, select the Accept License Agreement radio button and download the Mac OS X x64 file.
NOTE: A newer version of the Java SDK may be available for download. You may choose to use the latest version. The last version tested for these tutorials was 8u31.
- Open the DMG file and install the JDK.
- To ensure the JDK has been successfully installed, open a Terminal window, type the following command, and press Enter:
- Your current Java version will be displayed in the window.
Android SDK 5.0 and SDK Tools
To download and install the Android SDK:
- Navigate to the Android Studio and SDK Tools download page. Here you will be given the option to download Android Studio, which packages the official Android IDE and SDK tools, or to download a standalone package of the SDK Tools. For this tutorial, you only need the SDK Tools.
- Scroll down to the Download Options section. Under Get just the command line tools, locate the Mac OS X platform and download the corresponding file.
- Extract the Android SDK package to a location that is easily accessible on your machine (e.g., Desktop or Documents).
- Open the Android SDK package and review the contents.
- In the Android SDK directory, right-click the /tools/android file and select Open. This will open the Android SDK Manager.
- Check the boxes to select the following packages:
- Android SDK Tools (latest version)
- Android Platform-tools (latest version)
- Android SDK Build-tools (latest version)
- Android 5.0.1 (API 21)
NOTE: When the Android SDK Manager launches, some packages may be pre-selected for installation. For this tutorial, you only need to install the packages above. If any of the pre-selected packages are not on this list, feel free to uncheck the items before starting the installation proecss.
- Click the Install button.
- In the Choose Packages to Install dialog, select a package on the left hand side and select the Accept License radio button. Once all licences have been accepted, click the Install button.
Unity 5.3.1f1 or later
- Download the latest version of Unity for Mac OS X here.
NOTE: Unity 5.3.1f1 was used to create this tutorial series. You may experience issues if using an earlier version of Unity.
- In the Download and Install Unity window, click Continue.
- The Software and License Agreement appears. Click Continue.
- In the Unity component selection screen, make sure the following components are selected, then click Continue.
- Unity 5.x.x
- Web Player
- Standard Assets
- Android Build Support
NOTE: You may choose to install additional components based on your development needs. However, the components above are the only components needed for this tutorial series.
- Follow the remaining prompts to complete the setup process.
- Once installation is complete, launch Unity and sign into your Unity account. If you do not have an account, create one now.
- After activating Unity, the application will launch and prompt you to create a new project. At this point, you can close Unity and set up your device.
Set up your device for development
- Connect your Samsung Galaxy device to your computer via USB cable.
- From your mobile device, go to Apps > Settings.
- In Settings, scroll down to the SYSTEM section. If the Developer options menu is available, skip to Step 6. Otherwise, continue to Step 4 to enable Developer options.
- Scroll down, and tap Build number seven times. This will activate the Developer options menu on your device. Return to the main Settings screen.
- From the Developer options menu, navigate to DEBUGGING, and then enable USB debugging. A dialog box appears asking you to confirm. Tap OK.
- Another dialog box appears. Check the box next to Always allow this computer, then tap OK.
- Open a Terminal window from your Mac and type the following command to navigate to your Android SDK's /platform-tools directory:
- Type the following command to confirm that a device has been connected to your machine:
Retrieve Your Oculus Signature File
Oculus requires that all applications accessing VR functionality use a unique signature file created with a specific Device ID. This signature file will access low-level device functions through APIs provided in the Oculus Mobile SDK. Use one of the following methods to retrieve your Device ID.
- With your device connected to your Mac, open a Terminal window.
- Navigate to the /platform-tools directory in the Android SDK with the following command:
- Type the following command to retrieve your Device ID:
- Copy your Device ID.
You can also retrieve your Device ID using a mobile app. Download and install the SideloadVR Device ID app available from Google Play™, developed by Mark Schramm. Once installed, open the app and copy your Device ID.
Download the Oculus Signature File
- Navigate to the Oculus Signature File Generator and sign into your Oculus account. If you do not have an account, create one now.
- After logging into your account, paste your Device ID into the form field and click the Download File button. Your signature file will be downloaded. Be sure to keep this file in a location that can be easily accessed.