Skip to main content
Use the same operation to open an ordinary HTTPS URL or hand a custom-scheme deep link to an installed app. It is available on iOS Simulator and Android Emulator through the CLI, TypeScript SDK, and REST API.

Authenticate

For an interactive terminal, sign in once and confirm that the account can use mobile sessions:
For CI, the TypeScript SDK, or direct REST calls, create an API key in the dashboard and expose it to the process:
Do not put the key in source code, a browser bundle, command output, or a committed environment file. CLI commands can use either the saved login or the environment key. The SDK and REST examples below use the environment key. You also need an active session that belongs to the authenticated account. A custom-scheme target needs an installed app that registers that scheme. The maintained iOS proof app and Android proof app register runcloudproof and display the complete URI they receive.

Use the CLI

Pass the complete target as one quoted argument. These examples preserve an encoded path separator, a space, a nested return URL, its query string, and a fragment:
Successful JSON identifies the authenticated session, device, and lease that accepted the operation. url is the exact input string, without decoding or normalization:
The acknowledgement confirms that the operation ran against that live lease. When app-specific navigation matters, inspect the signed viewer or capture a screenshot to confirm the visible result.

Use the TypeScript SDK

Install @run-cloud/sdk on Node.js 20 or newer:
Platform clients return a typed SimulatorOpenUrlResult:
When the platform is selected at runtime, use the generic simulator client:
Release every metered session in finally; see the TypeScript SDK guide for a complete create-and-cleanup example.

Call the REST API

The CLI and SDK use the public authenticated endpoint rather than a separate URL-opening contract:
Build the JSON body with jq so quotes and URI delimiters remain data:
Replace ios and IOS_SESSION_ID with android and the Android session id for an emulator. The response has the same six fields as SDK and CLI JSON output.

Platform behavior

Opening a URL does not install an app or register its scheme. If no application can handle a custom scheme, the request fails instead of reporting success. On iOS, the first custom-scheme handoff can show an Open in “App”? system confirmation after the URL acknowledgement succeeds. Confirm Open in the viewer before asserting app state. Automated visual proof can wait for the prompt and send an authenticated normalized tap to its button. The maintained iOS proof waits at least five seconds for the prompt, taps once, then allows at least five seconds for the app to render before capture. Its HTTPS proof also allows five seconds for the browser to reach its final state. Android does not receive that iOS-only tap.

Preserve encoding safely

  • Supply one absolute URI with a standard scheme. Relative paths and blank values are rejected.
  • Percent-encode individual path, query, and fragment values. Do not percent-encode the entire URI, because that also hides its : and / delimiters.
  • Keep the CLI argument quoted. Characters such as &, #, ?, ;, and command-substitution text remain URL data. The URL is passed as one inert argument; Android’s platform bridge quotes shell metacharacters so they are not evaluated as commands.
  • The API accepts targets from 1 to 4,096 characters and rejects raw ASCII whitespace, control characters, malformed schemes or percent escapes, and HTTP(S) URLs without a hostname. It also rejects about:, data:, file:, javascript:, and vbscript: targets.
  • Compare the returned url with the input when an automation run must prove transport fidelity. If they match but the app displays a different route, inspect the app’s own link parser.

Troubleshooting

Public errors include ok: false, outer action: "open-url", platform, available session/device/lease scope, and a nested error object with code, message, retryable, and sometimes action with a concrete next step. If a link is truncated in a terminal, quote the entire URI. An unquoted & backgrounds a shell command, and an unquoted # can start a shell comment. If the request succeeds but the expected screen is missing, inspect the viewer or take a screenshot and check the app’s own route configuration. SDK failures throw RunCloudError. Inspect status, code, detail, retryable, platform, and sessionId rather than matching a complete error sentence. action identifies the failed SDK operation ("open-url"); suggestedAction contains the human-readable remediation returned as error.action by the API.