This guide outlines the most common build settings for apps across the various platforms that Corona supports. For those developers who require more advanced settings, please consult the Advanced Build Settings guide for which options are available.

Important

For Corona Native builds on iOS, only the orientation (details) and iphone → plist settings (details) are respected.

For Corona Native builds on Android, the build.settings file is ignored entirely.

Basic Structure

At the minimum, the build.settings file should contain a settings table which will contain various child tables to dictate build-time options.

settings =
{
-- Child tables here
}

App Orientation

The build.settings file can be used to set app orientation in relation to the device's physical orientation in space — this includes auto-orientation triggered by the accelerometer if the device is rotated or flipped during runtime.

Important

Please note that there are three different things which are subject to orientation:

Auto-Orientation

On most devices, auto-orientation is triggered by the accelerometer if the device is rotated or flipped during runtime. If you want to limit an app to either landscape orientation, specify both "landscapeLeft" and "landscapeRight" in the supported table.

supported = { "landscapeLeft", "landscapeRight" },

Similarly, to limit an app to either portrait orientation, specify both "portrait" and "portraitUpsideDown":

supported = { "portrait", "portraitUpsideDown" },

Important

When the device orientation changes, the coordinate position(0,0) on the Corona display stage will correspond to the top-left corner of the current orientation.

The iPad ignores the default setting and attempts to launch in the current physical orientation of the device, assuming that orientation is specified in the supported list.

If you ever need to detect the current device orientation, it can be read from the system.orientation property. This will provide a value from the four standard conventions listed above. In addition, iOS devices may report either the "faceUp" or "faceDown" orientation.

iOS Build Settings

Within the settings table, you can include a plist table nested within an iphone table. This plist table is used to set values for the compiled app's Info.plist file.

The iphone table encompasses all iOS devices, not just iPhone devices.

For boolean values in plist keys, use Lua-style booleans (true or false ) rather than Objective-C booleans (YES or NO).

In the example above, a few common plist keys are shown:

CFBundleIconFiles (table) — a required table of app icon image files to associate with the app. See Custom App Icons below for details.

UILaunchStoryboardName — a required string pointing to a valid .storyboardc file. See iOS Launch Screen below for important details.

UIStatusBarHidden (boolean) — specifies if the status bar should initially be hidden when the app launches.

CFBundleDisplayName (string) — the display name of the bundle. If you do not need to localize the app and the bundle name contains only ASCII characters, omit this key and specify the bundle name as Application Name in the Simulator Build for iOS window. If you localize the app (guide), include this key in both the plist table and in the InfoPlist.strings files of your language sub-directories alongside the localized CFBundleName keys.

CFBundleName (string) — a short app name of 16 characters or less. If the bundle name contains only ASCII characters, omit this key and specify the bundle name as Application Name in the Simulator Build for iOS window. If you localize the app (guide), this key should be included in the plist table and also alongside CFBundleDisplayName in the InfoPlist.strings files of your language sub-directories. If you do not localize the app, you may include this CFBundleName key in the plist table, but do not include the CFBundleDisplayName key.

Please see Apple's documentation for more information on supported values and what you can do with them.

Permissions

On iOS, when accessing certain hardware or OS-level functionality, you must notify the user why you're doing so. This is accomplished by including specific keys/descriptions in the plist table of build.settings. For example:

When the system prompts the user to allow access, the associated description is displayed as part of the alert. Note that the descriptions can be customized to your preference and they can even be localized (guide).

Important

In Corona, the following APIs are affected by iOS permissions, so you should include the permission key(s) noted in the associated API documentation if you're using any of these commands:

Android Build Settings

Within the settings table, you can include an android table to control build settings for Android devices.

settings =
{
android =
{
},
}

Version Code

You can override the version code entered into the Corona Simulator Build for Android box with an optional versionCodekey-value pair in the build.settings file. This is an internal number used to distinguish application releases for the Android app store, corresponding to the versionCode item detailed here. This setting is invisible to users.

settings
{
android =
{
versionCode = "11",
},
}

Note

The version code must be specified as an integer — it cannot contain any decimal points. One possible scheme is to set versionCode to "10" for version 1.0. The next update would be "11" for version 1.1, and so forth.

Permissions

The usesPermissions table creates <uses-permission> tags in the AndroidManifest.xml file:

See the Android documentation for more information on supported values and what you can do with them.

App Features

The usesFeatures table creates <uses-feature> tags in the AndroidManifest.xml file. These parameters tell the Android app store which hardware/software capabilities the app does or doesn't require. See the Android features reference for a list of supported values.

