Optimize Build Iterations for Android apps

Build process is one of the significant processes of the app development lifecycle. The time the system takes to build...deploy...run...repeat is known as iteration time. For developers, faster iteration time is pivotal when it comes to making changes in the app. Before you can test the smallest change on an Oculus device, the system needs to package and deploy that change on the device. This can be time consuming considering the number of iterations an app can undergo before the final build.

To expedite the iteration process, we’ve developed build tools, OVR Build APK and Run and OVR Quick Scene Preview, for Android apps and bundled them in the Oculus Integration package.

Note: These tools promote faster iteration cycles and generate build in development mode. Therefore, you should not use the .apk file that these tools generate as the final .apk file. To generate the final shippable .apk file, you must use Unity’s Build or Build and Run feature.


Prior to using these tools, check the following prerequisites.

  • Use Unity 2018.1 and later.
  • Use the Windows operating system for development. (macOS development platform does not support these features.)
  • Enable the Oculus device for testing and debugging.
  • Turn on the developer mode in the Oculus device from Settings > Device > slide the Developer Mode toggle.

OVR Build APK and Run

The OVR Build APK and Run tool runs a command that utilizes the gradle cache to speed up the build process. It starts by launching Unity’s build and export functionality, and when the initial build is compiled, it uses the gradle’s cache to only update the delta between builds. This way, it doesn’t rebuild files that are not a part of the change, and therefore, reduces the build and deploy time by 10 to 50% compared to Unity’s build time. There is no change in the final .apk file and it is identical to the one that Unity’s build produces. However, to publish the final .apk, you must use Unity’s build features.

To use OVR Build APK and Run:

  1. In the menu, go to File > Build Settings > select scenes that you want to build.
  2. Make sure Android is the target build platform. If not, select Android and click Switch Platform.
  3. On the menu, go to Oculus > OVR Build > OVR Build APK and Run.

    Screengrab of OVR Build APK and Run within Unity menu

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:

  1. To build and deploy a transition scene APK to your device, click Build and Deploy App. A transition scene loads scenes as asset bundles.
  2. 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.
  3. 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.
  4. Preview the scene in your Oculus device.
  5. Next time, when you make changes to a scene, save everything and click Build and Deploy Scene(s).

    Screengrab of OVR Quick Scene Preview within Unity menu

The tool also contains several helpful options in the Utilities section:

  • Delete Device Bundles - Delete all Asset Bundles that have been deployed to the device.
  • Delete Local Bundles - Delete all Asset Bundles that have been 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 device.
  • Open Build Settings - Opens Unity’s Build Settings.
  • Uninstall APK - Removes the Transition APK from the device.
  • Clear Log - Clears the log in the tool.