Skip to content

Conversation

@tiagoappereira
Copy link

Xcode 14 considers that iOS apps should support by default not only iPhone and iPad, but also Mac (with Apple Silicon processors). With the introduction of “Designed for iPad“, IPAs can be installed on these devices, and Apple wants to make this the default behaviour/experience.

Also, when apps with the Mac target are submitted to the App Store they are available for Mac by default as well. They can be found in a specific “iPhone & iPad Apps“ tab.

Therefore, with the suggested preference in this PR, developers can disable the aforementioned default behaviour.

Description

To disable Mac target, the following lines need to be added to the .pbxproj:

SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;

The Mac support removal (or not) is controlled by a preference called SupportMac:

SupportMac Mac target
N/A enabled
true enabled
false disabled

Testing

Created a local iOS Cordova project based on this cordova-ios branch and the .pbxproj was:

  • NOT updated when the preference SupportMac is not set
  • NOT updated when the preference SupportMac is set with the value true
  • updated when the preference SupportMac is set with the value false

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@breautek breautek added this to the 7.0.0 milestone Dec 5, 2022
@dpogue
Copy link
Member

dpogue commented Dec 6, 2022

We have an existing target-device preference that supports handset, tablet, and universal as values, and sets the TARGETED_DEVICE_FAMILY.

Maybe we can find a way to add this functionality to that existing preference?

@tiagoappereira
Copy link
Author

We have an existing target-device preference that supports handset, tablet, and universal as values, and sets the TARGETED_DEVICE_FAMILY.

Maybe we can find a way to add this functionality to that existing preference?

If the idea is to expand the target-device supported values, doing so would change what the preference represents. From the official documentation

This property maps directly to TARGETED_DEVICE_FAMILY in the xcode project.

which would no longer be true.

@dpogue
Copy link
Member

dpogue commented Dec 6, 2022

The documentation can be updated to reflect what the preference actually does, so I wouldn't worry too much about that aspect.

I don't have strong feelings about it, but I do wonder if it's easier or more consistent to have a single preference that controls the output platforms (similar to the 3 checkboxes in Xcode) vs a combination of multiple preferences that might interact in unusual ways.

@dpogue
Copy link
Member

dpogue commented Jun 6, 2023

My current thinking around this is to disable the iPad-on-macOS thing by default, and to allow explicitly building a macOS app from the same codebase targeting Catalyst. That means there would be an extra step for those who want to distribute a macOS app, but it should be a better result (in terms of user experience and platform fit) than the iPad-on-macOS option.

@dpogue dpogue modified the milestones: 7.0.0, 7.1.0 Jun 6, 2023
@dpogue dpogue modified the milestones: 7.1.0, 7.1.1 May 28, 2024
@dpogue dpogue modified the milestones: 7.1.1, 8.0.0 Aug 15, 2024
@dpogue dpogue mentioned this pull request Aug 29, 2024
3 tasks
@dpogue dpogue closed this in #1313 Aug 30, 2024
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.

3 participants