0.7.1 template in Xcode and simulator will crash

Environment: Xcode 15.2 beta 1, Unity 2022.3.15f1, VisionOS 1.0 Beta(21N301), M2 Mac.
Download 0.7.1 template and using the above softwares to build SampleScene and enable PolySpatial and apple visionos XR-Plug-in Management.
If set Target SDK in unity to Simulator, simulator option won’t show up as target in Xcode unless I change Architectures in Build Setting from x86_64 to arm64. After launch in simulator it will crash immediately as the following image show

If set Target SDK in unity to Device, simulator option won’t show up as target in Xcode unless I switch Supported Platform in Xcode from xros to visionOS. After launch in simulator in will crash immediately as the following image show


Previous, I am using Xcode_15_beta_8 and 0.3.3 template, it works quite well. Please let me know how I can run Simulator properly in 0.7.1 since we have a VisionPro Lab visit two weeks later, thanks

Just to confirm – these were already turned on/set up, or did you have to manually turn either of these on? If so, the project may not have opened properly for some reason. The template should be set up to just let you switch to the visionOS platform, and build. The SDK should also be set to the simulator in the template project.

I just tested the entire flow using the same versions as above; I unofrtunately can’t reproduce this. Upon building, the architecture in the xcode project is already set to arm64, and the simulator is set as the default build target. I can just Build & Run in Xcode. But as I mentioned earlier it sounds like the project may not have imported properly. Are there any errors on import (ignore the error about “PolySpatialSettings initialized but already exists”), or on build?

The crash here is expected – the simulator and the device builds use different code paths, as Apple’s simulator isn’t an exact replica of the device especially on the graphics side. (Among other things, the simulator has more macOS-like Metal characteristics vs. the device.) The Unity device/simulator SDK switch selects which Unity code is linked in. This isn’t ideal, and we’ll hopefully address before long, but it’s the same behaviour as with iOS today.

I have also encountered such problems before, and ultimately found out that it was caused by using the Intel version of Unity. After using the Apple version of Unity, this problem did not occur again.

Thank you so much!
Although Intel version can work for 0.3.3, only Silicon version can work for 0.7.1.
And I need to upgrade unity hub in order to download 2022.3.15 Silicon Version

Ah ha! Nice catch. This is a little unexpected, but we strongly suggest that you use the Apple Silicon native editor on Apple Silicon hardware anyway.