Working with Corona

In this article, we’ll explain the contents of the SDK and then show how to use the simulator to launch a sample application.

The following files in the SDK are worth noting:

  • debugger is the command line debugger.
  • Corona Simulator launches your application for testing. It simulates the mobile device on your local computer.
  • Corona Terminal is useful for everyday development. It launches the Corona Simulator and opens a Terminal window to display error messages and print/trace statements. This enables you to do rapid iterations on your code.
  • simulator does the same thing as Corona Terminal, but is more convenient to use on the command line.
  • SampleCode/ is a directory containing various sample applications to help you get started.

We’ll assume that the SDK directory is /Applications/Corona/. Begin by launching the fishies application in the simulator. The actual application code and assets (image files) are located at /Applications/Corona/SampleCode/fishies/. We launch it by invoking the simulator with the path to that directory.

Opening a Sample Project

In order to launch an application, the simulator needs to know the folder where the application resides. You can launch the simulator in two ways: via the command-line or via an Open dialog.

Command-line

Let’s open the Fishies sample project from the command line. Open a Terminal window and cd into the SDK directory (/Applications/Corona). Then launch the simulator, passing the path of the Fishies sample project. Your command-line session should look something like:

[~]% cd /Applications/Corona
[/Applications/Corona]%./simulator SampleCode/Fishies/
Copyright (C) 2009 ANSCA, Inc.
        Version: 1.0
        Build: 2009.11.28.1
 

A copyright notice similar to the above will appear in the Terminal and the simulator window at left should appear. Try clicking on the fish and see what happens. The source for this application is available in the file SampleCode/fishies/main.lua.

Open Dialog

Open the SDK folder and double click on Corona Terminal. You should see an Open dialog displayed. A menu at the bottom of the dialog allows you to choose the initial device to simulate:

Navigate to the SampleCode folder and select the Fishies sample folder.

The Hardware menu lets you rotate the simulator orientation and suspend/resume the application.

The Window menu lets you switch device views, and also zoom in and out, since the iPad and Android simulators can be quite large at 100% scaling. Allowed magnifications are 100%, 50%, 25% and 12.5%.

The Show Project Sandbox menu command (File > Show Project Sandbox) opens the application's sandbox folder where the Corona Simulator stores data saved by your application.

Replies

Viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
binyu1749
User offline. Last seen 30 weeks 4 days ago. Offline
Joined: 13 Mar 2011

{}

xardox69
User offline. Last seen 45 weeks 1 day ago. Offline
Joined: 28 Mar 2011

installer for windows doesn't contain Corona Terminal.

JWJB's picture
JWJB
User offline. Last seen 1 week 1 day ago. Offline
Joined: 11 Nov 2011

I second this.

I installed CoronaSDK on a Windows 7 64-bit laptop and do not see the Corona Terminal application and just see the "Corona Simulator" and "Corona.Debugger" applications at: C:\Program Files (x86)\Ansca\Corona SDK.

Does anybody have a workaround for this so that developers using Windows can have access to the Corona Terminal?

Thanks, John

Joshua Quick
User offline. Last seen 1 day 1 hour ago. Offline
Ansca Staff
Joined: 31 Jan 2011

Everyone,

The Corona Simulator on Windows does indeed have a terminal window (aka: console window). This window is automatically displayed when you launch the Corona Simulator. Notice when you simulate a project, that Corona outputs to the console window in the exact same manner as it does in OS X. The only difference here compared to OS X is that the Corona Terminal is not its own separate application, but is part of the Corona Simulator application.

JWJB's picture
JWJB
User offline. Last seen 1 week 1 day ago. Offline
Joined: 11 Nov 2011

Thanks Joshua and I do see this when running the simulator and have made this note in my Corona SDK User Guide too.

Happy Holidays!

John

Joshua Quick
User offline. Last seen 1 day 1 hour ago. Offline
Ansca Staff
Joined: 31 Jan 2011

Glad I could help! Happy Holidays to you too!