It should be as easy to get started with Calatrava as possible. However, there are still a small number of dependencies that need to be installed beforehand.
Note: Currently, Calatrava only supports fully-featured development on Macs. This will probably always be the case for iOS apps. Linux support for Android and Mobile Web is in progress. Windows is a little further off. Pull requests welcomed.
-
rvm. Calatrava projects are configured to use
rvmby default. You could use Calatrava without it, but you will then need to make sure you have Ruby 1.9.3 installed however you prefer. -
bundler. Install in either your
rvmglobal gemset, or wherever else makes sense for your setup. -
Xcode. You'll have to get this from the Mac App Store. Once installed, make sure you download and install the command line tools, and make sure you run
xcode-select. Calatrava doesn't actually directly use Xcode except when building iOS apps, so you can use it on a non-Mac as long as you don't run the iOS build targets. -
Android SDK. I recommend installing using homebrew if you're on a Mac. But however you get hold of it, the
androidcommand is expected to be on the path. -
Node.js. Only used to run tests, not part of any production code. Again, if you're on a Mac I recommend installing using homebrew.
-
ant. Up until Mac OS X 10.9 Mavericks this was included. However, it has now been removed. It can be installed with homebrew, however. Only required for Droid projects.
Note: Support for Linux is limited to running the Android and Mobile Web builds. Please note the following restrictions:
- If you generate a new project using calatrava, the iOS part will not be generated.
- Only the
web:\*anddroid:\*andkernel:\*tasks will work.
Here are the dependencies for Linux:
-
rvm. Calatrava projects are configured to use
rvmby default. You could use Calatrava without it, but you will then need to make sure you have Ruby 1.9.3 installed however you prefer. -
bundler. Install in either your
rvmglobal gemset, or wherever else makes sense for your setup. -
Android SDK — the
androidcommand is expected to be on the path. -
Node.js and NPM. Only used to run tests, not part of any production code.
-
Apache2. Used for hosting the mobile web versions. Some flavours of Linux will not come with this shipped. On Ubuntu systems, this can be installed with the following command:
sudo apt-get install apache2(from this page) -
ant. You'll probably pick this up when you install the Android tools. Only required for Droid projects.
Once you have the dependenices installed, there are just six simple steps to creating and building your first Calatrava cross-platform mobile app.
-
Install the Calatrava gem:
gem install calatrava -
Create your Calatrava project:
calatrava create <project-name> -
cd <project-name>. If you're usingrvmyou will be prompted to trust a new.rvmrc. -
bundle install -
rake bootstrap -
To build and run the Mobile Web app:
rake web:apache:startThen browse to
http://localhost:8888in your favourite browser. -
To build and install the Android app:
rake droid:deployYou will need to have an Android emulator running, or a device connected.
-
To build and run the iOS app open the Xcode workspace in the
iosdirectory, and then build and run the target named after your project.
-
Clone this repo.
-
cdinto the repo. -
Run
bin/calatrava create <project-name> --dev
The --dev switch will create a new project that refers to the
calatrava gem as a path on disk. This is much more convenient if
you're experimenting with Calatrava, or working on it.
