Skip to content

Building

Max Thomas edited this page Feb 17, 2024 · 17 revisions

Building alvr-org requires a computer with macOS 13 Ventura or later.

Install Prerequisites

Click to show instructions

1. Make an Apple developer account

Create an Apple developer account for free at developer.apple.com. A paid account is not required for running on your own headset.

2. Install Xcode and Xcode command line tools

Install Xcode or Xcode Beta from developer.apple.com/xcode.

After Xcode is installed, install the Xcode command line tools by opening Terminal.app and then running:

sudo xcode-select -s /Applications/Xcode.app
xcode-select --install

(You may need to adjust /Applications/Xcode.app in the first command to the location of your Xcode install, if you are using a Beta or have installed it elsewhere)

3. Install homebrew

In Terminal.app, install homebrew using the instructions at https://brew.sh

4. Install git

In Terminal.app, run:

brew install git

5. Uninstall homebrew versions of rustup/cargo

If you did not already have homebrew installed, skip this step.

brew remove rust rustup-init

6. Install rustup

In Terminal.app, run the curl command from https://rustup.rs/

7. Ensure rustup is up-to-date

In Terminal.app, run:

rustup update
rustup self update

8. Ensure macOS, iPhoneOS, and visionOS SDKs are installed

Open Xcode. If it is the first launch, install the macOS, iPhoneOS, and visionOS SDKs as prompted. Otherwise, go to Xcode > Settings..., then click on the Platforms tab and install the macOS, iPhoneOS, and visionOS SDKs.

xcode_platforms

Build visionOS client

Click to show instructions

Clone the repository

In Terminal.app, run:

git clone --recursive https://github.com/alvr-org/alvr-visionos.git
cd alvr-visionos

Build ALVR

In the same terminal, run zsh build_and_repack.sh to build the ALVR client library framework.

Prepare Xcode for building and debugging

Open ALVRClient.xcodeproj in Finder, or open it directly with Xcode.app > File > Open.... Then, click on the Project Navigator icon:

alvr-step1

Next, click on the *ALVR Client project, then click on Signing and Capabilities. Then, change the Team to your own signing keys.

alvr-step2

At the top of the window, click on the current device, then click on Manage Run Destinations. Leave this window open for the next step.

alvr-step3

Connecting your Apple Vision Pro to Xcode

Ensure that your Apple Vision Pro and computer are on the same network, and that Bluetooth is enabled on both.

On your Apple Vision Pro, go to Settings > General > Remote Devices. Leave this window open for the next step.

alvr-step4 alvr-step5

On your computer, in Xcode, the headset should now appear under Discovered. Click Pair and proceed with the pairing process.

alvr-step7

On your Apple Vision Pro, go to Settings > Privacy & Security and enable Developer Mode.

alvr-step6

Build and run the application

Exit out of the Run Destinations window. In the main Xcode window, select the newly-paired Vision Pro, then click the Run and Debug button. The first run may take a very, very long time, so be patient.

After the app launches, grant the local network and microphone permissions.

alvr-step8 alvr-step9

Finding the hostname and IP

At the bottom of the Xcode window, look for the application log and Cmd+F for "hostname" to find the hostname.

alvr-step10

Connect to your PC

Ensure that your PC is running the latest ALVR nightly (v21). Add the hostname and IP address from the previous step to ALVR manually. The visionOS ALVR client should now connect to the PC automatically, as long as SteamVR is open.

Updating visionOS client

Click to show instructions

Before we start...

In general, you can always delete the alvr-visionos directory and start from scratch if you are having trouble. Additionally, you may want to re-read the building instructions from time to time, since they can sometimes change and improve as the project develops. That aside, the general updating workflow is as follows:

Pulling the latest changes

In Terminal.app, change directory to the alvr-visionos folder and pull the latest changes:

cd alvr-visionos
git pull origin main

If git complains about "uncommitted changes", run the following command:

git stash

You may have to re-do the steps in Prepare Xcode for building and debugging as a result of running git stash.

Rebuild the ALVR library

Continuing in Terminal.app, re-build the ALVR library:

zsh build_and_repack.sh

Rebuild the Xcode project

Finally, rebuild the client in Xcode following the steps in Build and run the application from above.

Common Issues

"failed to run custom build command for coreaudio-sys" when building ALVR

Make sure Xcode is installed at /Applications/Xcode.app, and then run sudo xcode-select --switch /Applications/Xcode.app.

"There is no XCFramework found at..." in Xcode

Make sure the ALVR framework is is built successfully (by running the build_and_repack.sh script), then select Product -> Clean Build Folder in Xcode, and then build the client again.

The app identifier "com.worthdoingbadly.ALVRClient" cannot be registered to your development team

Use a device-specific Development provisioning profile instead of a Distribution provisioning profile, or change the com.worthdoingbadly. prefix to your own registered bundle identifier prefix.

"Trusted client is incompatible" log message

The ALVR server/PC version must match the client. You can download a current nightly build here.

Client never connects

Ensure you have the Local Network permission enabled in the Settings app, under Apps -> ALVRClient.