-
Notifications
You must be signed in to change notification settings - Fork 299
Getting Started with iOS Physical Device
We support iOS running on MacOS through this MCP. This means that you can control a simulated iOS device, by prompting the agent to do actions on your behalf, like chatting on WhatsApp.
Before the MCP server can control the iOS, we need to have WebDriverAgent running on the device. Also, go-ios is required to be installed, tunneling and port-forwarding.
-
Install
go-ioson your host.npm install -g go-ios -
Verify that you can see the device by running
ios list. (see Troubleshooting) -
Start tunnel with
ios tunnel start --userspace, keep this terminal open. -
Start port forwarding with
ios forward 8100 8100, keep this terminal open. -
Clone WebDriverAgent repo (if you haven't already):
git clone --depth 1 https://github.com/appium/WebDriverAgent.git cd WebDriverAgent open WebDriverAgent.xcodeproj -
Open
WebDriverAgent.xcodeprojfile with Xcode, and replace the Bundle Identifier with a unique one. You need to have an Apple developer account (You can enroll for free as an individual. Read more here.). Once done, click on "Test".
- Now try the prompt
list elements on my ios device. It should detect the iOS device, connect to WebdriverAgent and report back what's available on screen.
You may also start the test from command line using:
# Start WDA as an XCUITest, replace '000000000000000000000000' with your udid.
xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'platform=iOS,id=000000000000000000000000' test- I can't see my device with
ios list
- Make sure developer mode is enabled on the device, that the device is connected via usb, and that pairing was successful. You can run
ios pairto re-pair the device.
- When is Linux going to be supported?
- Very soon. It's a matter of documentation really. Once you get WebDriverAgent running on the device, then it should work for you already.
- Why do I need to run the tunnel and forwarding myself?
- Yes, it's annoying at the moment. This is on the roadmap, the mcp will run these in background for you.
From Mobile Next: We are building the future of mobile development 📱 🚀