Skip to content

Commit

Permalink
feat: add appium:usePreinstalledWDA for real iOS 17 devices (#2350)
Browse files Browse the repository at this point in the history
* feat: add appium:usePreinstalledWDA for real iOS 17 devices

* add Xcode 15

* add version
  • Loading branch information
KazuCocoa authored Mar 24, 2024
1 parent b4226d2 commit ec5a1f7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
19 changes: 15 additions & 4 deletions docs/guides/run-preinstalled-wda.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ command execution, improving the session startup performance.

!!! warning

This method currently does not work natively for iOS 17/tvOS 17 due to platform changes.
Please use the default `xcodebuild` approach or 3rd party tools such as `pymobiledevice3`.
This method currently works over `devicectl` for iOS 17+ with Xcode 15+ since XCUITest driver v7.5.0.
This may not work for tvOS 17+.

## Capabilities

Expand All @@ -27,7 +27,7 @@ Running a test for the WDA package in Xcode is the easiest way to prepare the de

1. Open WebDriverAgent project in Xcode
- You can run `appium driver run xcuitest open-wda` if using XCUITest driver 4.13 or newer
2. Select the _WebDriverAgentRunner_ scheme
2. Select the _WebDriverAgentRunner_ scheme
3. Select the scheme as _Product -> Scheme -> WebDriverAgentRunner_ (or _WebDriverAgentRunner\_tvOS_ for tvOS)
4. Select your device in _Product -> Destination_
5. Select _Product -> Test_ to build and install the WDA app
Expand All @@ -45,6 +45,17 @@ The WDA app package (`WebDriverAgentRunner-Runner.app`) can be generated in the
directory, as explained in [Manual Configuration for a Generic Device](../preparation/prov-profile-generic-manual.md).
The app can then be installed without `xcodebuild` using the 3rd party tools.


### Additional requirement for iOS 17+/tvOS17+

To launch the WebDriverAgentRunner package with `xcrun devicectl device process launch` it should not have `Frameworks/XC**` files.

For example, after building the WebDriverAgent with Xcode with proper sign, it generates `/Users/<user>/Library/Developer/Xcode/DerivedData/WebDriverAgent-ezumztihszjoxgacuhatrhxoklbh/Build/Products/Debug-appletvos/WebDriverAgentRunner-Runner.app`.
Then you can remove `Frameworks/XC**` in `WebDriverAgentRunner-Runner.app` like `rm Frameworks/WebDriverAgentRunner-Runner.app/XC**`.

Configuring `appium:prebuiltWDAPath` to the `/Users/<user>/Library/Developer/Xcode/DerivedData/WebDriverAgent-ezumztihszjoxgacuhatrhxoklbh/Build/Products/Debug-appletvos/WebDriverAgentRunner-Runner.app` would install the `WebDriverAgentRunner-Runner.app`, which has no `Frameworks/XC**` to the target device and launch it with `devicectl` command as part of `appium:usePreinstalledWDA` functionality.


## Launch the Session

After installing the `WebDriverAgentRunner-Runner` application, you can start the Appium server
Expand Down Expand Up @@ -113,7 +124,7 @@ driver.quit
`com.apple.dt.testmanagerd.runner`. It causes an unexpected WDA process crash with embedded
XCTest frameworks while running a single WebDriverAgent package on various OS environments
without `xcodebuild`.

Since WDA v5.10.0, the module can refer to the device's local XCTest frameworks. It lets the
Appium/WebDriverAgent package use proper dependencies for the device with a single prebuilt
WebDriverAgent package. To set this up, you should remove the package internal frameworks from
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"appium-ios-device": "^2.5.4",
"appium-ios-simulator": "^5.5.1",
"appium-remote-debugger": "^11.0.0",
"appium-webdriveragent": "^7.2.0",
"appium-webdriveragent": "^7.3.0",
"appium-xcode": "^5.1.4",
"async-lock": "^1.4.0",
"asyncbox": "^3.0.0",
Expand Down

0 comments on commit ec5a1f7

Please sign in to comment.