This site has been permanently archived. The content on this site was last updated in 2019.
Instant Preview
Stay organized with collections
Save and categorize content based on your preferences.
Use Instant Preview to test VR apps that you are building in Unity instantly on
your phone. Instant Preview lets you skip the build process and improve
iteration time.
Overview
Instant Preview consists of an Android app for your Daydream-ready phone
and a plugin for Unity or Unreal Engine.
In Instant Preview, you can:
- Preview your app's full VR experience in the editor or use just the
physical Daydream controller in the editor
- Use USB or Wi-Fi streaming
- Configure streaming to optimize for resolution or for latency
Developer considerations
Rendering happens on your development machine, meaning that Instant Preview is
not suitable for performance testing or for calling Android APIs directly.
When streaming over Wi-Fi, use Instant Preview while on a secure network
with a firewall enabled.
Communication between your development machine and your phone uses
unencrypted TCP over an open port.
Get started
This guide assumes that you have already created a Google VR project in Unity.
If you are new to working with the Google VR SDK, see the Unity Quickstart guide.
In the Unity Project window, navigate to GoogleVR > Prefabs > InstantPreview.
Add an instance of the GvrInstantPreviewMain prefab from the
InstantPreview folder to your scene hierarchy. The game object
persists across scene transitions, so you can add it to the root of your
loading scene.
By default, the GvrInstantPreviewMain prefab is configured to install the
Instant Preview Android app automatically when you run your app in the
Unity Editor.
You can also install the app from the command line:
adb install -r Assets/GoogleVR/Scripts/InstantPreview/InstantPreview.apk
Make sure that your phone is connected to your computer via USB and click
Play in the Unity Editor to start previewing your app.
After launching the Instant Preview app, click Pause in the Unity Editor
to stop streaming. Tap the X button or system back button on your phone
to exit VR mode.
(Optional) You can make additional configurations while your app is paused
and your phone is not in VR Mode. See the following sections for details on:
Switch preview modes
In Instant Preview, you can opt to stream your app's full VR experience or
controller interactions only.
Mode |
Description |
Use for |
Full VR preview
|
- Changes you make in the editor are visible immediately on your
phone in VR.
- Instant Preview streams head pose and
controller data to your development machine, where the game engine renders
the scene in stereo and streams video back to your phone.
- Provides an instant preview of your app with low enough latency
to make longer usage sessions comfortable
|
Longer usage sessions iterating on multiple aspects of your app.
|
Controller only
|
- Streams only controller data to the editor.
- No stereo preview shown on the phone.
|
Iterating only on controller interactions
|
To switch preview modes:
- If your app is currently running, click Pause in the Unity Editor.
- Tap the X button or system back button on your phone to exit VR mode.
- In the Instant Preview app on your phone, use the Preview via...
dropdown to select Full VR preview or Controller only mode.
- Click Play in the Unity Editor to begin streaming.
Stream over a Wi-Fi connection
Instant Preview works the same way when streaming over USB or Wi-Fi.
By default, Instant Preview uses USB. Streaming over USB is best for long
development sessions.
Use Wi-Fi for shorter testing sessions that require an untethered range of
movement.
To stream over Wi-Fi:
- Instant Preview uses multicast address 239.170.165.207 on port 49838
to find host computers. Make sure that your network allows this connection.
Connect to your computer:
- If your app is currently running, click Pause in the Unity Editor.
- Tap the X button or system back button on your phone to exit VR mode.
- If your computer is running the Unity editor with Instant Preview, it
should be discoverable from the Instant Preview app running on a phone
connected to the same Wi-Fi network.
- In the Instant Preview app on your phone, tap the drop-down
field under Preview via… to see available computers.
- Tap a computer name to connect to it.
Click Play in the Unity Editor to begin streaming.
In the Unity Editor, you can configure the following GvrInstantPreviewMain
prefab settings:
Setting |
Description |
Output resolution
|
- Big (default): 2560 x 1440
- Regular: 1920 x 1080
- WindowSized: scales with Game Window size
|
Multisample Count
|
- Adds Multisample Anti-Aliasing (MSAA) to the scene
- Defaults to
One, meaning no anti-aliasing
- Higher values
correspond to higher quality
|
Bit Rate
|
- Encoding bitrate
- Defaults to 16000
- Lower values encode at lower
quality but run at a higher framerate
|
Install Apk on Run
|
- Ensures that the correct version
of the Instant Preview Android app is installed and running on your
phone each time you click Play in the editor
- Defaults to Enabled
- Requires your phone to be connected to adb via USB
|
To improve streaming latency, consider disabling Vsync in the editor.
You can disable Vsync from Edit > Project Settings > Quality:
![]()
If you are working in macOS, try the following adjustments:
- Use Metal for rendering instead of OpenGL.
Go to Player Settings >
Settings for PC, Mac & Linux Standalone > Other Settings > Metal Editor
Support to enable Metal rendering.
- As performance is affected by the size of your preview window:
- Select Low Resolution Aspect Ratios on the preview window.
- Keep the preview window to a reasonably small size.
Troubleshooting
If you run into issues, check for any Instant Preview errors in the Unity
Console.
Additionally, make sure that:
Your phone is connected to your computer via USB
Your phone is unlocked and developer options
are enabled
In Unity's Build Settings, your build platform is set to Android
You completed the Instant Preview setup steps in this guide.
The GvrInstantPreviewMain
prefab exists and is enabled in your scene
When you press Play in Unity, the Console displays both
Google VR SDK for Unity Version: 1.xx and Instant Preview Version:
1.0.0.x (where x is replaced by a version number)
If your issue is not addressed here, you can report it on the Google VR SDK for Unity issues page.
All rights reserved. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-09 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-09 UTC."],[[["\u003cp\u003eInstant Preview lets you rapidly test VR applications built in Unity directly on your phone, bypassing the usual build process.\u003c/p\u003e\n"],["\u003cp\u003eIt offers two preview modes: "Full VR preview" for immersive testing and "Controller only" for focused interaction development.\u003c/p\u003e\n"],["\u003cp\u003eYou can stream your VR experience over USB for extended sessions or Wi-Fi for untethered movement, ensuring network security when using Wi-Fi.\u003c/p\u003e\n"],["\u003cp\u003eRendering occurs on your development machine, so Instant Preview is not intended for performance evaluation or direct Android API calls.\u003c/p\u003e\n"],["\u003cp\u003eTo get started, add the \u003cem\u003eGvrInstantPreviewMain\u003c/em\u003e prefab to your Unity scene, connect your phone, and click "Play" in the editor.\u003c/p\u003e\n"]]],["Instant Preview enables testing VR apps built in Unity directly on a phone, bypassing the build process. Key actions include adding the *GvrInstantPreviewMain* prefab to your Unity scene, connecting your phone via USB or Wi-Fi, and pressing play. You can choose between \"Full VR preview\" or \"Controller only\" modes, and customize streaming resolution, anti-aliasing, and bit rate in the Unity Editor. For Wi-Fi streaming, ensure network configurations allow connection via the multicast address and port specified.\n"],null,["# Instant Preview\n\nUse Instant Preview to test VR apps that you are building in Unity instantly on\nyour phone. Instant Preview lets you skip the build process and improve\niteration time.\n\nOverview\n--------\n\nInstant Preview consists of an Android app for your [Daydream-ready phone](https://vr.google.com/daydream/smartphonevr/phones/)\nand a plugin for Unity or Unreal Engine.\n\nIn Instant Preview, you can:\n\n- Preview your app's **full VR experience** in the editor **or use just the\n physical Daydream controller** in the editor\n- Use **USB or Wi-Fi streaming**\n- **Configure streaming** to optimize for resolution or for latency\n\n### Developer considerations\n\n- Rendering happens on your development machine, meaning that Instant Preview is\n not suitable for performance testing or for calling Android APIs directly.\n\n- **When streaming over Wi-Fi, use Instant Preview while on a secure network\n with a firewall enabled.**\n Communication between your development machine and your phone uses\n unencrypted TCP over an open port.\n\n### Get started\n\nThis guide assumes that you have already created a Google VR project in Unity.\nIf you are new to working with the Google VR SDK, see the [Unity Quickstart guide](/vr/unity/get-started).\n\n1. In the Unity **Project** window, navigate to **GoogleVR \\\u003e Prefabs \\\u003e InstantPreview**.\n\n2. Add an instance of the *GvrInstantPreviewMain* prefab from the\n **InstantPreview** folder to your scene hierarchy. The game object\n persists across scene transitions, so you can add it to the root of your\n loading scene.\n\n By default, the *GvrInstantPreviewMain* prefab is configured to install the\n Instant Preview Android app automatically when you run your app in the\n Unity Editor.\n\n You can also install the app from the command line: \n\n ```\n adb install -r Assets/GoogleVR/Scripts/InstantPreview/InstantPreview.apk\n ```\n3. Make sure that your phone is connected to your computer via USB and click\n **Play** in the Unity Editor to start previewing your app.\n\n4. After launching the Instant Preview app, click **Pause** in the Unity Editor\n to stop streaming. Tap the **X** button or system back button on your phone\n to exit VR mode.\n\n5. (Optional) You can make additional configurations while your app is paused\n and your phone is not in VR Mode. See the following sections for details on:\n\n - Switching [preview modes](#switch_preview_modes)\n - How to [stream over Wi-Fi](#stream_over_a_wi-fi_connection) instead of USB\n - [Customizing *GvrInstantPreviewMain* prefab settings](#configure_prefab_settings)\n\n### Switch preview modes\n\nIn Instant Preview, you can opt to stream your app's full VR experience or\ncontroller interactions only.\n\n| Mode | Description | Use for |\n|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------|\n| **Full VR preview** | - Changes you make in the editor are visible immediately on your phone in VR. - Instant Preview streams head pose and controller data to your development machine, where the game engine renders the scene in stereo and streams video back to your phone. - Provides an instant preview of your app with low enough latency to make longer usage sessions comfortable | Longer usage sessions iterating on multiple aspects of your app. |\n| **Controller only** | - Streams only controller data to the editor. - No stereo preview shown on the phone. | Iterating only on controller interactions |\n\nTo switch preview modes:\n\n1. If your app is currently running, click **Pause** in the Unity Editor.\n2. Tap the **X** button or system back button on your phone to exit VR mode.\n3. In the Instant Preview app on your phone, use the **Preview via...** dropdown to select **Full VR preview** or **Controller only** mode.\n4. Click **Play** in the Unity Editor to begin streaming.\n\n### Stream over a Wi-Fi connection\n\nInstant Preview works the same way when streaming over USB or Wi-Fi.\n\nBy default, Instant Preview uses USB. Streaming over USB is best for long\ndevelopment sessions.\n\nUse Wi-Fi for shorter testing sessions that require an untethered range of\nmovement.\n\nTo stream over Wi-Fi:\n\n1. Instant Preview uses multicast address **239.170.165.207** on **port 49838** to find host computers. Make sure that your network allows this connection.\n2. Connect to your computer:\n\n - If your app is currently running, click **Pause** in the Unity Editor.\n - Tap the **X** button or system back button on your phone to exit VR mode.\n - If your computer is running the Unity editor with Instant Preview, it should be discoverable from the Instant Preview app running on a phone connected to the same Wi-Fi network.\n - In the Instant Preview app on your phone, tap the drop-down field under **Preview via...** to see available computers.\n - Tap a computer name to connect to it.\n3. Click **Play** in the Unity Editor to begin streaming.\n\n### Configure prefab settings\n\nIn the Unity Editor, you can configure the following *GvrInstantPreviewMain*\nprefab settings:\n\n\u003cbr /\u003e\n\n| Setting | Description |\n|------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Output resolution** | - **Big** (default): 2560 x 1440 - **Regular**: 1920 x 1080 - **WindowSized**: scales with Game Window size |\n| **Multisample Count** | - Adds Multisample Anti-Aliasing (MSAA) to the scene - Defaults to **One**, meaning no anti-aliasing - Higher values correspond to higher quality |\n| **Bit Rate** | - Encoding bitrate - Defaults to **16000** - Lower values encode at lower quality but run at a higher framerate |\n| **Install Apk on Run** | - Ensures that the correct version of the Instant Preview Android app is installed and running on your phone each time you click **Play** in the editor - Defaults to **Enabled** - **Requires your phone to be connected to adb via USB** |\n\n\u003cbr /\u003e\n\n### Performance tips\n\nTo improve streaming latency, **consider disabling Vsync** in the editor. \n\nYou can disable Vsync from **Edit \\\u003e Project Settings \\\u003e Quality:**\n\nIf you are working in macOS, try the following adjustments:\n\n- **Use Metal** for rendering instead of OpenGL. \n Go to **Player Settings \\\u003e\n Settings for PC, Mac \\& Linux Standalone \\\u003e Other Settings \\\u003e Metal Editor\n Support** to enable Metal rendering. \n- As performance is affected by the size of your preview window:\n - Select **Low Resolution Aspect Ratios** on the preview window. \n - Keep the preview window to a reasonably small size.\n\n### Troubleshooting\n\nIf you run into issues, check for any Instant Preview errors in the Unity\nConsole.\n\nAdditionally, make sure that:\n\n- Your phone is connected to your computer via USB\n\n- Your phone is unlocked and [developer options](//developer.android.com/studio/debug/dev-options.html)\n are enabled\n\n- In Unity's **Build Settings** , your build platform is set to **Android**\n\n- You completed the [Instant Preview setup steps](#get_started) in this guide.\n\n- The `GvrInstantPreviewMain` prefab exists and is enabled in your scene\n\n- When you press **Play** in Unity, the Console displays both\n **Google VR SDK for Unity Version: 1.xx** and **Instant Preview Version:\n 1.0.0.x** (where x is replaced by a version number)\n\nIf your issue is not addressed here, you can report it on the [Google VR SDK for Unity issues page](https://github.com/googlevr/gvr-unity-sdk/issues)."]]