×
A new build of Corona SDK is now available to subscribers. Not a subscriber? Subscribe now.
CoronaSDK 2012.821 | Released: 23 May 2012, 2:01am | What's New | Download Now

Installation and Setup for Mac OS X

Installation

Installation of the Corona SDK is very simple. We'll assume you've already downloaded the SDK. If you're already familiar with how apps are installed from disk images (dmg), then just proceed as normal; you can skip the following instructions:

Once you've downloaded the disk image, it should mount. If it doesn't, then double click on the disk image file. It should have a name like CoronaSDK.dmg. Once it is loaded, you should see the mounted disk image folder, as shown below.

Corona disk image for Mac

Next, drag the Corona folder into the Applications folder alias. This will copy the contents of the Corona folder into /Applications. If you are not an administrator, you will be prompted for an administrator password. A folder similar to the one shown below hould be located at /Applications/Corona after successful installation. We’ll refer to this folder as the SDK folder.

Activating the SDK

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

Double click Corona Simulator in the SDK folder. The first time you launch, you will be presented with a End-user License Agreement (EULA). Assuming, you click Agree, you will then be presented with the dialog pictured at right. If you've already purchased (or signed up for a trial), simply enter your Corona Connect e-mail and password to activate the SDK. Otherwise, click Register to create an account.

Upon successful login, you will get a confirmation dialog like the one shown below. You're ready to get started.

Launching the Simulator

By default when you launch the Corona Simulator application, the Corona Welcome window appears, as shown below. From the Welcome window you can open a Corona project for previewing in the Simulator, create a device build for testing or distribution, and access sample projects and documentation.

In Corona, a project is simply a folder that contains a main.lua file and related assets. For example, the image below shows the project folder for the Fishies sample project located in the SampleCode folder of the Corona SDK ( /Applications/CoronaSDK/SampleCode/Graphics/Fishies) . Inside the Fishies folder you will find a file named main.lua, as well as asset files for images and sounds used by the application.

To run the Fishies project in the Corona Simulator, click the Simulator button in the Corona Welcome window. In the Open dialog that appears, navigate to the SampleCode/Graphics/Fishes folder and click Open. The Fishies application opens and runs in the Simulator. (Try clicking on some fish in the Simulator window to see what happens.)

The CoronaSDK folder also contains Corona Terminal. Running Corona Terminal does the same thing as Corona Simulator, but also opens a Terminal window that displays useful error messages including syntax errors, runtime errors, and print() statements generated by your application. For these reasons, it's recommended you use Corona Terminal for your day-to-day development.

If you prefer to use the command-line, you can also run ./simulator from the CoronaSDK folder, which is equivalent to double-clicking Corona Terminal.

Configuring Text Editors

There are many editors available with which to write your code, such as the Xcode development software from Apple, BBEdit, textedit etc. For the purpose of this document, will give a basic run through with Xcode and BBEdit. The output of these programs will ultimately be a text file named “ main.lua ”.


Xcode

Once Xcode is installed, all of the necessary Xcode software can be found in /Developer/ on the root of your hard drive.

For the proper syntax highlighting in Xcode, we recommend the following download:

http://www.capgo.com/Resources/SoftwareDev/LuaXcode3SyntaxColor.zip

Follow the instructions included with the download. While syntax highlighting is not necessary, it makes it much easier to navigate your code.

In Xcode, the quickest way to start writing code is to create an empty file. To do this, access the File menu and click on “New File...” On the left hand side, click on “Other” and select “Empty File”:

===>

Once you click the next button, you will be prompted for a location and name for your file. In the File Name field, type main.lua . For Location, you’ll need to create a folder to represent your project. The main.lua should be inside this folder. For example: “Project Name/main.lua ”.

Once you hit “Finish”, you’ll be given an empty window in which to begin your project. If you have installed the syntax highlighting, things like “local” will be colored. This will help you navigate through your project.

Remember to save your file before opening it in the Corona Simulator.

For more advanced configuration options for XCode, please refer to the Documentation included with Xcode or on Apple’s web site.


BBEdit

If this is your first time using BBEdit, you should see something similar to the window pictured below left. Hit continue when you have configured BBEdit to your liking. You should now see an empty window. In the lower left hand corner of the window (bottom right) you can choose "Lua" choose the appropriate language for proper syntax highlighting.

Select “Lua” from the list. Now, as you write your program, it will attempt to automatically format for you. Once you have saved your project, you can now run it using the Corona Simulator.

For more advanced options with BBEdit, please refer to the BBEdit user manual.


Other Options

On MacOS, there are a variety of text editors available for editing Lua code that have syntax coloring support:

A comprehensive list is available at lua-users.org/wiki/LuaEditorSupport.

Replies

Viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
elizabeth
User offline. Last seen 31 weeks 4 days ago. Offline
Joined: 14 Jan 2011

For the proper syntax highlighting in Xcode, the instructions included in the download are "Place Lua.pbfilespec and Lua.xclangspec in:
~/Library/Application Support/Developer/Shared/Xcode/Specifications/
and reboot Xcode."

yet on my 2 macs with installed versions of Xcode there is no '....Xcode/Specifications' folder only one for 'Remote Computers'

Should I create a folder called 'Specifications' in this directory?

darryl.luther
User offline. Last seen 1 year 10 weeks ago. Offline
Joined: 10 Mar 2011

As you have found, the instructions on where to place the two spec files are wrong (at least for Xcode 3.2.5). The correct location is: ~/Developer/Library/PrivateFrameworks/XcodeEdit.framework/Versions/A/Resources.

StarTony's picture
StarTony
User offline. Last seen 2 weeks 1 day ago. Offline
Joined: 27 Oct 2010

Has anyone tried it with Xcode 4 yet?

lhawkes
User offline. Last seen 1 year 5 weeks ago. Offline
Joined: 6 Mar 2011

Being brand-spanking new to Mac, Xcode and Corona, I've been beating my head against the wall trying to get Lua syntax coloring working in Xcode 4, but with no luck - until now.

As Darryl said, the correct location to place the Lua.pbfilespec and Lua.xclangspec files for Xcode 3.2.5 is in ~/Developer/Library/PrivateFrameworks/XcodeEdit.framework/Versions/A/Resources. I just confirmed that it works for Xcode 3.2.5, but does not work for Xcode 4. Needless to say, the path mentioned in the README for those files doesn't work in Xcode 4 either.

Hopefully someone will figure this out soon. I'm at my wits end!