feat: support app launch arguments and feature flags - #388
Conversation
Add an optional launchArgs parameter to mobile_launch_app while preserving existing launch behavior when arguments are absent. - pass argument pairs through Android intent extras, go-ios, and simctl - keep mobilecli for normal simulator launches and use simctl only for non-empty launch arguments - validate inputs before side effects, reject NUL values, and quote Android remote-shell values - cover Android, iOS, simulator, and MCP launch boundaries Relates to mobile-next#370
WalkthroughAdds optional string launch arguments to the Robot interface and MCP 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/android.ts (1)
181-200: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win
resolveLauncherActivitythrows on any ambiguity, unlike themonkey-based fallback.Apps with more than one
LAUNCHER-category activity/alias (multiple icons, deep-link aliases) launch fine viamonkey(used when nolaunchArgs), but will now fail with "Could not resolve a launchable activity" as soon aslaunchArgsare supplied, sinceam start -nrequires exactly one match here.Consider falling back to the first resolved component instead of throwing when there are multiple candidates, to keep behavior closer to the
monkeypath.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/android.ts` around lines 181 - 200, Update resolveLauncherActivity to return the first valid component when multiple launcher activities are resolved, instead of throwing for components.length greater than one. Continue throwing the existing ActionableError when no valid components are found, and preserve the current command-error handling.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/android.ts`:
- Around line 181-200: Update resolveLauncherActivity to return the first valid
component when multiple launcher activities are resolved, instead of throwing
for components.length greater than one. Continue throwing the existing
ActionableError when no valid components are found, and preserve the current
command-error handling.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 8844df6e-6006-492c-ad1d-7dc71db87260
📒 Files selected for processing (9)
README.mdsrc/android.tssrc/ios.tssrc/iphone-simulator.tssrc/mobile-device.tssrc/robot.tssrc/server.tssrc/utils.tstest/launch-args.test.ts
|
@wxxion great prs! all three, I'll review them in the next few days and I'll merge. thank you so much! |
Add an optional launchArgs parameter to mobile_launch_app while preserving existing launch behavior when arguments are absent.
Relates to #370