Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27791] Decide CLI commands to build and archive app for macOS target

GitHub Issuen/a
TypeStory
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2020-09-16T13:03:45.000+0000
Affected Version/sn/a
Fix Version/sRelease 9.2.0
Componentsn/a
Labelsn/a
ReporterVijay Singh
AssigneeChristopher Williams
Created2020-03-05T21:48:27.000+0000
Updated2020-09-16T13:03:45.000+0000

Description

In [PR #11506](https://github.com/appcelerator/titanium_mobile/pull/11506) (WIP) we have started to supporting macOS target. Current commands to create and run app for Mac target are as below - 1. Create an app using this SDK-> appc new -p ios 2. Set property 'enable-mac-target' to 'true' in tiapp.xml < property name="enable-mac-target" type="bool">true < /property > 3. To run on Mac-> appc run -p iOS -T 'mac' 4. It should launch Mac app Is there any modifications required?

Attachments

FileDateSize
Native-ios-mac-enabled.png2020-03-05T21:52:50.000+000071577

Comments

  1. Vijay Singh 2020-03-05

    Feedback from Hans in PR - * In general: I'd vote for macos instead of mac in all terrms. Mac is the hardware, macOS the software. * Make macOS an own target (inside tiapp.xml), using macos * Make macOS an own command, e.g. ti build -p macos instead of an ti build -p ios subcommand * How are macOS assets planned to be handled? Especially launch images and app icon are quite essential. Do they just reuse the iOS one?
  2. Vijay Singh 2020-03-05

    1. The way we are supporting Mac target is, via maccatalyst which is available in ios ecosystem. So I think platform should be ‘iOS’. See the attached screenshot 'Native-is-mac-enable.png' (section Deployment Info) of native app. Instead of using 'enable-mac-target' in tiapp.xml we can use true similar to true . Or 'enable-mac-target' in tiapp.xml is fine? [~hknoechel] Are you talking about this? 2. Assets handling - We can provide Mac specific app icons. By default it will use iOS one. Launch images are not used in Mac apps. 3. Do we want to make macos as own command or use it as subcommand - E.g to debug on Mac - "appc run -p iOS -T mac" and to archive for Mac-apstore something like - "app run -p iOS -T dist-mac-apstore" 4. How to ensure if module should be build for 'mac' as well? Probably to add some key in 'timodule.xml' or any other way? [~cbarber] [~cwilliams] What is suggestion here?
  3. Chris Barber 2020-03-05

    I don't get why we need a <enable-mac-target> or a <target device="mac">true</target> setting. Just have a \-\-target of "mac" (or "macos"). Having an explicit --target of "mac" with the appropriate validation should be sufficient. We don't want to add unnecessary barriers like these one-off settings. Furthermore, <target> is a Studio thing and should be deprecated. If you add a \-T mac, then it makes sense to also add a \-T dist-mac-appstore. Note that "dist-*" targets have a deploy type of "production". In theory a module would be built for x64 in addition to whatever other architectures they are compiled for. If you think there are modules that are mac specific, then maybe we take a step back and consider adding "mac" as a platform, not a target. Then the "mac" platform would have some sort of default target (I dunno, "desktop" or something) and a "dist-appstore" target. "mac" modules would go in ~/Library/Application Support/Titanium/mobilesdk/modules/mac/<name>/<version>/.
  4. Joshua Quick 2020-03-05

    *Side Question:* Perhaps the platform should be called "ipados"? This is because you're building an app based on the iPadOS platform which can run on macOS and iPad. (I'm guessing you don't have access to macOS APIs; only iPadOS APIs.) Kind of like how on Windows where you can build an app via the Win32 or UWP platforms. They're 2 totally separate platforms with different APIs/capabilities, but both can run on the Windows desktop.
  5. Chris Barber 2020-03-06

    After some thought, it should be "macos", not "mac".
  6. Hans Knöchel 2020-03-06

    @Chris: Agree on all points @Josh: iPadOS is literally a marketing name. The foundation is iOS and the macOS target is (technically) called "Catalyst" or "UIKit for Mac". So I think macOS is a proper target name here and everyone sees the benefits of it. "Classic" macOS aka AppKit will transition more and more to Catalyst as Apple pushes very hard in that direction.
  7. Joshua Quick 2020-03-06

    I'm just saying there is a difference and we need to make it clear to developers which of the 2 they're getting. (If not iPadOS, then something else.) As a comparison on the Windows side, you would want to make the distinction. A Win32 app and a UWP app are very different. They result in different app binaries, have different APIs available to them, one is backward compatible on older OSes, etc. Microsoft re-documented Win32 apps as "classic" too, but no one cared, UWP never caught on (except with Xbox games), and Win32 apps are still the dominant style. UWP has less capabilities compared to Win32 and too much time was invested in existing Win32 apps to compel devs to transition them over. The same potential issue can happen on Mac and both app styles might have to coexist in parallel for the foreseeable future like how it is on Windows. Anyways, that's my 2 cents.
  8. Joshua Quick 2020-03-06

    Hold on, I was confused. I thought we were making a new platform. But this is just a new target for "iOS". Oh never mind.
  9. Vijay Singh 2020-03-06

    So for Mac dev - --target macos And for Mac distribution --target dist-macappstore Is there any difference in -T and --target ? For module - To build any module, we have to build for - iOS simulator iOS device maccatalyst And then we have to create a .xcframework to use it in app. Now the problem is maccatalyst is supported in macOS 10.15+(Catalina+). If someone is running on macOS < 10.15 it will fail. I think we should ignore to build for maccatalyst just giving warning, if it is building for macOS < 10.15
  10. Christopher Williams 2020-09-03

    https://github.com/appcelerator/titanium_mobile/pull/11955
  11. Samir Mohammed 2020-09-16

    *Closing ticket*. Fix verified in SDK version 9.2.0.v20200915123928, and 9.3.0.v20200915132757. *Test and other information can be found at:* https://github.com/appcelerator/titanium_mobile/pull/11955

JSON Source