Repository navigation
feat: pass arguments and environment variables to apps launch - #531
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
3ae1c94 to
8d6aee7
Compare
apps launch takes repeatable --arg and --env KEY=VALUE flags. On a real iOS device they go through ProcessControl, on a simulator as simctl launch arguments and SIMCTL_CHILD_ variables. Android has no app arguments or environment, so both are rejected there. The device.apps.launch JSON-RPC method accepts the same as args and env.
Each --arg on Android must be key=value and becomes am start --es key value, which the app reads from its launch intent. An argument without '=' is an error. --env stays iOS-only.
8d6aee7 to
15f94aa
Compare
Adds launch arguments and environment variables to
apps launch, for the "App launch options" roadmap item (mobile-next/mobile-mcp#370).--argcan be repeated.--env KEY=VALUEcan also be repeated. Values may contain=or be empty.LaunchAppWithArgs).simctl launch, and env vars are passed asSIMCTL_CHILD_<KEY>.--argmust bekey=valueand becomes a string intent extra,am start --es key value. The app reads it from its launch intent (getIntent().getStringExtra("key")). An argument without=is an error.--envis an error because Android apps have no environment.device.apps.launchJSON-RPC method acceptsargs(string[]) andenv(object).RemoteDeviceforwards both.Testing
simctlLaunchArgs,simctlLaunchEnv,launchExtras,launchArgswith extras,parseLaunchEnv, and the Android rejections.ps ewwon the launched Settings process shows-AppleLanguages (he)as arguments andFOO=barin its environment.--arg "mcpFlag=hello world; echo pwned"succeeds, anddumpsys activityshows the intent(has extras). The value stays one shell-quoted word.--arg -FeatureXis rejected.Summary by CodeRabbit
key=valueintent extras.key=valueformat.=sign.