Follow the instructions on http://gitt.io/cli.
Once a module is downloaded, it must be installed in a specific project or in a shared global location.
- Open Studio.
- Expand the project folder in the Project Explorer view.
- Drag the .zip file from the download location into the current project, placing it at the root of the project. Choose to "Copy Files".
Place the module zip file in the root of the project directory. The Titanium build will automatically extract all registered Titanium modules in the root of the project.
Extract the .zip file into the root of your project. It should extract into the
Modules can be globally installed in the following locations:
Open the module's .zip file, and look at the folder structure. The path will look like the following:
- Folder Structure:
- Folder Structure:
- Open Studio, and the
tiapp.xmlfile for the project in question.
- Switch to the
In the application's
tiapp.xml, find the
<modules/>node, and replace it with the new
<modules>content. If you already have modules, just add a new node for the new module. Note that the "version" and "platform" attributes are optional. When "version" is not specified, the latest version of the module will be used (as of Titanium SDK 2.0.0), and the "platform" tag is only necessary when using a module that is not available on both platforms.
Code Block linenumbers true language xml
<ti:app> <!-- $MODULE_VERSION should be the same as "version" from above --> <modules> <!-- For example, if we were adding the greystripe module: --> <module version="1.1" platform="ios">ti.greystripe</module> </modules> </ti:app>
Use the require function to load the module in the app's code, for example:
Code Block language js
var Module = require('$MODULE_ID'); // For example, to load the greystripe module: var greystripe = require('ti.greystripe');
- The next time the app is launched or built, the module should be included with the application.