mkapp

mkapp can be used to build a binary app package (<c>.app</c> file) that can be later built into a larger system of interworking apps using mksys. You might want to use mkapp in this way if you want to provide an app to someone but you can't share your app's source code with them for whatever reason.

mkapp can also be used with some target devices (e.g., Linux-based targets) to build a single app in isolation, producing an update pack that can be used to install just that one app onto the target, without touching any of the other apps that are already running on the target device. It is recommended that you do not do things this way, though. Building complete systems of interworking apps using mksys is the preferred approach.

The main input for mkapp is an Application Definition .adef file that contains these definitions:

  • executables to build when the app is built
  • components and/or other files to build into those executables
  • other files to be included as a part of the app
  • if the app will run in a sandbox, files to access outside the sandbox
  • executables to run when the app is started
  • command-line arguments and environment variables to pass to those apps
  • limits to place on the app (CPU, memory, etc.)

mkapp will parse the .adef file, determine which components, interface definitions, and other source files are needed, build those into the libraries and executables required, generate the on-target configuration data needed, and add everything to an app bundle.

To display usage, run

mkapp --help

See Application Definition .adef for details on app def files.

See Definition Files for more info on Legato definition files, in general.

See Tool Chain Configuration for information on how mkapp decides what compilers, etc. to use.

Building a Binary App Package

There may be occasions when you want or need to distribute an app for inclusion in another user's system, but you cannot distribute the source code for this app. In that case you can use mkapp with the -b (or --bin-pack) option. For example, building a simple helloWorld style app:

$ mkapp -t wp85 helloWorld.adef -b

This will produce a file called helloWorld.wp85.app which is a binary app package ready for distribution to others for inclusion in their system builds. To use this binary app package, simply include it in the apps section of your system's .sdef file, like you would with a .adef file:

apps:
{
    helloWorld.wp85.app
}

Note that this binary app package is compiled specifically for the given target, so an app compiled for one target is not necessarily compatible with another target.

Building an App Bundle (App Update Pack)

mkapp can be used to generate an app bundle (also known as an update pack [.update] file) to install and run on a target device.

App bundles (.update files) are compressed archives that can be used to:

  • Install your app on a target.
  • Update your app to a new version.

But, use of mksys is preferred over using mkapp in this way. mksys produces a full system bundle which has the following benefits:

  • limits the risk of leaving your target in a bad state
  • performs some inter-app consistency checks (e.g., checks for typos in bindings)
  • ensures that all apps are updated together
  • reduces the chances of an app hanging at start-up because of missing or misspelled bindings