CLI

The Ruby Native CLI lets you deploy builds and manage your app from the terminal.

#Authentication

Log in with your Ruby Native account:

bundle exec ruby_native login

This opens your browser, authorizes the CLI, and stores a token locally.

#CI environments

Set the RUBY_NATIVE_TOKEN environment variable instead of using ruby_native login. Generate a token by running ruby_native login locally, then copy it from ~/.ruby_native/credentials.

# GitHub Actions example
env:
  RUBY_NATIVE_TOKEN: ${{ secrets.RUBY_NATIVE_TOKEN }}

#Deploy

Build your app:

bundle exec ruby_native deploy

This builds every platform you have configured. If only iOS is set up, only iOS builds; adding Google Play later means the same command starts building both, with nothing to change in your pipeline.

The CLI queues the builds, then waits for all of them. It exits non-zero if any platform fails, so a broken Android build cannot pass behind a successful iOS one. Press Ctrl+C to stop waiting without cancelling anything.

#Building one platform

bundle exec ruby_native deploy --ios
bundle exec ruby_native deploy --android

--platform=ios, --platform=android, and --platform=all work too.

#Auto-deploy in CI

Add --if-needed to only build when the gem version has changed since your last successful build:

bundle exec ruby_native deploy --if-needed

This compares RubyNative::VERSION in your bundle against the gem version from the most recent build of each platform you have configured. When they all match, the deploy is skipped (exit code 0). If any platform is behind, or has never built, a build is triggered.

A typical CI setup:

# .github/workflows/deploy.yml
- name: Deploy to Ruby Native
  run: bundle exec ruby_native deploy --if-needed
  env:
    RUBY_NATIVE_TOKEN: ${{ secrets.RUBY_NATIVE_TOKEN }}

This way every Rails deploy checks if a native rebuild is needed, but only triggers one when the gem actually changed. The command triggers the build and exits immediately without waiting for it to finish, so it won't hold up your CI pipeline.

If a build fails for any reason, you'll get an email with the error details.

#App linking

The first time you run deploy, the CLI asks which app to build (if your account has more than one). It stores the selection as ruby_native.app_id in config/ruby_native.yml.

#Check

Read every view in your app and report signals that will not work:

bundle exec ruby_native check

Unknown signals are ignored in the app, mistyped ones render fine but silently fail. check finds those before a build, along with duplicated signals and version mismatches. See Debugging for what it catches and how to read the output.

Exits 0 when everything passes and 1 on an error, so it drops straight into CI.

Option Description
--deployed Also compare against the build your users have, not just the gem in your Gemfile. Needs you to be logged in.
--paths=app/views,app/components Directories to scan. Defaults to app/views.

check needs the herb gem, which Rails 8.2 and later already include through Action View. On earlier versions, add gem "herb" to your Gemfile.

#Deploy runs it for you

deploy runs the same checks before triggering a build and stops if it finds a problem, so a broken signal never costs you a round trip through TestFlight. Skip it with --skip-check:

bundle exec ruby_native deploy --skip-check

If the herb gem is not installed, deploy skips the check and builds as normal.

#Preview

Start a Cloudflare Tunnel to your local Rails server and print a QR code to scan with the Ruby Native app:

bundle exec ruby_native preview

Two options:

Option Description
--port 4000 The local port your Rails server is on. Defaults to PORT when set, then 3000, the same way rails server picks its port.
--url https://staging.example.com Skip the tunnel and point the QR code at a URL you already host.

#Other commands

bundle exec ruby_native logout        # remove stored credentials

App Store and Play screenshots are captured by rubynative.com against your deployed site, not from the CLI. See the screenshots guide.