Create a Mac app built with Mac Catalyst

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.

Create a Mac version

  1. In the project editor, choose the iOS target, click General, then reveal the Deployment Info settings.

  2. Under the Devices column, select both the iPad and Mac checkboxes.

    If your app is iPhone only, the Mac checkbox is disabled.

  3. In the sheet that appears, read the alert dialog, then click Enable.

Set a different bundle ID for the Mac app

  1. On the Signing & Capabilities pane under macOS, unselect the Use iOS Bundle Identifier checkbox.

  2. 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:

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.