Authenticate
For an interactive terminal, sign in once and confirm that the account can use mobile sessions: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:url is the exact input string, without decoding or
normalization:
Use the TypeScript SDK
Install@run-cloud/sdk on Node.js 20 or newer:
SimulatorOpenUrlResult:
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:jq so quotes and URI delimiters remain data:
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:, andvbscript:targets. - Compare the returned
urlwith 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 includeok: 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.