The Ruby Native CLI lets you deploy builds and manage your app from the terminal.
Log in with your Ruby Native account:
bundle exec ruby_native login
This opens your browser, authorizes the CLI, and stores a token locally.
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 }}
Trigger an iOS build:
bundle exec ruby_native deploy
The CLI queues a build, then polls until it completes. You can press Ctrl+C to stop polling without cancelling the build.
Add --android to build for Google Play instead:
bundle exec ruby_native deploy --android
--platform=android and --platform=ios work too. Without a flag, deploy builds for iOS.
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 your most recent build. If they match, the deploy is skipped (exit code 0). If the gem version is newer, 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.
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.
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. |
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.