Getting Started with RubyMotion for iOS and OS X

Thank you for downloading RubyMotion. This guide will help you get started with RubyMotion for iOS and OS X.

1. Overview

RubyMotion is a toolchain that permits the development of iOS, OS X and Android applications using the Ruby programming language.

iOS is Apple’s mobile operating system, powering a variety of devices such as the iPhone, iPod touch and iPad. OS X is Apple’s desktop operating system, powering Mac computers such as the iMac or the MacBook Air. Android is Google’s mobile operating system, powering a huge array of devices from different manufacturers.

Developers can write applications for iOS and OS X and submit them to the App Store, Apple’s application distribution system. Alternatively, RubyMotion can be used to conceive applications for Android that can be submitted to the Google Play store.

Conceptually, RubyMotion is a combination of two major components:

  • Runtimes: Brand-new implementations of the Ruby language, tightly integrated with the native Apple or Google runtime and optimized for embedded device constraints.

  • Project Management: A command-line interface to create, manage, and interactively develop RubyMotion projects. It also includes a static compiler that compiles Ruby into optimized machine code and an interactive console where you can evaluate expressions on the fly and change the way your app behaves in real-time.

RubyMotion installs itself into '/Library/RubyMotion'. A symbolic link to the command-line interface is created as '/usr/bin/motion'.

This document focuses on RubyMotion for iOS and OS X. For Android, check out the Getting Started With Android document instead.

2. Prerequisites

2.1. OS, SDK & Xcode

RubyMotion requires a 64-bit Mac running OS X 10.8.4 or higher. OS X 10.12 Sierra or higher is however recommended.

You will need to install the iOS and OS X SDK on your machine. These days the SDKs comes with Xcode.

If you don’t have Xcode installed, follow the Xcode Installation instructions

2.2. Text Editor

After having installed RubyMotion you need to set up a text editor for development if you don’t already have a favorite. RubyMotion does not come with a proprietary IDE and lets you use the editor of your choice. Here is a list of Common Editors

3. Software Updates

Software updates can be applied via the command-line.

The following command will grab the latest version of RubyMotion from the network and install it. You must be connected to the Internet to successfully update RubyMotion.

$ sudo motion update

You can run the following command to check the version of RubyMotion installed on your computer.

$ motion --version

Once a day, the RubyMotion build system pings the software update server in order to see if a new version of RubyMotion is available to install.

If a new version is available RubyMotion prints a message to your terminal suggesting that you to upgrade. The build system will also print a message if your license is about to expire.

4. Support

4.1. All Developers

Everyone can find additional help with these resourses:

4.2. Professional and Enterprise Customers

If you are experiencing an issue, would like to request a feature, or simply have a question, you can file a support ticket from the command-line too.

$ motion support

This will open a new window in your browser where you can fill up a support ticket. Your license key and some useful information regarding your environment will be added automatically.

5. Writing Hello World

We are now ready to write our first RubyMotion program. Follow the guide for your preferred platform:

5.2. OS X