Package a mobile app

You must package your app before you can deploy it to a mobile device.

Before you begin

Make a list of files needed to run your app and the absolute path to where these files reside.

About this task

If you created your project using the BAM Mobile Project (.4pw) or Mobile Project (.4pw) options, default package nodes were created for Androidâ„¢ and iOS devices. You should still read through this procedure to add directories and validate properties.

  1. Launch Genero Studio.
  2. Open your project.
  3. Make a list of files needed to run your app and the absolute path to where these files reside.
  4. Right-click on the Packages node and select New Package.
  5. Define the package properties.

    Figure: Package properties


    Screen shot of Properties pane for a package node.
  6. For each physical directory on disk that contains files to be included in the package, identify a corresponding logical directory under the package node. If no corresponding logical directory exists, create the directory.
    1. If a new directory is needed, right-click on the package node and select New Directory.
    2. Define the properties for each directory added.
      Files are copied from the source directory to the destination directory. In the Source directory property, specify the directory where the file(s) come from. In the Destination directory directory, specify the target directory. The destination directory must be in the root directory.
      Note: In the default project of a new BAM Mobile Project (.4pw), both properties are set to $(ProjectDir)/bin. When the source and destination directories are the same, the packaging process does not have to copy, optimizing the packaging process.
    3. To include or exclude files from the source directory, add the criteria to the Included files or Excluded files properties.

    Figure: Directory properties


    Screen shot of Properties pane for a directory node.
  7. Confirm the Package rules. Right click on the package node and select Edit Package Rules.
    Note: You typically do not modify the package rules.
  8. Right click on the package node and select Build.
    Progress of the package build appears in the Output view.
    Important: You need an internet connection the first time you build an Android package. During this first build, an automated process will download and install Gradle with all necessary extensions into a directory in your user directory. Gradle is a project automation tool, find out more about Gradle at http://www.gradle.org.

    Figure: Build package


    Context menu showing Build menu option.
  9. Confirm the package is on your local file system.
  10. Validate this package by running the app on a device. Follow the instructions to Deploy a mobile app for testing.
What to do next

The packaging of a GMA application is handled under the covers by the gmabuildtool, which uses a cache. This cache is created in a temporary directory and, if not managed, can grow to a significant size. You should take care to monitor the size of this cache and manually clean out the cache files, to ensure that it does not become too large in size. For more information about the gmabuildtool and the cache it creates, see the Genero Business Development Language User Guide.