Command Line

Using NeoMAD as a command line tool is independent of any IDE.

Therefore, the NeoMAD reference guide describes the parameters and options of the command line tool and does not refer to any IDE. However, this guide is applicable to any IDE with a NeoMAD plugin because all the parameters and options described here are available in the plugin.

The general syntax of NeoMAD is:

neomad [-t TARGET] [...] <URS File>

All the arguments that can be given to NeoMAD fall into one of the following categories:

  • parameters: mandatory arguments
  • options: optional arguments

The complete NeoMAD reference guide can be obtained by running NeoMAD with no arguments.

Parameters

The parameters are as follows:

  • the targeted mobile device(s)
  • the language(s)
  • the URS file (see URS File. for a detailed description of this file)

Targeted mobile device(s)

-t TARGET1 (-t TARGET2 ...)

This is the mobile device for which a binary will be generated. This is often referred to as the “target”.

The list of the supported targets can be found in the help message of NeoMAD using:

neomad -h

URS file

<URS File>

This parameter is the path of the project’s URS file. See URS File for a detailed description of the URS file.

Options

Language(s)

Note

These options are not required, NeoMAD will generate a single binary containing all the specified languages from string resources.

To specify the language(s) of your application, you can choose between two arguments, which cannot be used together:

-l LANG1 (-l LANG2 ...)
-m LANG1(,LANG2, ...)
LANG1, LANG2, … are the file suffix from string resources.
e.g. For res/string/strings-en.xml and res/string/strings-es.xml, values are en and es.
See (string resources) for a detailed description of the text file.

When the -l argument is used, NeoMAD will generate one binary for each specified language so that each binary will contain only one language.

When the -m argument is used, NeoMAD will generate a single binary containing all the specified languages. The application will automatically use the language selected in the user’s mobile device settings, if this language has been provided in the CSV. Otherwise, it will use the first language specified in the -m parameter.

e.g.

If an application is compiled using -m en,fr,de; the language used at execution will be:

  • German if the language selected in the device settings is German
  • French if the language selected in the device settings is French
  • English in all the other cases

The language can also be selected dynamically using the ResManager.setLanguage() method. Thus it is possible to create a language settings menu in the application and let the user select the language. However, the user experience will be better if the application automatically uses the language selected in the mobile device settings and implementing a language settings menu in the application should be avoided if possible.

License management

-a

Display the license used on the computer.

-synchronize

Synchronize your version of NeoMAD with Neomades’ server so that you can work for a while without internet access.

Build

-d CONSTANT

Set the CONSTANT constant to 1 (cf. Constants and conditional coding)

Debug

-g

Add debug information in the jar file to enable debugging on the computer.

Emulation

-s

Start the generated application on the corresponding emulator (if available). For IOS, IPAD and IPHONE targets the application will be installed on the last IOS emulator that was used instead.

Note

It is highly recommended to close the emulator with its exit menu rather than killing the NeoMAD process, in order to avoid locking the emulator.

Obfuscation

-obf (-obfuscate)

Use Proguard to obfuscate the generated code (Android only). Obfuscation is deactivated if used with the debug mode (-g).

Optimization

-opt (-optimize)

Use Proguard to optimize the generated code (Android only). Optimization is deactivated if used with the debug mode (-g).

Note

It is recommended to use this option with the obfuscation also enabled, using optimization alone may have side effects.

Advanced usage

-gsi (-generate-specific-impl)

Generate the specific implementation for all platforms using the Java definition provided in specific-def (cf. Platform specific code).

Neomad command line configuration properties

-P NAME=value

Set the NAME configuration property for the current build. The properties set in the command line are prior to the properties in neomad.properties file. The property NAME correspond to a key from neomad.properties (cf. NeoMAD configuration file).

e.g.

-P ANDROIDPATH=/Applications/Android-sdk (Windows)
-P ANDROIDPATH=C:/Program Files (x86)/Android/android-sdk (Windows)

Generated files

When a NeoMAD compilation is launched, binaries are generated for all the specified targets. By default binaries are written to the output directory with a sub-directory per target. The path of the output directory is specified in the URS file (cf. URS File)

e.g.

out\
   IPHONE\
      *.ipa
   ANDROID\
      *.apk
   WINDOWSPHONE80\
      *.xap
   WINDOWS80\
      *.zip

For Android targets, NeoMAD will always generate the application’s Android Studio project in a sub-directory of the target platform output directory. Nothing is required to create the project, however, the Android SDK must be installed to build the .apk file. For more details, see Android prerequisites.

For Windows Phone and Windows targets, NeoMAD will always generate the application’s Visual Studio project in a sub-directory of the target platform output directory. Nothing is required to create the project, however, the SDK corresponding to the target must be installed to build the project (only available on Mac OS). For more details, see Windows prerequisites.

For iOS targets, NeoMAD will always generate the application’s Xcode project in a sub-directory of the target platform output directory. Nothing is required to create the project, however, the Apple’s iOS development tools must be installed to build the .ipa file (only available on Mac OS). For more details, see iOS prerequisites.