Skip to content

feat(browser): add iOS Simulator support to agent-browser#308

Merged
marcusquinn merged 1 commit intomainfrom
feature/agent-browser-ios-support
Feb 4, 2026
Merged

feat(browser): add iOS Simulator support to agent-browser#308
marcusquinn merged 1 commit intomainfrom
feature/agent-browser-ios-support

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Feb 4, 2026

Summary

  • Add iOS Simulator support documentation to agent-browser
  • Add helper script commands for iOS setup and device listing
  • Update platform support table with iOS compatibility

Changes

Documentation (agent-browser.md)

  • Added iOS Support mention in Quick Reference
  • Added iOS Simulator installation section with Appium/XCUITest setup
  • Added comprehensive iOS Simulator section with:
    • Setup instructions
    • Usage examples (device list, open, snapshot, tap, fill, swipe, close)
    • Environment variables table
    • Real device support with WebDriverAgent signing instructions
  • Updated Platform Support table with iOS Support column
  • Added iOS Mobile Testing pattern in Common Patterns section

Helper Script (agent-browser-helper.sh)

  • Added check_ios() function to verify Appium and XCUITest installation
  • Added install_ios() function to install iOS dependencies
  • Added list_devices() function to list available iOS simulators
  • Added ios and devices commands to main entry point
  • Updated status() to show iOS support status on macOS
  • Updated help text with iOS examples

Upstream Reference

This documents the iOS support added in vercel-labs/agent-browser#358

Testing

  • ShellCheck passes on helper script
  • Documentation renders correctly
  • Commands work on macOS with Xcode installed

Summary by CodeRabbit

  • New Features
    • Added iOS Simulator support to agent-browser with macOS platform requirements and capability validation.
    • Introduced new CLI commands: ios for iOS environment setup and devices for listing available simulators.
    • Enabled comprehensive iOS mobile testing with commands including snapshot, tap, fill, screenshot, and swipe operations.
    • Provided complete iOS testing documentation covering configuration, environment variables, and real device guidance.

- 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
@gemini-code-assist
Copy link

Summary of Changes

Hello @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 agent-browser tool by integrating full support for iOS devices, including both simulators and real devices. This enables users to perform mobile web testing and automation on the Apple ecosystem, providing a more versatile and comprehensive browser automation solution. The changes include new helper script commands for easier setup and device management, along with extensive documentation to guide users through the new iOS features.

Highlights

  • iOS Simulator Support: Introduced comprehensive support for iOS Simulators in agent-browser, allowing control of Mobile Safari for mobile web testing.
  • Helper Script Enhancements: Added new commands (ios, devices) and functions (check_ios, install_ios, list_devices) to the agent-browser-helper.sh script for managing iOS dependencies and listing devices.
  • Updated Documentation: The agent-browser.md documentation has been significantly updated to include detailed setup instructions, usage examples, environment variables, and real device support for iOS.
  • Platform Support Table: The platform support table in the documentation now explicitly lists iOS compatibility for macOS ARM64 and x64.
Changelog
  • .agent/scripts/agent-browser-helper.sh
    • Added check_ios() function to verify Appium and XCUITest installation status.
    • Implemented install_ios() function to automate the installation of Appium and its XCUITest driver.
    • Added list_devices() function to display available iOS simulators.
    • Integrated ios and devices commands into the main script entry point for direct execution.
    • Updated the status() function to include a check for iOS support on macOS.
    • Extended help text and examples to reflect the newly added iOS commands and functionalities.
  • .agent/tools/browser/agent-browser.md
    • Added a quick reference mention for iOS support in the introduction.
    • Included a new detailed section for iOS Simulator, covering setup, requirements, and usage examples.
    • Documented environment variables (AGENT_BROWSER_PROVIDER, AGENT_BROWSER_IOS_DEVICE, AGENT_BROWSER_IOS_UDID) for configuring iOS mode.
    • Provided instructions for real iOS device support, including steps for obtaining device UDID and signing WebDriverAgent.
    • Updated the 'Platform Support' table with a new 'iOS Support' column, indicating compatibility for macOS.
    • Added an 'iOS Mobile Testing' pattern in the 'Common Patterns' section with relevant command examples.
Activity
  • No human activity (comments, reviews, or progress updates) has been recorded for this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 4, 2026

Walkthrough

The 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

Cohort / File(s) Summary
iOS Installation & Device Management
.agent/scripts/agent-browser-helper.sh
Added three functions: check_ios (validates Appium and XCUITest presence), install_ios (macOS-only flow verifying Xcode, installing Appium globally via npm, and setting up XCUITest driver with quick-start guide), and list_devices (enumerates iOS simulators). Extended main CLI dispatcher with ios and devices command routing.
iOS Documentation
.agent/tools/browser/agent-browser.md
Introduced iOS Simulator section with setup prerequisites (macOS, Xcode, Appium, XCUITest), usage examples, environment variables (AGENT_BROWSER_PROVIDER, AGENT_BROWSER_IOS_DEVICE, AGENT_BROWSER_IOS_UDID), and real device guidance. Updated Platform Support table to include iOS capability matrix. Added mobile-specific workflows (open, snapshot, tap, fill, screenshot, swipe, close) with parity examples to desktop commands.

Sequence Diagram

sequenceDiagram
    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
Loading

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly Related PRs

Poem

🍎 From macOS mountains to simulator seas,
iOS support now flows with such ease,
Xcode and Appium in graceful ballet,
XCUITest drivers light the way,
Agent-browser expands its mighty reach today! 🚀

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(browser): add iOS Simulator support to agent-browser' directly and specifically summarizes the main change: adding iOS Simulator support to agent-browser, which is reflected across both the script additions and documentation updates.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/agent-browser-ios-support

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 4, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +92 to +96
if [[ "$has_appium" == "true" && "$has_xcuitest" == "true" ]]; then
return 0
else
return 1
fi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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

Comment on lines +84 to +97
### 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
```

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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).

@github-actions
Copy link

github-actions bot commented Feb 4, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 2 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Wed Feb 4 04:57:29 UTC 2026: Code review monitoring started
Wed Feb 4 04:57:29 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 2
Wed Feb 4 04:57:29 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Wed Feb 4 04:57:31 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 2
  • VULNERABILITIES: 0

Generated on: Wed Feb 4 04:58:53 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 list and xcrun simctl list fail. 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-webdriveragent assumes 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

Comment on lines +85 to +90
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

@marcusquinn marcusquinn merged commit 693914d into main Feb 4, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant