text
stringlengths
0
1.11k
Make sure Android is the target build platform. If not, select Android and click Switch Platform.
On the menu, go to Oculus > OVR Build > OVR Build APK....
Screengrab of OVR Build APK menu
This opens the OVR Build APK window. This tool contains several options to configure your build:
Built APK Path - The generated .APK file will be copied to this location.
Version Number - This corresponds to the version listing on your app in the Developer Dashboard. To upload an app to the store, it must have a higher version number than the currently-uploaded version.
Auto-Increment? - If true, the version number is incremented by 1 upon a successful build.
Install & Run on Device? - If true, upon build completion, the generated .APK file is installed and launched on the connected device, listed to right.
Development Build? - This is equivalent to the Development Build checkbox in Unity’s build settings. If true, the build offers debug functionality, but cannot be uploaded to the Meta Quest store.
Save Keystore Passwords? - If true, the password is required to sign .APK builds and saved across instances of the Unity editor. Otherwise, Unity’s default behavior is performed, erasing keystore passwords between instances of the Unity editor.
Screengrab the OVR Build APK menu
If desired, you can also use the Oculus > OVR Build > OVR Build APK & Run command, which automatically generates a build and launches the APK on the connected headset.
Auto Increment Version Code
When uploading a new build to a release channel, it must have a different version than the build it is replacing. Not incrementing the version code is a common cause of failures when uploading your APK. Unity includes functionality that automatically increments the version code by 1 every time a build is created. It is highly recommended that you use enable this feature. In Unity, it can be done so in two ways from the menu bar:
Go to Oculus > OVR Build > OVR Build APK... or OVR Build and Run APK. In the OVR Build APK window that opens, check Auto Increment? next to Version Number.
Go to Oculus > Tools and select Auto Increment Version Code?.
Both methods do the same thing, and enabling it in one place does so in the other.
OVR Quick Scene Preview
OVR Scene Quick Preview uses Unity’s Asset Bundle system to reduce the deployment time by hot reloading changes. The first time it builds the .APK file, the file contains project’s code along with the asset bundle loader script. Based on the asset type, it breaks assets into individual asset bundles and deploys them to an external folder on the device. For example, asset bundles can be models, textures, audio, or entire scene. Next time, when you make a change to an asset, it builds and deploys only the bundles that contain changes, and therefore reduces the overall iteration time.
To use OVR Quick Scene Preview:
To build and deploy a transition scene APK to your device, click Build and Deploy App. A transition scene loads scenes as asset bundles.
To add scenes you’re developing, click Open Build Settings. Single scenes work best, but if your project loads scenes additively or you want to see the transition between two scenes, add all the scenes. For multiple scenes, ensure that your project loads scenes by name and not by index. If scenes are loaded by index, consider changing it to name.
To build your scenes into your device, click Build and Deploy Scene(s). The first time you build, the process is slower than the subsequent builds. You have the option to force restart the app, if needed. By default, the scene in the transition APK tries to hot reload your changes.
Preview the scene in your Meta Quest headset.
Next time, when you make changes to a scene, save everything and click Build and Deploy Scene(s).
Screengrab of OVR Quick Scene Preview
The tool also contains several helpful options in the Utilities section:
Delete Device Bundles - Delete all asset bundles that are deployed on the headset.
Delete Local Bundles - Delete all asset bundles that are built locally.
Use optional APK package name - If checked, changes the Transition APK package name to com.your.project.transition.
Launch App - Launches the app on the headset.
Open Build Settings - Opens Unity’s Build Settings window.
Uninstall APK - Removes the transition APK from the headset.
Clear Log - Clears the log in the tool.Strip Unused Shaders
Unity
All-In-One VR
Quest
The platform for which this article is written (Unity) does not match your preferred platform (Nativa).
Haz clic aquí para ver la página del índice de la documentación para tu plataforma de preferencia.
Unity’s default Built-In Render Pipeline offers three graphics tiers, Tier 1, Tier 2, and Tier 3, to customize the built-in shader compilation and rendering quality, and they correspond to target platforms for which you’re developing apps.
Understand Shader Stripping
Android apps developed in Unity, by default, load shaders from only Tier 2. Though shaders from Tier 1 and Tier 3 are built, which increases the build time, the app does not load any shaders from those tiers. The shader stripping mechanism lets you easily skip unused shaders from compilation to significantly reduce the player build time.
If you choose to strip unused shaders, at the time of shader compilation, the system starts by checking the Meta Quest platform. If Android, it modifies the list of shaders to remove Tier 1 and Tier 3 shaders and compiles shaders from only Tier 2.
Shader stripping when using a Scriptable Render Pipeline, such as the prebuilt Universal Render Pipeline, may remove shaders unintentionally and should be avoided.
Enable Shader Stripping
The shader stripping feature is only available for Meta Quest headsets that run on Android and supported on Unity versions 2018.2 and higher. Make sure that the target platform is set to Android.
From Hierarchy View, select OVRCameraRig. If you’re using OVRPlayerController, expand it, and then select OVRCameraRig. For more information about using the OVRCameraRig prefab, go to the Add Camera Rig using OVRCameraRig topic.
From Inspector View, in the OVR Manager script, under Android Build Settings, select Skip Unneeded Shaders.Tutorial - Create Your First VR App on Meta Quest Headset
Unity
All-In-One VR
PC VR
Quest
The platform for which this article is written (Unity) does not match your preferred platform (Nativa).
Haz clic aquí para ver la página del índice de la documentación para tu plataforma de preferencia.
This tutorial describes the essential steps to:
Set up a Unity project that can build and run on a Meta Quest headset.
Develop a basic “hello world” Unity project comprising a single scene with a cube GameObject rendered on the headset.
Configure Camera settings.
Build, run, and test a project on a Meta Quest headset.
This tutorial is the primary reference for starting Meta Quest development quickly.
Hello World app running on a Meta Quest 2
Hello World app running on a Meta Quest 2
Prerequisites
Before reading further, ensure you have followed all steps in the Set Up Development Environment and Meta Quest Developer Hub guides. By following these guides, your development environment will be ready for your first project in Unity and your Meta Quest headset will be accessible in the Meta Quest Developer Hub.
Glossary
Meta XR All-in-One SDK - An all-in-one source for core features, components, scripts, and plugins to ease the app development process.
OVRPlugin - A plugin that allows Unity to communicate with the VR Runtime of Meta Quest.