Docs Menu

Build using Mac Catalyst

On this page

  • Overview
  • Procedure
  • Update Your Build Phase Settings
  • Update Your Podfile
  • Activate and Test Catalyst in Your Project

This page details steps required for building your MongoDB Realm application when using Mac Catalyst with React Native version 0.64 and below.

Note

Version 10.6.0 and above of the MongoDB Realm React Native SDK supports Mac Catalyst.

Important

Version 0.65 and above of React Native do not require these additional steps to build using Mac Catalyst.

Tip
See also:
1

Before you can use Mac Catalyst in your React Native application, you must specify the platform name. Click Build Phases in XCode, and within the Bundle React Native code and images tab, add the following to specify "ios" as the platform name.

export PLATFORM_NAME=ios
2
Note

This is a temporary step that will not be necessary when the following Cocoapods issue is solved: [Catalyst] Podspec Resource Bundle requires a development team

Currently, there is a Cocoapods bug that causes XCode to require a development team when building for Mac Catalyst. This bug prevents signing locally. As a workaround, you can alter your Podfile to fix your bundle target's signing certificate to sign to run locally.

Replace the post-install script in your Podfile by removing the following lines:

post_install do |installer|
react_native_post_install(installer)
end

And copy the following lines where your previous post-install script was:

post_install do |installer|
react_native_post_install(installer)
installer.pods_project.targets.each do |target|
# Fix bundle targets' 'Signing Certificate' to 'Sign to Run Locally'
if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
target.build_configurations.each do |config|
config.build_settings['CODE_SIGN_IDENTITY[sdk=macosx*]'] = '-'
end
end
end
end
3

To test out Catalyst in your project, activate Mac in the general tab of your XCode project workspace. To do this, click Mac in the Deployment Info section. Select "Scale Interface to Match iPad". This makes "My Mac" selectable, allowing you to run your application on your Mac.

Activate your Mac in Xcode Project Workspace
Give Feedback
© 2021 MongoDB, Inc.

About

  • Careers
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2021 MongoDB, Inc.