Compiling the code locally - adapt-it/adapt-it-mobile GitHub Wiki

Adapt It Mobile is currently configured to be compiled using the PhoneGap Build service. This service has a public sharing URL here that includes a QR code for quick scanning from a mobile device.

Having said that, you can configure AIM to compile and test the code locally, in case you need to:

  • Verify that a code change works properly on a given device
  • Test the screen resolutions or on-screen keyboard interactions of a device
  • Test a feature of a device

Compiling the code locally

To compile the code locally, you will need to create the platform you want to test on. Perform the following steps to create the platform and compile the code locally:

  1. Using the Finder / File Browser / Windows Explorer, copy the ENTIRE directory structure adapt-it-mobile/www/res to adapt-it-mobile/res. This will make sure the icons and splash screens get copied down to the appropriate platforms. Note that there is a .gitignore clause to ignore this directory -- it is ONLY for local compiling.

  2. Still in the Finder / File Browser / Windows Explorer, copy the config.xml file from adapt-it-mobile/www to adapt-it-mobile (i.e., the repository root).

  3. Open up a command line window and CD into the adapt-it-mobile directory.

  4. In the command line window, type cordova platform add <platform>, where <platform> is either ios, android, or windows. Note that the development environments for these platforms need to be configured before adding these platforms.

    For example - on an OSX system with the Android enviroment configured, you could type:

  $ cordova platform add ios

  $ cordova platform add android
For more information, see the "Developing Adapt It Mobile on ..." topics in this wiki. Also note that the browser platform does not need extra configuration, but will not be able to use any functionality provided by the plugins (file uploads / downloads, fonts, etc.).
  1. In the command line window, add the plugins we use for adapt-it-mobile:
  $ cordova plugin add cordova-plugin-device

  $ cordova plugin add cordova-plugin-dialogs

  $ cordova plugin add cordova-plugin-file

  $ cordova plugin add cordova-plugin-file-transfer

  $ cordova plugin add cordova-plugin-fonts

  $ cordova plugin add cordova-plugin-globalization

  $ cordova plugin add cordova-plugin-splashscreen

  $ cordova plugin add [email protected]
  1. In the command line window, type cordova build. Without specifying a platform, the cordova build command will build all the local platforms created on your system.

Notes

  • Subsequent local builds do not need to create the platform; a simple CD into the adapt-it-mobile directory followed by a call to cordova build will rebuild the app.
  • Local builds can get out of sync if the plugins and platform tools get updated at different times. If this happens, you might get a compilation error on code that was working earlier. To fix the issue, you will need to call cordova platform rm <platform> on ALL the platforms, cordova plugin rm <plugin> on ALL the plugins -- and then reinstall the platforms and plugins using the steps above.
  • The PhoneGap build service supports 3 platforms (android, ios, windows), but there are other platforms that can be configured from the command line. For a list of the available platforms, you can type cordova platforms ls at the command line.
⚠️ **GitHub.com Fallback** ⚠️