Skip to content

Feature/ios simulator - #442

Merged
doranteseduardo merged 5 commits into
developfrom
feature/ios-simulator
Nov 4, 2026
Merged

doranteseduardo merged 5 commits into
developfrom
feature/ios-simulator

Conversation

@PetkoKuzmanov

Copy link
Copy Markdown
Contributor

Build ViroKit for the iOS Simulator

ViroKit only built for devices, so any app using Viro failed to link for the iOS Simulator. This adds a simulator build (arm64 and x86_64) and stages ViroKit into viro as ViroKit.xcframework, with a device slice and a simulator slice.

Changes

Simulator libraries. ViroKit links three libraries that had no arm64 simulator build:

  • LinearMath (Bullet 2.87) and protobuf-lite 3.2.0: ios/build_ios_simulator_libs.sh builds them from source and adds the arm64 slices to the existing x86_64 archives. protobuf is built with -Dgoogle=google_public, the namespace ViroKit links against.
  • GVR Audio: it's closed source, so ios/retag_for_simulator.py relabels its arm64 device objects as iOS Simulator objects, in Libraries/GVRAudioSDK/simulator. The relabelled objects have the same code, relocations, symbols and data as the device build; only the platform label differs.

Search paths. The simulator finds that GVR build first. The device libreactvisioncca.a is no longer on the search path used by every SDK, where the simulator link found it before its own build.

Staging. "Lipo Framework and Copy to Bridge" now builds viro/ios/dist/ViroRenderer/ViroKit.xcframework:

  • It replaces only the slice of the platform it just built, so device and simulator builds can run in either order.
  • It skips a simulator build that lacks arm64 or x86_64. An app's Release simulator build asks for both, and CocoaPods refuses a slice missing either.
  • It runs after [CP] Copy Pods Resources, so the ARCore resource bundles are in every staged copy.
  • It takes the framework's Info.plist as an input. On a build from clean, it used to copy the framework before the plist existed.
  • The Jenkins phase makes its universal framework only when the two builds share no architecture.

ViroKit.podspec vendors the xcframework.

Testing

  • Device and simulator Release builds of ViroKit, both from clean. Both slices are staged complete, each with its own Info.plist.
  • The device slice's exported symbols match the committed ViroKit.framework. Apart from the GVR Audio library, the only difference between the device and simulator builds is ARCore's Core ML executor, which ARCore's own simulator build lacks.
  • StudioGo (Release) links and runs in the iOS 27 simulator on the resulting xcframework, and its device build links.
  • Not done: launching the device build on a phone.

Notes

  • Arm64 simulator slices for Bullet Collision, Dynamics and SoftBody, freetype and reactvisioncca were already in ios/Libraries.
  • The matching viro PR carries the rebuilt binaries.

PetkoKuzmanov and others added 5 commits November 3, 2026 11:50
ViroKit links three libraries that had no arm64 simulator slice.
ios/build_ios_simulator_libs.sh builds LinearMath (Bullet 2.87) and
protobuf-lite 3.2.0 from source (protobuf with -Dgoogle=google_public, the
namespace the device build uses) and adds the slices to the existing
x86_64 archives. GVR Audio is closed source, so retag_for_simulator.py
relabels its arm64 device objects as iOS Simulator objects into
Libraries/GVRAudioSDK/simulator; the code is the same on both.

The simulator search paths find that GVR build first, and the device
libreactvisioncca.a is no longer on the unconditional search path, where
the simulator link found it before its own slice.
The "Lipo Framework and Copy to Bridge" phase now builds
viro/ios/dist/ViroRenderer/ViroKit.xcframework, replacing only the slice
of the platform it built and keeping the other, so device and simulator
builds can run in either order. It skips a simulator build lacking arm64
or x86_64, since an app's Release simulator build asks for both and
CocoaPods refuses a slice missing either.

The phase runs after [CP] Copy Pods Resources, so the ARCore resource
bundles are in every staged copy, and takes the framework's Info.plist as
an input: a clean build otherwise staged the framework before its plist
existed. The Jenkins phase lipos only when the two builds share no
architecture, and ViroKit.podspec vendors the xcframework.
@doranteseduardo
doranteseduardo merged commit 50398ea into develop Nov 4, 2026
4 checks passed
@doranteseduardo
doranteseduardo deleted the feature/ios-simulator branch November 4, 2026 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants