Installing Corona SDK — macOS

This guide will help you get up and running with Corona SDK for macOS.

Installing Corona SDK

You can use Corona SDK without installing Apple's Developer Kit or the Android SDK. Later, if you want to build and test your code on a iOS device, you will need to sign up as an Apple Developer and create the necessary certificates and provisioning profiles (guide).

We'll assume you've already downloaded Corona SDK. If you're familiar with how apps are installed from .dmg disk images, proceed as you normally would and skip to Corona SDK Activation.

Once you've downloaded the disk image, it should mount. If it doesn't, double click on the disk image file. When it opens, you should be presented with a disk image window.

In the disk image window, drag the Corona folder into the Applications folder alias. This will copy the contents of the folder into /Applications.

Note

There are two ways to stay current with releases/builds of Corona:

  • Public Release — The latest stable release of Corona SDK, providing maximum reliability for your projects. This is updated several times a year.

  • Daily Builds — The bleeding edge. Daily builds contain the latest features as they are integrated into Corona.

Corona SDK Activation

In order to use Corona SDK, you must be connected to the Internet and perform a simple one-time authorization process.

Open the Corona Simulator from the folder where you installed it. The first time you launch, you will be presented with a License Agreement (EULA). Read the license terms and click Agree. If you've already registered for a Corona account, simply enter your account e-mail and password to activate the product. Otherwise, click Register to create an account.

Upon successful login, you will receive a confirmation dialog. You're ready to get started!

Java Development Kit Setup

Installing Corona SDK lets you create and test apps locally on your Mac. If you intend to build apps for testing on Android devices, you will need to install the Java Development Kit (JDK). If you try to build an Android app without the JDK installed, the Corona Simulator will help you install it. Alternatively, if you want to install it manually, you can follow these instructions:

  1. Go to the JDK download page.
  2. Click the link to download the current Java Platform (JDK).
  3. On the next page, read the license agreement and click the option to accept it if you agree.
  4. Locate the Mac OS X x64 link and click it to download the file. This file will be named like jdk-XuYY-macosx-x64.dmg.
  5. When the download is complete, open the .dmg and run the installer.

Corona Editor (IDE)

Corona Editor offers developers a very capable and lightweight IDE. Corona Editor streamlines development and includes the following:

For more information, please see the Corona Editor page.

Other Text Editors

If you don't already have a favorite text editor, the following options are recommended:

Corona Development Environment

The Corona SDK development environment consists of two aspects: the Corona Simulator and the Corona Simulator Console.

  1. The Corona Simulator is a visual representation and test environment for your app. What you see in the Simulator is generally what your app will look like — and how it will function — when deployed to an actual device. The Corona Simulator is an essential tool because it allows you to view changes to your code instantly in an active, responsive environment that closely mimics the device.

  2. The Corona Simulator Console is where you can view diagnostic messages about what's happening in your program.

Welcome Window

The Welcome Window provides access to Corona developer resources. From here, you can also press ⌘-R to relaunch the most recently edited app.

Application Menu

This is the standard application menu in macOS. This menu provides access to the Simulator Preferences which are discussed in detail below.

File Menu

The File menu is where projects (applications) are created or opened. This is also where you build your apps for distribution or testing on devices.

Hardware Menu

The Hardware menu is used to simulate physical device actions such as rotating the screen.

Window Menu

The Window menu has options to manipulate the Simulator window or change the skin (WindowView As).

Corona Simulator Preferences

The Simulator has several preferences which let you customize the development workflow.

  • Deauthorize and Quit — the number of different computers on which you're allowed to run the Simulator is limited, so you'll need to deauthorize a computer if you stop using it. You can also use this button if you need to change the Corona account credentials you're developing with.

  • Anonymous feedback — approve the sending of anonymous usage information that helps us improve the Corona Simulator.

  • Automatically show the Welcome Window — show the Welcome Window any time there's not an application open.

  • Automatically close the Welcome Window — close the Welcome Window any time there's an application open.

  • Automatically open last project — upon loading the Simulator, open the most recently edited project.

  • Automatically scale Simulator to fit screen — automatically fit the Simulator to the screen when skins are changed.

  • Show Runtime Errors — show a diagnostic popup when the application experiences a runtime error. This helps in debugging application code.

  • Relaunch Simulator when project is modified? — the Corona Simulator can monitor the files in the project directory and relaunch the application if it sees any changes. This allows you to edit and save changes to your application code and see the result in the Simulator immediately.

Building Apps

When you want to build your app for distribution or to test on a device, choose File → Build and select the desired build option. The entire process for each OS is outlined in the following guides:

Command Line Usage

To start a particular app in the Corona Simulator without double-clicking it, use a command like this:

"/Applications/CoronaSDK/Corona Simulator.app/Contents/MacOS/Corona Simulator" ~/CoronaApps/MyApp

or...

"/Applications/CoronaSDK/Corona Simulator.app/Contents/MacOS/Corona Simulator" ~/CoronaApps/MyApp/main.lua

If the specified directory doesn't contain a main.lua file then an error is displayed. Optionally -project can be specified (note that this suppresses any error messages if the directory is invalid).

If you don't want the Simulator Console window to automatically appear use the -no-console option:

"/Applications/CoronaSDK/Corona Simulator.app/Contents/MacOS/Corona Simulator" -no-console YES

Output from the Simulator will appear on standard output.

If you never want the Simulator to automatically start a console window, but for some reason cannot use the command line, you can run the following command in a Terminal window:

defaults write com.coronalabs.Corona_Simulator no-console -bool yes

Use this command to turn the Simulator Console back on again:

defaults delete com.coronalabs.Corona_Simulator no-console

One additional flag is allowed -debug YES which allows an IDE to connect a debugger to the Simulator session. Specify it before the directory/file argument.