feat(browser): add iOS Simulator support to agent-browser#308
feat(browser): add iOS Simulator support to agent-browser#308marcusquinn merged 1 commit intomainfrom
Conversation
- Add iOS Simulator documentation with setup instructions - Add mobile-specific commands (tap, swipe up/down/left/right) - Add environment variables for iOS configuration - Add real device support documentation - Update platform support table with iOS column - Add iOS Mobile Testing pattern example - Update helper script with ios and devices commands - Add check_ios and install_ios functions to helper Upstream: vercel-labs/agent-browser#358
Summary of ChangesHello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly expands the capabilities of the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
WalkthroughThe pull request extends agent-browser with iOS Simulator support by introducing macOS-only functions for capability checking, Appium/XCUITest driver installation, and iOS device enumeration, along with comprehensive documentation covering setup, usage workflows, and environment variable configuration. Changes
Sequence DiagramsequenceDiagram
actor User
participant CLI as agent-browser CLI
participant Helper as helper.sh
participant System as macOS System
participant Xcode
participant npm
participant Appium
participant XCUITest
User->>CLI: agent-browser ios
CLI->>Helper: install_ios()
Helper->>System: Check macOS platform
System-->>Helper: ✓ macOS confirmed
Helper->>Xcode: Verify Xcode installation
alt Xcode installed
Xcode-->>Helper: ✓ Available
else Xcode missing
Helper-->>User: Error: Xcode required
end
Helper->>npm: Check Appium global install
alt Appium missing
Helper->>npm: npm install -g appium
npm-->>Appium: Install Appium
Appium-->>Helper: ✓ Installed
else Appium exists
Appium-->>Helper: ✓ Already present
end
Helper->>Appium: appium driver install xcuitest
Appium->>XCUITest: Install XCUITest driver
XCUITest-->>Helper: ✓ Driver ready
Helper-->>User: Quick-start guide + success
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly Related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
Code Review
This pull request introduces support for iOS Simulators to agent-browser, which is a significant feature enhancement. The changes include a helper script for managing iOS dependencies and new documentation explaining the setup and usage. The implementation is solid, with new shell functions for checking and installing dependencies, and comprehensive documentation updates. I've provided a few suggestions to improve the robustness of the shell script and the maintainability of the documentation. Overall, this is a well-executed feature addition.
| if [[ "$has_appium" == "true" && "$has_xcuitest" == "true" ]]; then | ||
| return 0 | ||
| else | ||
| return 1 | ||
| fi |
There was a problem hiding this comment.
The boolean check using string comparison [[ "$var" == "true" ]] is a bit verbose. Since the variables has_appium and has_xcuitest are assigned the string values true or false, you can directly use them as commands in an if statement for a more concise and idiomatic shell script.
| if [[ "$has_appium" == "true" && "$has_xcuitest" == "true" ]]; then | |
| return 0 | |
| else | |
| return 1 | |
| fi | |
| if $has_appium && $has_xcuitest; then | |
| return 0 | |
| else | |
| return 1 | |
| fi |
| ### iOS Simulator (macOS only) | ||
|
|
||
| Control real Mobile Safari in the iOS Simulator for authentic mobile web testing. | ||
|
|
||
| **Requirements:** | ||
|
|
||
| - macOS with Xcode installed | ||
| - Appium and XCUITest driver | ||
|
|
||
| ```bash | ||
| # Install Appium and XCUITest driver | ||
| npm install -g appium | ||
| appium driver install xcuitest | ||
| ``` |
There was a problem hiding this comment.
The installation instructions for Appium and the XCUITest driver are duplicated. They appear here and again in the main 'iOS Simulator' section later in the document (lines 375-381). While this can be convenient for the user, it creates a maintenance burden. Consider keeping the instructions in one place (preferably the main 'iOS Simulator' section) and referencing them from here to avoid inconsistencies in the future.
|
|
||
| ```bash | ||
| # Open the WebDriverAgent Xcode project | ||
| cd ~/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent |
There was a problem hiding this comment.
The hardcoded path to appium-webdriveragent can be brittle and might change depending on the npm version, global installation directory, or appium version. It would be helpful to add a note for the user, mentioning this possibility and perhaps suggesting a way to locate the WebDriverAgent.xcodeproj file if it's not in the documented path (e.g., using find or mdfind).
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Wed Feb 4 04:58:53 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.agent/scripts/agent-browser-helper.sh:
- Around line 85-90: The script currently runs the `appium driver list` check
even when Appium isn't installed; modify the block around the existing `if
appium driver list ...` so you first test for the Appium binary (e.g., `command
-v appium` or `which appium`) and if missing call `print_warning` to indicate
Appium is not installed and skip the XCUITest check, otherwise run `appium
driver list` as before and set `has_xcuitest=true` / `print_success` or
`print_warning` based on the grep result.
🧹 Nitpick comments (3)
.agent/scripts/agent-browser-helper.sh (1)
159-161: Exit code doesn't reflect command failures.The function always returns 0, even if both
agent-browser device listandxcrun simctl listfail. Per the coding guidelines for automation scripts, proper exit codes should reflect actual outcomes.♻️ Proposed fix to propagate failure status
print_info "Available iOS devices:" - agent-browser device list 2>/dev/null || xcrun simctl list devices available - return 0 + if agent-browser device list 2>/dev/null; then + return 0 + elif xcrun simctl list devices available; then + return 0 + else + print_error "Failed to list iOS devices" + return 1 + fi }.agent/tools/browser/agent-browser.md (2)
84-97: Duplicate setup instructions exist in the iOS Simulator section.The installation commands here are repeated in lines 377-381. Per the progressive disclosure guideline, consider keeping detailed setup in one location and using a pointer from the other.
📝 Suggested consolidation
Keep the detailed setup in the "iOS Simulator" section (line 375) and simplify this to a pointer:
### iOS Simulator (macOS only) Control real Mobile Safari in the iOS Simulator for authentic mobile web testing. -**Requirements:** - -- macOS with Xcode installed -- Appium and XCUITest driver - -```bash -# Install Appium and XCUITest driver -npm install -g appium -appium driver install xcuitest -``` +**Requirements:** macOS with Xcode, Appium, XCUITest driver. See [iOS Simulator Setup](`#setup`) for installation steps.
440-444: WebDriverAgent path may vary based on Appium installation method.The path
~/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragentassumes npm global installation. Users who installed Appium differently (e.g., via npx, local project, or Homebrew) will have the project elsewhere.Consider adding a note about finding the actual path:
# Open the WebDriverAgent Xcode project +# Find your Appium installation path first: +# appium driver run xcuitest open-wda +# or locate it manually: cd ~/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent open WebDriverAgent.xcodeproj
| if appium driver list 2>/dev/null | grep -q "xcuitest"; then | ||
| has_xcuitest=true | ||
| print_success "XCUITest driver is installed" | ||
| else | ||
| print_warning "XCUITest driver not installed" | ||
| fi |
There was a problem hiding this comment.
XCUITest check runs even when Appium is not installed.
Line 85 executes appium driver list regardless of whether Appium is installed. When Appium is missing, this produces a "command not found" error (suppressed to /dev/null) and incorrectly reports "XCUITest driver not installed" instead of indicating that the prerequisite (Appium) is missing.
🛠️ Proposed fix to skip XCUITest check when Appium is missing
if command -v appium &> /dev/null; then
has_appium=true
print_success "Appium is installed"
else
print_warning "Appium not installed"
fi
- if appium driver list 2>/dev/null | grep -q "xcuitest"; then
- has_xcuitest=true
- print_success "XCUITest driver is installed"
- else
- print_warning "XCUITest driver not installed"
+ if [[ "$has_appium" == "true" ]]; then
+ if appium driver list 2>/dev/null | grep -q "xcuitest"; then
+ has_xcuitest=true
+ print_success "XCUITest driver is installed"
+ else
+ print_warning "XCUITest driver not installed"
+ fi
fi🤖 Prompt for AI Agents
In @.agent/scripts/agent-browser-helper.sh around lines 85 - 90, The script
currently runs the `appium driver list` check even when Appium isn't installed;
modify the block around the existing `if appium driver list ...` so you first
test for the Appium binary (e.g., `command -v appium` or `which appium`) and if
missing call `print_warning` to indicate Appium is not installed and skip the
XCUITest check, otherwise run `appium driver list` as before and set
`has_xcuitest=true` / `print_success` or `print_warning` based on the grep
result.


Summary
Changes
Documentation (
agent-browser.md)Helper Script (
agent-browser-helper.sh)check_ios()function to verify Appium and XCUITest installationinstall_ios()function to install iOS dependencieslist_devices()function to list available iOS simulatorsiosanddevicescommands to main entry pointstatus()to show iOS support status on macOSUpstream Reference
This documents the iOS support added in vercel-labs/agent-browser#358
Testing
Summary by CodeRabbit
iosfor iOS environment setup anddevicesfor listing available simulators.