Uploading your Link PC-VR apps
Updated: Dec 19, 2024
You can upload Link PC-VR apps using Meta Quest Developer Hub, with the command-line tool, or with an integration of the command-line tool in Unreal or Unity.
Before you can upload your Link PC-VR app, you must:
- Have a Meta account and set up a development organization. For more information, see Manage Your Organization and Users
- Create a page for your app in the developer dashboard. For more information, see App Submission and Store Review.
- Ensure your app is packaged correctly.
- For Meta Quest Developer Hub: All necessary files and subdirectories must be inside a single directory that you can specify to the tool. Your app package should not be larger than 1 GB.
- For the command-line tool: All necessary files and subdirectories must be inside a single directory that you can specify to the command-line tool. Your app package should not be larger than 1 GB.
- For the Oculus Platform tool in the Unity or Unreal integration: Your App ID, App Token, and optional asset and language pack directories. Since this tool is a wrapper on the command-line tool, your app packages can be up to 1 GB in size.
Upload your app through the command-line interface
You can also upload your app with the Oculus Platform Command Line Utility. This utility is a better choice if your app package is larger than 200 MB, but smaller than 1 GB, or you have required assets or language packs associated with your app.
Upload your app from the Unity or Unreal editors
If you are using the Oculus Integration SDK for Unity or Unreal engine, you can access the Oculus Platform Command Line Utility through UI in the editor. These tools accept app packages up to 1 GB in size and you can upload assets associated with the app as well.
Change to a previous build
If users experience a problem with a build, or you need to roll back a build for some reason, you can change the build associated with a release channel for Rift apps. Note that this functionality does not work with Meta Quest apps.
- Go to the Meta Quest Developer Dashboard.
- Hover over your Rift app and then click Manage Build.
- On the Build Dashboard page, find the release channel for the build you want to modify, hover over the ellipses, and choose Select Build.
- Select the desired build in the drop-down and Submit to confirm the change.
If there are any packaging problems with your build, the upload validator lets you know what they are so that you can correct the issue and try again.
Link PC-VR apps with non-VR desktop modes
Link PC-VR also enables you to support apps that can be launched in a non-VR desktop mode.
There are three methods for delivering apps that have both VR and desktop modes:
- Select at startup(preferred)—the app automatically boots into VR mode or desktop mode depending on command-line arguments or whether it can detect a VR headset.
- Multiple binaries—the app provides two different executable files for VR and desktop modes.
- Runtime mode switching—the app switches between VR and desktop modes depending on whether the VR headset is in use.
Setting web interface options for app builds with non-VR desktop modes
For apps that use the Select at Startup method:
- In Launch File, enter the executable file name.
- In Launch Parameters, enter the command-line option that boots your app in VR mode.
For apps that use Multiple binaries:
- In Launch File, enter the 3D executable file name.
- Select the App is launchable in 2D mode checkbox.
- In In Launch File (2D Mode), enter the 2D executable file name.
For apps that use runtime mode switching, upload as a regular Rift build.
Implementing the select at startup method
To support the Select at Startup method, ship a single executable file that toggles between VR and desktop mode at startup, based on the availability of a working VR headset and command-line parameters.
Sample startup code and logic
The common logic for this startup method is as follows:
- If the command-line argument specifies desktop mode, then start in desktop mode.
- If no VR headset is available, then start in Desktop mode.
- Otherwise, start in VR mode.
Detecting a VR headset in Unity
In Unity, the command-line option -vrmode none
disables VR. The variable VRSettings.enabled
indicates whether VR is running and the variable VRSettings.loadedDevice
indicates whether the VR headset is available. Putting these components together gives us a way to check if the game should start in VR or desktop mode.
private static bool CheckForVRDevice()
{
bool isVR = false;
if (VRSettings.enabled)
{
// VR is enabled, make sure the device is available
if (VRSettings.loadedDevice == VRDeviceType.Oculus)
{
// VR is enabled and we have a connected VR device.
// go forward with VR!
isVR = true;
}
else
{
// no loaded device, so turn VR support off
VRSettings.enabled = false;
}
}
return isVR;
}
Detecting a VR headset in Unreal Engine
In Unreal Engine apps, you can activate VR mode by passing the command-line option -vr
at launch, or by setting the value of the ConsoleVariables.ini variable vr.BStartInVR
to 1. To activate desktop mode, use the command-line option -nohmd
. GEngine->HMDDevice->IsHMDConnected()
indicates whether the VR headset is available. GEngine->HMDDevice.IsValid()
indicates whether the app was started in VR mode.
Detecting a VR headset with the Oculus PC SDK (native C++)
In the Oculus PC SDK, the function ovr_Create()
returns false
if the VR headset is not available.
#include <OVR_CAPI.h>
void Application()
{
ovrResult result = ovr_Initialize(nullptr);
if (OVR_FAILURE(result))
{
return;
}
ovrSession session;
bool isVR = YourArgumentCheckHere("-vrmode", "none");
if (isVR)
{
// expecting VR mode, but need a valid device.
ovrGraphicsLuid luid;
result = ovr_Create(&session, &luid);
if (OVR_FAILURE(result))
{
// no headset connected, fall back to Desktop mode.
isVR = false;
}
}
// run game loop here
RunGameLoop(isVR);
if (isVR)
{
ovr_Destroy(session);
}
ovr_Shutdown();
}
Detecting a VR headset with OpenXR
With OpenXR, an application can detect the presence of a VR headset via xrGetSystem.
#include <openxr.h>
void Application()
{
XrInstanceCreateInfo createInfo{XR_TYPE_INSTANCE_CREATE_INFO};
createInfo.applicationInfo.applicationVersion = 1;
strcpy(createInfo.applicationInfo.applicationName, "application");
createInfo.applicationInfo.apiVersion = XR_API_VERSION_1_0;
XrInstance instance;
XrResult result = xrCreateInstance(&createInfo, &instance);
if (XR_FAILED(result))
return;
bool isVR = YourArgumentCheckHere("-vrmode", "none");
if (isVR)
{
XrSystemId systemId;
XrSystemGetInfo systemGetInfo{XR_TYPE_SYSTEM_GET_INFO, nullptr, XR_FORM_FACTOR_HEAD_MOUNTED_DISPLAY};
result = xrGetSystem(instance, &systemGetInfo, &systemId);
if (XR_SUCCEEDED(result))
{
// Create XrSession,
// run VR app loop.
}
else
{
// no headset connected.
// Run in desktop mode.
}
}
xrDestroyInstance(instance);
}