Build setting variant for Designed for iPad

We're building one of our iPad apps for "Apple Vision Pro (Designed for iPad)" simulator and need to have certain different build settings for that simulator variant, compared to the default iOS simulator variant.

It seems both variants use the iphonesimulator SDK. And in the Xcode build settings, the "Any iOS Simulator SDK" variant of any setting is what is also used, even when building for "Apple Vision Pro (Designed for iPad)".

We tried adding a variant to the "Any iOS Simulator SDK" variant for one of the settings by editing the project file directly, using some possible variants we could think of. The added variant does show in the Xcode UI but it shows as "Any iOS Simulator SDK" also. But when building for "Apple Vision Pro (Designed for iPad)" Xcode still uses the original variant, as if it doesn't see that the added variant is matching the build destination.

Example, where we want to exclude arm64 for iOS simulator builds, but not for "Apple Vision Pro (Designed for iPad)" builds.

Original "Any iOS Simulator SDK" variant: "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64";

Added variant: "EXCLUDED_ARCHS[sdk=iphonesimulator*][variant=Apple Vision Pro]" = "";

We have tried using variant names such as 'xr', 'xors', 'vision', 'visionos' and of course 'Apple Vision Pro' to no avail. The variant shows in the UI but the build doesn't use it.

Does anyone know if there is a variant (or other property or other way of distinguishing such variant) that we can use that Xcode will recognize and use when building for "Apple Vision Pro (Designed for iPad)"?

Thanks.

We also tried using: "EXCLUDED_ARCHS[sdk=iphonesimulator*][arch=arm64]" = "" but it still doesn't get used. The default setting gets used instead.

This is making use what is already available to use for user-defined settings. For those, the Xcode UI lets you choose both an SDK and an architecture. But interestingly enough, after testing with a user-defined setting, we found that even then the build doesn't use the correct setting.

To test this we added:

TEST_SETTING = TEST;
"TEST_SETTING[sdk=xrsimulator*]" = "visionOS Sim - Native visionOS app";
"TEST_SETTING[sdk=iphonesimulator*][arch=arm64]" = "visionOS Sim - Designed for iPad";
"TEST_SETTING[sdk=iphonesimulator*][arch=x86_64]" = "iOS Sim - Native iPad";

These can be added manually or via the UI and they do show as separate entries:

We also added TestSetting = $(TEST_SETTING) in Info.plist.

And log the value: NSLog(@"TEST_SETTING: %@", [[NSBundle mainBundle] objectForInfoDictionaryKey:@"TestSetting"]);

Results:

  • Running Apple Vision Pro (simulator): visionOS Sim - Native visionOS app ✅
  • Running Apple Vision Pro (Designed for iPad): TEST ❌
  • Running iPad simulator: TEST ❌

So it's clear that there's a bug here. For the destinations that are architecture specific, the default setting is used instead.

Created FB13351268

Build setting variant for Designed for iPad
 
 
Q