Skip to content

Latest commit

 

History

History
167 lines (119 loc) · 4.72 KB

index.md

File metadata and controls

167 lines (119 loc) · 4.72 KB
layout seo_title heading_baseline
default
RubyMotion Applied
An example/tutorial based approach to learning mobile development with Ruby.

This page contains documentation that will help you get started with building mobile apps using Ruby. Content on this page is released under Apache 2.0 and can be found here. Feel free to contribute your own documentation or provide suggestions via GitHub Issues.

Guidelines

  1. Join the RubyMotion Slack Channel.
  2. These tutorials should be done in order.
  3. The tutorials are ordered in increasing difficulty, by platform:
    1. iPhone/iPad
    2. Android
    3. Cross Platform Mobile
    4. Non-mobile Development: MacOS, tvOS, WatchOS (requires at least a RubyMotion Indie License)
    5. Game Development: iPhone, iPad, Android, and Cross Platform
    6. The RubyMotion Runtime itself
  4. Tutorials target the latest stable iOS/Android releases (unless stated otherwise).
  5. The WNDX School (paid) has some more in-depth video courses. Courses in beta are currently free.
    1. Introduction to iPhone Development with RubyMotion

Jump To Tutorial

iPhone/iPad Development Tutorials

  1. Getting Your Mac Set Up for iOS Development
  2. Wrapping a Responsive Website and Deploying to the AppStore
  3. Adding a UIButton programmatically and wiring it up to do something when tapped
  4. Working with the UINavigationController
  5. Working with the UITableViewController
  6. Building Layouts using Masonry
  7. Interacting with JSON APIs AFNetworking
  8. Working with Isolated Storage
  9. IAP/Monetization
  10. Push Notifications
  11. RubyMotion Tutorial for Objective C Developers

Android Development Tutorials

  1. Getting Your Mac Set Up for Android Development

Cross Platform Mobile Tutorials

  1. Understanding the Challenges for Building Crossplatform Apps

Non-mobile Development Tutorials

  1. Todo

Game Development Tutorials

  1. Todo

RubyMotion Runtime Tutorials

NOTE: RubyMotion is currently closed source, but will become more open with time. These tutorials will give you insight into how RubyMotion works behind the scenes, and what you'd need to learn in order to work on RubyMotion (as the source code becomes more open). These are fairly advanced tutorials, and are not required to build apps with RubyMotion.

  1. RubyMotion Rake Tasks Demystified
  2. Creating Foreign Function Interfaces to C++ Libraries using rubmotion.h
  3. Setting Up Your Mac to Build RubyMotion from Source
  4. LLVM Crash Course

iPhone/iPad Development Tutorials

Getting Your Mac Set Up For iOS Development

TODO

Installing Homebrew

Paste this at a terminal prompt

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Source

Installing rbenv or rvm

rvm

Paste this at a terminal prompt

curl -sSL https://get.rvm.io | bash -s stable --ruby

Installing Xcode and CLI Tools to Support Mobile Development

Install Xcode, launch it, and click 'yes' when asked if you want to install additional components

Getting Your Certificates and Provisioning Profiles Setup

Use motion-provisioning Add this line to your application's Gemfile:

gem 'motion-provisioning'

and then add the info from the motion-provisioning README to your rakefile:

Motion::Project::App.setup do |app|
  app.name = 'My App'
  app.identifier = 'com.example.myapp'

  app.development do
    app.codesign_certificate = MotionProvisioning.certificate(
      type: :development,
      platform: :ios)

    app.provisioning_profile = MotionProvisioning.profile(
      bundle_identifier: app.identifier,
      app_name: app.name,
      platform: :ios,
      type: :development)
  end

  app.release do
    app.codesign_certificate = MotionProvisioning.certificate(
      type: :distribution,
      platform: :ios)

    app.provisioning_profile = MotionProvisioning.profile(
      bundle_identifier: app.identifier,
      app_name: app.name,
      platform: :ios,
      type: :distribution)
  end
end

Running Hello World on the Simulator

motion create hello_world --template=iOS
cd hello_world
bundle install
rake pod:install #optional--only if you add pods to your Rakefile
rake device_name='iPhone 8'

Running Hello World on a Device

cd hello_world
rake device