You can use Mac Catalyst to build a Mac version of an iPad app—that is, a version of your app that uses UIKit but runs on macOS.
Xcode configures the Mac app to use the same bundle ID as the iOS app so you can later create a universal purchase that allows customers to purchase the apps together from the App Store. If you don’t want to distribute the apps together, you can set a different bundle ID for the Mac app.
In the project editor, choose the iOS target, click General, then reveal the Deployment Info settings.
Under the Devices column, select both the iPad and Mac checkboxes.
If your app is iPhone only, the Mac checkbox is disabled.
In the sheet that appears, read the alert dialog, then click Enable.
On the Signing & Capabilities pane under macOS, unselect the Use iOS Bundle Identifier checkbox.
In the text field that appears below, enter the bundle ID for the Mac app.
Xcode makes the following changes for the Mac app and its dependencies:
Adds a My Mac destination to the scheme menu.
To build and run the Mac version, choose My Mac as the run destination.
Important: Building the Mac version of an iPad app requires macOS 10.15 or later.
Excludes linked or embedded content that is not compatible with Mac.
Xcode configures your app extensions, frameworks, and libraries which are not compatible with Mac to be excluded when your app builds for Mac. You can change this configuration by choosing the platform for the framework or library in the project editor.
Adds the App Sandbox and Hardened Runtime capabilities, configured based on the usage description keys (property list keys that end with UsageDescription
) that appear in the information property list.
In addition, you may need to make changes to your source code for macOS, such as conditionally excluding imports of frameworks or APIs that are not available for a Mac version of an iPad app. For example, enclose the code that doesn’t compile using the macCatalyst
environment:
#if !targetEnvironment(macCatalyst)
// Code to exclude from Mac.
#endif
For additional steps, go to Creating a Mac Version of Your iPad App.