native-devtools-status
Verify if native devtools are connected to a specific app and if the next launch is prepared for injection, ensuring readiness before using other native tools.
Instructions
Check whether native devtools are connected to a specific app and whether the next launch is prepared for injection. Use when you need to verify native devtools readiness before calling native-full-hierarchy, native-describe-screen, or native-network-logs.
Returns { envSetup, appRunning, connected, requiresRestart, nextLaunchWillBeInjected, injectable }:
envSetup: DYLD_INSERT_LIBRARIES is configured in the simulator's launchd environment
appRunning: the target bundle currently has a running UIKit process on the simulator
connected: the dylib is active in the current running process for this bundleId
requiresRestart: the app is already running but its current process does not have native devtools injected (always false for a non-injectable app)
nextLaunchWillBeInjected: if you launch this bundle now, native devtools env setup is already in place (always false for a non-injectable app)
injectable: whether native devtools can ever be injected into this app. Apple system apps (bundle ids under com.apple.) are platform binaries with library validation, so the dylib can never load into them.
Call this before using app-scoped native hierarchy tools or native-network-logs.
If injectable is false: this is a TERMINAL state — the app can never be injected. Do NOT restart/retry. Use the standard describe tool (its accessibility path reads the screen without injection) or screenshot (then interact by coordinate). Do not fall back to the native-devtools feature tools (native-describe-screen, native-find-views, native-full-hierarchy, native-network-logs, native-view-at-point, native-user-interactable-view-at-point) — they run the same injection precheck and fail with the same non-injectable error.
If appRunning is false and nextLaunchWillBeInjected is true: use launch-app normally.
If requiresRestart is true: call restart-app, then proceed with the native feature.
Returns { status: "init_failed", message, attempts } instead when the simulator's native-devtools environment failed to initialize.
Fails if the simulator server is not running for the given UDID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| udid | Yes | Simulator UDID | |
| bundleId | Yes | Bundle ID of the app to check (e.g. com.example.MyApp) |