If you require a feature (required=true), devices lacking the feature will not be able to download or purchase the app. As a precaution, if your app uses the feature for some aspects but does not require it for "basic functionality," you should include the feature within the usesFeatures table but set its required key to false:

{ name="android.hardware.camera", required=false },

Expansion Files

The usesExpansionFile boolean indicates if the app should be built with expansion files. If it's set to true and the build target is Google Play, everything in the project directory except the Lua scripts are put into the expansion file. See the Android documentation for more information.

Plugin key names often include punctuation, for example plugin.gpgs. In these cases, you must use the "brackets and quotes" method of defining the key (["plugin.gpgs"]).

Custom App Icons

Before deploying an app, you should design the proper app icons for the targeted platforms.

iOS

For iOS, several icon files are required. Please see the Managing Xcode Assets guide for a reference on the Images.xcassets folder and how to include/reference it within your app.

Android

For Android, icon files will be copied into the .apk during the build, assuming they are available in your root project folder (alongside main.lua). These icons should adhere to the standard Android icon names and sizes listed below. For detailed information on creating icons, please refer to the Android Icon Design Guidelines.

File

Size (w×h)

Icon-xxxhdpi.png

192 × 192

Icon-xxhdpi.png

144 × 144

Icon-xhdpi.png

96 × 96

Icon-hdpi.png

72 × 72

Icon-mdpi.png

48 × 48

Icon-ldpi.png

36 × 36

Desktop

For macOS desktop apps, you must add a Icon-osx.icns file to your project folder before performing a macOS build via the Corona Simulator. This file should contain multiple images at different resolutions, bundled into a single .icns file (details). See the Creating macOS Desktop Apps guide for more information.

For Windows desktop apps, you must add a Icon-win32.ico file to your project folder before performing a Win32 build via the Corona Simulator. This file should contain multiple images at different resolutions, bundled into a single .ico file (details). See the Creating Win32 Desktop Apps guide for more information.

tvOS / Android TV

Apps designed for TV systems require additional icons:

For Apple's tvOS, several unique icons and assets are required. Please see the Managing Xcode Assets guide for a reference on the Images.xcassets folder and how to include/reference it within your app.

For Android TV, you should include a Banner-xhdpi.png image inside your project folder. This image should be 320×180 pixels in size.

Splash/Launch Screen

Corona Splash Screen

By default, a Corona-branded splash screen will appear when the app opens. This splash screen can be customized or disabled with purchase of the Splash Screen Control plugin. Please see the documentation for details on configuring the splash screen via build.settings, assuming you've purchased the plugin.

iOS Launch Screen

For iOS, you must include some form of launch screen support. Apple recommends that you utilize an Xcode-generated storyboard for this, since a single storyboard is flexible and adaptable for all launch screens across all devices.

For your convenience, a default (blank) LaunchScreen.storyboardc document is automatically added to all new project templates. The same file is also bundled with the Corona application itself, in case you need to copy it over to existing projects. It can be found within the Corona application folder here:

The Xcode storyboard document can be customized with your own images/layout — see our guide for instructions.

Important

If you use the default LaunchScreen.storyboardc file in an existing project, you must include the UILaunchStoryboardName key within the plist table so that iOS recognizes the existence of the file. Notice that the key's value ("LaunchScreen") matches the name of the file itself, minus the file extension:

Excluding Files

More sophisticated apps may have files which are needed on one platform but not another. For example, the icon files for each platform are different and you might want to include only the appropriate files on each platform. This is not something Corona handles automatically, since file naming may vary and unique situations can't be predicted. Most developers will not need to specify files which should be excluded from builds, but the option is available if necessary.

Files to be excluded are specified per-platform —ios, android, macos, win32, tvos, or all — using simple pattern matching where * means any string of characters, sometimes including /. In other words, these patterns match the path names of files in the app bundle as strings. This generally only matters if you have an elaborate directory structure with multiple instances of directories with the same name at different levels, for example a/music, a/b/music, a/b/c/music, etc. Note that the directory separator character is always a forward slash /, even if building on Windows.

File exclusion is a powerful facility and it's possible to corrupt your app bundle if you use this procedure unwisely and accidentally exclude files critical to its operation. After making any changes to the excludeFiles setup, monitor the console carefully during the next build and watch for any issues. You should also examine the contents of your app bundle carefully and check exactly which files are included.

Consider these examples on how to exclude various file names and types: