karagoz open-url
Opens a URL, such as a deep link or a web link, in the app the system picks or in the app you name.
Runs on
- Android emulator
- Android device
- iOS simulator
- iOS device
karagoz open-url <url> [--app <id>] [--device <id>]A deep link looks like myapp://item/42.
Before you start
Section titled “Before you start”- On an iOS simulator: Xcode, opened once.
- On an iPhone: Xcode 15 or newer, paired with the Mac, Developer Mode on (Settings > Privacy & Security > Developer Mode).
Options
Section titled “Options”| Option | Default | Meaning |
|---|---|---|
<url> |
The URL. It needs a scheme (https:, myapp:); nothing else is checked before the device gets it. |
|
--app <id> |
none: the system picks the app | The package name of the app that gets the URL, such as com.android.chrome. Not on an iOS simulator. |
--device <id> |
see Device selection |
Examples
Section titled “Examples”karagoz open-url https://example.com{"device":"emulator-5554","url":"https://example.com"}exit 0Output
Section titled “Output”{ "device": "emulator-5554", "url": "https://example.com"}devicestring- The adb serial, or the simulator's or iPhone's UDID.
urlstring- The URL as given.
appstring- Only when
--appwas given: the package name or bundle id from--app.
Errors
Section titled “Errors”| Code | When |
|---|---|
INVALID_ARGS | '<url>' is not a URL: it needs a scheme such as https: or myapp:, or --app's '<value>' is not a package name, as for launch. Checked before any device call. |
APP_NOT_FOUND | Without --app: no app on emulator-5554 opens 'nosuchscheme://x'. With it: package 'dev.karagoz.nope' is not installed on emulator-5554. |
APP_NOT_LAUNCHABLE | package 'com.android.shell' has no activity that opens 'myapp://x'. The app is installed but declares nothing for this URL. |
ADB_FAILED | Android refused the start. The message is Android's Error: line. |
ADB_TIMEOUT | After 30 s, as for launch. |
Every call can also get the device selection errors and the adb errors.
- The URL reaches the app as given, including
&,#,;, quotes and spaces. The caller quotes it only for its own shell. - Exit
0means Android started an activity for the URL, not that the app handled it. Read the tree to check. - With two apps for the URL and no default set, Android shows its chooser and
open-urlexits0. - An
httpsURL opens the app that owns the domain only when that app is verified for it. Otherwise the browser opens it. open-urlnever restarts the app. If it is in front, the URL goes to the running app.
On an iOS simulator
Section titled “On an iOS simulator”Runs simctl openurl. With --app it returns NOT_SUPPORTED: an iOS simulator opens a URL only in the app the system picks; run open-url without --app.
{ "device": "2EC769C1-2EF2-47EB-A441-E6843968F039", "url": "https://example.com"}- It returns before the app is in front: Safari took 1.3 to 2.2 s from a cold start.
- For an app’s own scheme, iOS first asks
Open in “<app>”?with Cancel and Open. The app gets the URL only after you tap Open:tap --text Open. APP_NOT_FOUND:no app on <udid> opens 'nosuchscheme://x'. Any other refusal isSIMCTL_FAILEDwith simctl’s message.
On an iPhone
Section titled “On an iPhone”Without --app, runs devicectl device process openURL. With it, runs devicectl device process launch --payload-url, with --app the bundle id.
APP_NOT_FOUND:no app on <UDID> opens 'nosuchscheme://x'without--app,app 'dev.karagoz.nope' is not installed on <UDID>with it.- A locked iPhone gives
DEVICE_NOT_READY. - Any other refusal is
DEVICECTL_FAILEDwith devicectl’s description and the phone’s reason.
MCP equivalent
Section titled “MCP equivalent”Arguments: url (required), app, device. The names are the CLI's option and positional names.
Related commands
Section titled “Related commands”- karagoz ui-tree
- Read the tree after the call to check that the app handled the URL.
- karagoz launch
- Checks
--appas a package name the same way, and times out the same way. - karagoz tap
- Tap Open on the iOS prompt for an app's own scheme.