[TIMOB-27791] Decide CLI commands to build and archive app for macOS target
GitHub Issue | n/a |
---|---|
Type | Story |
Priority | None |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2020-09-16T13:03:45.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 9.2.0 |
Components | n/a |
Labels | n/a |
Reporter | Vijay Singh |
Assignee | Christopher Williams |
Created | 2020-03-05T21:48:27.000+0000 |
Updated | 2020-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
File | Date | Size |
---|---|---|
Native-ios-mac-enabled.png | 2020-03-05T21:52:50.000+0000 | 71577 |
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
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
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>/
.*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.
After some thought, it should be
"macos"
, not"mac"
.@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.
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.
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.
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
https://github.com/appcelerator/titanium_mobile/pull/11955
*Closing ticket*. Fix verified in SDK version
9.2.0.v20200915123928
, and9.3.0.v20200915132757
. *Test and other information can be found at:* https://github.com/appcelerator/titanium_mobile/pull/11955