Skip to content

Conversation

@macCesar
Copy link
Contributor

@macCesar macCesar commented Feb 7, 2026

Summary

This PR fixes iOS module builds when manifest includes mac: true for Mac Catalyst support.

It addresses 3 required areas:

  1. Ensure TitaniumKit.xcframework Mac Catalyst slice keeps expected framework symlinks.
  2. Ensure new module templates include Catalyst-compatible Xcode build settings.
  3. Ensure legacy modules are auto-patched at build time when mac: true is set.

Changes

1) TitaniumKit packaging

  • support/iphone/build_titaniumkit.sh
  • After xcodebuild -create-xcframework, restore symlinks in:
    • ios-arm64_x86_64-maccatalyst/<Framework>.framework

2) Module templates

  • iphone/templates/module/objc/template/ios/{{ModuleName}}.xcodeproj/project.pbxproj.ejs
  • iphone/templates/module/swift/template/ios/{{ModuleName}}.xcodeproj/project.pbxproj.ejs

Added in iOS build configurations:

  • SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"
  • SUPPORTS_MACCATALYST = YES

3) Build-time auto-fix for existing modules

  • iphone/cli/commands/_buildModule.js
  • Added ensureMacCatalystBuildSettings():
    • Runs only when manifest.mac === 'true'
    • Patches project.pbxproj with:
      • SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"
      • SUPPORTS_MACCATALYST = YES

Also improved module build diagnostics and SDK consistency:

  • Logs ti command exit code and full command.
  • Propagates --sdk <version> to staged temp app create/build when provided.

Validation

Validated locally by building SDK and module with this branch:

  • npm run cleanbuild -- ios
  • ti build -p ios --build-only --sdk 13.2.0 on a module with mac: true

Result:

  • Module build succeeds.
  • Generated xcframework includes iOS device, iOS simulator, and Mac Catalyst slices.

@cb1kenobi
Copy link
Contributor

This is awesome! The code looks good, but I would want it to be tested. I'm not quite able to test it yet.

@m1ga
Copy link
Contributor

m1ga commented Feb 9, 2026

when I create a new module with the PR SDK, keep everything as it is and then run the build commandwill fail with

[TRACE] [xcode-macos] /Users/miga/Library/Application Support/Titanium/mobilesdk/osx/13.2.0.v20260207034456/iphone/include/TiModule.h:1:9: error: 'TitaniumKit/TiModule.h' file not found (in target 'test_mac' from project 'test_mac')
[TRACE] [xcode-macos]     /Users/miga/test_mac/ios/Classes/TestMacModule.m:8:9: note: in file included from /Users/miga/test_mac/ios/Classes/TestMacModule.m:8:
[TRACE] [xcode-macos]     /Users/miga/test_mac/ios/Classes/TestMacModule.h:8:9: note: in file included from /Users/miga/test_mac/ios/Classes/TestMacModule.h:8:
[TRACE] [xcode-macos]     note: Did not find header 'TiModule.h' in framework 'TitaniumKit' (loaded from '/Users/miga/Library/Developer/Xcode/DerivedData/test_mac-drmjdjycerxklleagbrwkxzhjxks/Build/Intermediates.noindex/ArchiveIntermediates/test_mac/BuildProductsPath/Release-maccatalyst')

setting mac: false in the manifest will build the module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants