Difference between revisions of "Mac Catalyst"

From Free Pascal wiki
Jump to navigationJump to search
m (→‎External links: New category Mac Catalyst)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
With macOS 10.15 Apple introduced a new feature of building and running iPad applications on macOS.
+
{{Platform only|macOS}}
 +
{{Platform only|iPadOS}}
 +
 
 +
With macOS 10.15 Apple introduced a new feature for building and running iPad applications on macOS.
 
The feature is named Mac Catalyst.
 
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.
+
Apple specifically noted that the apps designed for iPad can be run on Mac computers. Exclusive iPhone apps cannot be run on macOS.
  
 
==System Support==
 
==System Support==
Mac Catalyst is available on macOS 10.15 Cataline and later (?). It's not available on the prior macOS 10.14.
+
Mac Catalyst is available on macOS 10.15 Catalina and later (?). It's not available on the prior macOS 10.14.
  
 
One might find "iOSSupport" system libraries at
 
One might find "iOSSupport" system libraries at
Line 14: Line 17:
 
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/iOSSupport
 
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/iOSSupport
  
==FreePascal Compiler Support==
+
===Limitations===
 +
* According to Apple, only a very small subset of AppKit can be used for Mac Catalyst apps. They must also be isolated into Mac Catalyst specific code (as no AppKit is available on iOS).
 +
* iPadOS is a version of iOS 13 that's designed to run on Apple's iPads. According to Apple, iPadOS is built on the same foundation as iOS, but with new capabilities created for the larger display of the iPad.
 +
 
 +
==Free Pascal Compiler Support==
 
A new OS target is necessary for the compiler.
 
A new OS target is necessary for the compiler.
 
The changes for the target are as following:
 
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.
+
* during assembly the Mac Catalyst 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
 
  Load command 8
 
       cmd LC_BUILD_VERSION
 
       cmd LC_BUILD_VERSION
Line 29: Line 36:
 
:During linking the linker verifies that the platform of the object file generated by FPC matches system linking files.  
 
: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.
 
:as of today FPC supports 3 platforms: macOS, iOS and iPhoneSimulator. For Mac Catalyst the additional platform is needed.
 +
 
===Ld===
 
===Ld===
 
* "-platform_version" can be used to specify the resulting platform binary version
 
* "-platform_version" can be used to specify the resulting platform binary version
* It seems like specifying "macosx_version_min" switches ld down to linking for macOS platform.
+
* It seems like specifying "macosx_version_min" switches ld down to linking for the macOS platform.
  
 
==Building Apps==
 
==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.  
+
While Mac Catalyst is designed to provide an ability to rebuild iPad apps for macOS in the first place, it is also possible to build a standalone 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.
+
However, such an application might likely act as a proof-of-concept or a demo app, and might not be accepted for distribution in the App store.
  
 +
==External links==
 +
* [https://developer.apple.com/mac-catalyst/ Apple: Mac Catalyst]
 +
* [https://developer.apple.com/ipad/ Apple: iPadOS]
 +
* [https://developer.apple.com/ios/ Apple: iOS]
  
 
[[Category:macOS]]
 
[[Category:macOS]]
 +
[[Category:iOS]]
 +
[[Category:iPadOS]]
 +
[[Category:Mac Catalyst]]

Latest revision as of 04:47, 15 June 2020

macOSlogo.png

This article applies to macOS only.

See also: Multiplatform Programming Guide

Apple iPadOS.png

This article applies to iPadOS only.

See also: Multiplatform Programming Guide

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

Apple specifically noted that the apps designed for iPad can be run on Mac computers. Exclusive iPhone apps cannot be run on macOS.

System Support

Mac Catalyst is available on macOS 10.15 Catalina 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

Limitations

  • According to Apple, only a very small subset of AppKit can be used for Mac Catalyst apps. They must also be isolated into Mac Catalyst specific code (as no AppKit is available on iOS).
  • iPadOS is a version of iOS 13 that's designed to run on Apple's iPads. According to Apple, iPadOS is built on the same foundation as iOS, but with new capabilities created for the larger display of the iPad.

Free Pascal Compiler Support

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

  • during assembly the Mac Catalyst 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.

Ld

  • "-platform_version" can be used to specify the resulting platform binary version
  • It seems like specifying "macosx_version_min" switches ld down to linking for the macOS platform.

Building Apps

While Mac Catalyst is designed to provide an ability to rebuild iPad apps for macOS in the first place, it is also possible to build a standalone UIKit app for macOS exclusively.

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

External links