Microsoft Teams is your hub for teamwork, which brings together everything a team needs: chat and threaded conversations, meetings & video conferencing, calling, content collaboration with the power of Microsoft 365 applications, and the ability to create and integrate apps and workflows that your business relies on. A Corona-built macOS desktop app consists of a.app bundle which contains the Corona runtime engine and your Corona project's compiled code and assets.
This guide outlines the features of Solar2D that are specific to macOS desktop apps. A Corona-built macOS desktop app consists of a .app
bundle which contains the Corona runtime engine and your Corona project's compiled code and assets.
System Requirements
- macOS 10.11 or later
- Mac which supports OpenGL 2.1 or higher
All features supported by the Corona Simulator for macOS are supported for macOS desktop builds.
Building Great macOS Apps
Many developers will start with an iOS app, intending to duplicate it on the Mac platform. First and foremost, avoid the tempting assumption that all you need to do is choose File → Build → macOS. from the Corona Simulator menu to create a macOS app from an iOS app. The desktop and device platforms are quite different, and while Corona hides many of the practical implementation details, it can't magically turn an app designed for a touch screen device into a great mouse-based desktop experience.
Keep in mind that your macOS app will undergo the Apple review process before being accepted into the Mac App Store. This will cover the same type of issues as iOS app reviews, but there is an additional bar which must be cleared since macOS apps may be rejected on this point:
Among other things, you should consider how your app reacts to window size changes and how it works in full screen mode. The size of the content area is much more variable on the desktop than it is on devices and you will almost certainly need to make changes to your app so that it works well in the desktop environment. Remember that you can adjust both the window size and the content area and that they don't necessarily need to be the same. Also remember that landscape orientation is what users will expect, so it will be more difficult to make a good impression with a portrait-oriented app in the desktop environment.
Papi commando reload megadrive/genesis ! tectoy version ! mac os. Obviously, anything you can download from the Mac App Store has passed the review process, so be sure to download other apps in the same genre as yours, see how they work on the desktop, and consider how you can modify yours to work similarly.
Window Settings
For both macOS desktop apps and Win32 desktop apps, Corona's build.settings
file supports a window
Cave escape 3d mac os. table for customizing the app's desktop window, including the default width/height, the title of the window, and more.
Within the window
table, the following settings are supported:
defaultMode
Sets how the window should be launched on startup. Supported values include 'normal'
, 'minimized'
, 'maximized'
, or 'fullscreen'
. Default is 'normal'
. This can also be set programmatically via the native.setProperty() API. https://staglnqidepositcasino-myfreenored.peatix.com.
defaultViewWidth
Sets the default launch width of the view/client area of the window. This is the region within the borders of the window to which Corona renders. Ideally, this should match or exceed your config.lua
content area width.
defaultViewHeight
Sets the default launch height of the view/client area of the window. This is the region within the borders of the window to which Corona renders. Ideally, this should match or exceed your config.lua
content area height.
resizable
Set this to true
to allow the end user to resize the window (the window is not resizable by default). Note that if true
, you may need to handle Corona's resize event to re-layout your content.
minViewWidth
This setting only applies if resizable
is set to true
. Prevents the user from resizing the window to a width smaller than this value. Note that this represents the width of the region within the borders of the window. If resizable
is set to true
and this setting is not specified, the window can be resized down to whatever width the OS allows.
minViewHeight
This setting only applies if resizable
is set to true
. Prevents the user from resizing the window to a height smaller than this value. Note that this represents the height of the region within the borders of the window. If resizable
is set to true
and this setting is not specified, the window can be resized down to whatever height the OS allows.
enableCloseButton
Enables or disables the window's 'close' button (enabled by default). If disabled, you must close the window in Lua via native.requestExit(). Note that Corona does not currently trigger an event when the 'close' button is clicked.
enableMinimizeButton
Enables or disables the window's 'minimize' button (enabled by default).
enableMaximizeButton
Enables or disables the window's 'maximize' button (disabled by default). Note that the window will be resized when maximized/restored, so if this setting is true
, you may need to handle Corona's resize event to re-layout your content.
suspendWhenMinimized
Tells the runtime to suspend when the window is minimized (disabled by default).
showWindowTitle
Causes the window's title bar to be shown (by default) or hidden making the app's content fill the entire window. Dragging at the top of the window will move it as with a regular window and clicks in this area do not go to the app. This setting is supported on macOS only.
titleText
Sets the window's title bar text to the specified string (no title bar text by default). Supports 2-letterISO 639‐1language codes and optional 2-letterISO 3166‐1country codes (neither is case sensitive). The default
title text can also be set programmatically via the native.setProperty() API.
Excluding Files
You can exclude file(s) that aren't needed for an macOS desktop app via the build.settings
file's excludeFiles
pattern matching feature. Please see the Excluding Files section of the Project Build Settings guide for more details on pattern matching.
Including Resources
Sometimes it's necessary to include certain files in your application to support specific macOS features. One example of this is localization which is achieved at the OS level (for example the Finder's label for an app) using .lproj
directories in the application's Resource
directory (background) page. Note that this mechanism to include arbitrary resources in your app is only intended to enable the knowledge to complete certain tasks and is not intended to automate anything.
To include arbitrary files in your app's Resource
directory add a bundleResourcesDirectory
entry to your project's build.settings
for macOS builds. For example:
Macbook pro backup solutions. Then, in the project, the contents of the osx-resources
directory might look like this:
This results in the fr.lproj
directory ending up in MyApp.app/Content/Resources/fr.lproj
.
You will probably want to add the directory you use as bundleResourcesDirectory
to your excluded files.
Custom URL Schemes
To enable a custom URL scheme in your macOS app, you'll need to set it up in the app's Info.plist
by including a section like this in build.settings
:
This will allow the app to receive a message from (or be started by) a Terminal command such as:
To handle the message in your Corona app, implement a handler like this:
Custom Document Types
Similarly to how custom URL schemes work you can set up document types that you app recognizes and which can be opened by dragging them to the app's icon in the Finder or the Dock.
To enable custom document types in your macOS app, you'll need to set it up in the app's Info.plist
by including a section like this in build.settings
:
In your Corona app, implement a handler like this:
This code will called when files with the configured types are dropped on your app's icon in the Finder or the Dock. More information is available in Apple's developer Core Foundation Keys documentation.
Entitlements
If you need custom entitlements in your macOS app, specify them in build.settings
. For example, you might need to specify the com.apple.security.personal-information.location
entitlement if you use Corona's location features.
Copyright
To customize the copyright message in the About box of your app, you can add the following to build.settings
:
App Icon
You should add a Icon-osx.icns
file to your Corona project's root directory to provide an icon for your application on macOS This should be an .icns
file which contains multiple versions of your icon at different resolutions (details). This Icon-osx.icns
file will be used to set the icon for the following:
- The icon that your
.app
bundle uses, as viewed in the Finder. - The icon used by your app in the Dock.
Corona Out Mac Os 11
You can find apps in the Mac App Store to help with the creation of .icns
Pizza running mac os. files.
Building / Running
To build and run your macOS desktop app, follow these steps:
Open the Corona Simulator.
Open and run a Corona project.
Select the File → Build → macOS. menu item to reveal the macOS build dialog.
The Application Name, Version, and Save to Folder fields are all required. Here are notes regarding these build dialog fields: https://jacksonfree.mystrikingly.com/blog/switcheroo-mac-os.
Application Name — The application name you've entered can be fetched at runtime via Corona's
system.getInfo( 'appName' )
call (reference).Version — The version string you've entered can be fetched at runtime via Corona's
system.getInfo( 'appVersionString' )
call (reference).Provisioning Profile — The provisioning profile for the app; see App Signing below.
Save to Folder — The directory in which to save the built project.
After Build — select which action should be performed after the app is successfully built.
Click the Build button to build your application to the given Save to Folder location. If you chose Send to Mac App Store., a panel will open which allows you to select the tab for the preferred option and follow the prompts to complete your build.
Debugging
The Corona Simulator does not currently support direct simulation of an app running in macOS desktop mode, although the Simulator running a 'Custom Device' skin is almost the same.
Note that when running a built macOS Corona app or the Corona Shell, all print()
output and Lua errors/warnings will be streamed to stdout
. There are various ways to manage this output. One way is to run the executable embedded in the app bundle in a Terminal window which will make the debug output visible. For example:
In this example, the backslashes () protect the spaces in the filename (you could alternatively use quotes).
You can also use the Console app in the Applications → Utilities folder to view application output.
If you run the app by choosing the After Build → Open application option in the Corona Simulator build dialog, the app's output will appear in the Corona Simulator Console window.
App Signing
Corona Out Mac Os X
You'll need a 'Mac Apps' provisioning profile from the Apple Developer portal in order to sign your macOS app. This works very similarly to the iOS app signing process, but you may optionally choose to create an unsigned app by selecting None in the Provisioning Profile dropdown when performing a build. Unsigned apps can be run on your own machine and, with some tweaking of the 'Security & Privacy' settings within 'System Preferences,' on other Macs. However, unsigned apps can not be submitted to the Mac App Store, so you will eventually need to sort out your Mac provisioning profiles.
Provisioning profiles should be installed in ~/Library/MobileDevice/Provisioning Profiles
. It may be necessary to do this manually.
Custom URL Schemes
To enable a custom URL scheme in your macOS app, you'll need to set it up in the app's Info.plist
by including a section like this in build.settings
:
This will allow the app to receive a message from (or be started by) a Terminal command such as:
To handle the message in your Corona app, implement a handler like this:
Custom Document Types
Similarly to how custom URL schemes work you can set up document types that you app recognizes and which can be opened by dragging them to the app's icon in the Finder or the Dock.
To enable custom document types in your macOS app, you'll need to set it up in the app's Info.plist
by including a section like this in build.settings
:
In your Corona app, implement a handler like this:
This code will called when files with the configured types are dropped on your app's icon in the Finder or the Dock. More information is available in Apple's developer Core Foundation Keys documentation.
Entitlements
If you need custom entitlements in your macOS app, specify them in build.settings
. For example, you might need to specify the com.apple.security.personal-information.location
entitlement if you use Corona's location features.
Copyright
To customize the copyright message in the About box of your app, you can add the following to build.settings
:
App Icon
You should add a Icon-osx.icns
file to your Corona project's root directory to provide an icon for your application on macOS This should be an .icns
file which contains multiple versions of your icon at different resolutions (details). This Icon-osx.icns
file will be used to set the icon for the following:
- The icon that your
.app
bundle uses, as viewed in the Finder. - The icon used by your app in the Dock.
Corona Out Mac Os 11
You can find apps in the Mac App Store to help with the creation of .icns
Pizza running mac os. files.
Building / Running
To build and run your macOS desktop app, follow these steps:
Open the Corona Simulator.
Open and run a Corona project.
Select the File → Build → macOS. menu item to reveal the macOS build dialog.
The Application Name, Version, and Save to Folder fields are all required. Here are notes regarding these build dialog fields: https://jacksonfree.mystrikingly.com/blog/switcheroo-mac-os.
Application Name — The application name you've entered can be fetched at runtime via Corona's
system.getInfo( 'appName' )
call (reference).Version — The version string you've entered can be fetched at runtime via Corona's
system.getInfo( 'appVersionString' )
call (reference).Provisioning Profile — The provisioning profile for the app; see App Signing below.
Save to Folder — The directory in which to save the built project.
After Build — select which action should be performed after the app is successfully built.
Click the Build button to build your application to the given Save to Folder location. If you chose Send to Mac App Store., a panel will open which allows you to select the tab for the preferred option and follow the prompts to complete your build.
Debugging
The Corona Simulator does not currently support direct simulation of an app running in macOS desktop mode, although the Simulator running a 'Custom Device' skin is almost the same.
Note that when running a built macOS Corona app or the Corona Shell, all print()
output and Lua errors/warnings will be streamed to stdout
. There are various ways to manage this output. One way is to run the executable embedded in the app bundle in a Terminal window which will make the debug output visible. For example:
In this example, the backslashes () protect the spaces in the filename (you could alternatively use quotes).
You can also use the Console app in the Applications → Utilities folder to view application output.
If you run the app by choosing the After Build → Open application option in the Corona Simulator build dialog, the app's output will appear in the Corona Simulator Console window.
App Signing
Corona Out Mac Os X
You'll need a 'Mac Apps' provisioning profile from the Apple Developer portal in order to sign your macOS app. This works very similarly to the iOS app signing process, but you may optionally choose to create an unsigned app by selecting None in the Provisioning Profile dropdown when performing a build. Unsigned apps can be run on your own machine and, with some tweaking of the 'Security & Privacy' settings within 'System Preferences,' on other Macs. However, unsigned apps can not be submitted to the Mac App Store, so you will eventually need to sort out your Mac provisioning profiles.
Provisioning profiles should be installed in ~/Library/MobileDevice/Provisioning Profiles
. It may be necessary to do this manually.
For testing, it's recommended you sign the app with your Mac App signing identity by choosing it in the Corona Simulator Build for macOS dialog and then tell your testers to choose the Mac App Store and identified developers option on the 'Security & Privacy' panel of 'System Preferences'.
Distribution
You can distribute your app via the Mac App Store, a .dmg
, or any other way you may distribute an .app
bundle.
If not using the Mac App Store, we recommend that you sign the app with your Mac App signing identity by choosing it in the Corona Simulator build dialog menu and then tell your testers to choose the Mac App Store and identified developers option on the 'Security & Privacy' panel of 'System Preferences'.
If using a .zip
archive to distribute your app, be aware that there are symbolic links in the built .app
bundle, so you must specify the -y
option if running zip
on the command line to create your archive (using the Compress option in the Finder does the correct thing automatically). Failure to do this will result in macOS saying the app is damaged when run on another computer. Also note that some file sharing services can corrupt macOS applications, so we recommend that you put them in .zip
archives before uploading them.