Mac Catalyst

From Free Pascal wiki
Revision as of 06:42, 28 May 2020 by Skalogryz (talk | contribs) (Created page with "With macOS 10.15 Apple introduced a new feature of building and running iPad applications on macOS. The feature is named Mac Catalyst. Apple specifically noted that the apps...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

With macOS 10.15 Apple introduced a new feature of building and running iPad applications on macOS. The feature is named Mac Catalyst.

Apple specifically noted that the apps designed for iPad can be ran on mac. Exclusive iPhone apps cannot be ran on macOS.

System Support

Mac Catalyst is available on macOS 10.15 Cataline and later (?). It's not available on the prior macOS 10.14.

One might find "iOSSupport" system libraries at

/System/iOSSupport/System/Library/Frameworks

These are run-time frameworks built to support Mac Catalyst.

MacOSX SDKs files already include the necessary iOSSupport reference (.tbd) files.

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/iOSSupport

FreePascal Compiler Support

A new OS target is necessary for the compiler. The changes for the target are as following:

  • during assembly MacCatalyst platform needs to be specified. An assembler creates an object file with load commands in them. The command provides the information for the linker about the platform of the object file.
Load command 8
      cmd LC_BUILD_VERSION
  cmdsize 32
 platform macCatalyst.  (platform 6)
      sdk 13.4
    minos 13.4
   ntools 1
     tool ld
  version 556.4
During linking the linker verifies that the platform of the object file generated by FPC matches system linking files.
as of today FPC supports 3 platforms: macOS, iOS and iPhoneSimulator. For Mac Catalyst the additional platform is needed.

Building Apps

While Mac Catalyst is designed to provide an ability of rebuilding iPad apps for macOS in the first place, it possible to build a stand-alone UIKit app for macOS exclusively.

However, such application might likely to act as a proof-of-concept or a demo app. And might not be accepted for the distribution to the App store.