Skip to content
karagöz docs
Star4npm0.5.1

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
~/app
karagoz open-url <url> [--app <id>] [--device <id>]

A deep link looks like myapp://item/42.

  • 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).
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
~/app
karagoz open-url https://example.com
{"device":"emulator-5554","url":"https://example.com"}exit 0
{
"device": "emulator-5554",
"url": "https://example.com"
}
device string
The adb serial, or the simulator's or iPhone's UDID.
url string
The URL as given.
app string
Only when --app was given: the package name or bundle id from --app.
CodeWhen
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_FOUNDWithout --app: no app on emulator-5554 opens 'nosuchscheme://x'. With it: package 'dev.karagoz.nope' is not installed on emulator-5554.
APP_NOT_LAUNCHABLEpackage 'com.android.shell' has no activity that opens 'myapp://x'. The app is installed but declares nothing for this URL.
ADB_FAILEDAndroid refused the start. The message is Android's Error: line.
ADB_TIMEOUTAfter 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 0 means 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-url exits 0.
  • An https URL opens the app that owns the domain only when that app is verified for it. Otherwise the browser opens it.
  • open-url never restarts the app. If it is in front, the URL goes to the running app.

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 is SIMCTL_FAILED with simctl’s message.

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_FAILED with devicectl’s description and the phone’s reason.
MCP equivalentopen_url {"url":"https://example.com"}MCP tools

Arguments: url (required), app, device. The names are the CLI's option and positional names.

karagoz ui-tree
Read the tree after the call to check that the app handled the URL.
karagoz launch
Checks --app as 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.