CoronaViewer lets you edit the contents of a CoronaView
instance and preview those code changes in real-time on your device.
In this workflow, your native app does not have to be recompiled/relinked/reinstalled onto the device. You can edit your Lua code from your desktop editor/IDE and your Corona-related project files will automatically sync and update in the corresponding CoronaView
in your native app. (This also works with apps you build in the Xcode Simulator.)
NOTE: Corona SDK/Enterprise developers should go here.
The CoronaViewer.framework
should be installed so that its path is:
/Users/Shared/CoronaLabs/ios/CoronaViewer.framework
There are several simple steps:
-
Add
CoronaViewer.framework
to your Xcode project. -
Use
CoronaViewerController
instead ofCoronaViewController
. The former is a drop-in replacement for the latter. Note that the two differ in spelling just slightly — there is an 'er' in 'CoronaViewerController'. -
Disable your call to the
run
orrunWithPath:parameters:
selector of yourCoronaView
instance. -
Instead, you run via the controller. Specifically, call
CoronaViewerController
'srun
selector. -
Ensure that launch url's are handled correctly by adding the following to your implementation of the
UIApplicationDelegate
:- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url sourceApplication:(NSString *)source annotation:(id)annotation { return [CoronaViewerController handleOpenURL:url]; }
-
Modify your
Info.plist
so that Dropbox can interact with CoronaViewer properly:<key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLSchemes</key> <array> <string>db-l1q0pln8qsi8qyp</string> </array> </dict> </array>
CoronaViewer requires a Dropbox account. You'll also want to install Dropbox on your desktop computer so that you can sync edits from your desktop to the device.
Your Corona project files (e.g. main.lua
) should go in the following location in order to be shared:
${DROPBOX_FOLDER}/Apps/CoronaViewer
NOTE: Only files in this location will be synchronized with your device. The rest of your Dropbox folder is not visible to CoronaViewer.
Build the Corona project in this repo and install it on your device. (Corona Enterprise users, see below for additional info.)
You'll be prompted with Dropbox's standard login interface:
This enables the app to synchronize with your Corona project files (i.e. files that are in the above location.)
You can also build this app for the Xcode Simulator instead of for your device.
Files are updated based on modification time. To get the device to update the file, you must make sure the modification time is newer.
- iOS
- Android (TBD)
CoronaViewer is available to the following subscriptions/tiers:
- Corona SDK (Pro) uses a slightly different workflow. Learn more
- Corona Enterprise uses a slightly different workflow. Learn more
- CoronaCards