From ec5a1f73f06763da47c06386aac729e8ee75d990 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Sat, 23 Mar 2024 17:31:03 -0700 Subject: [PATCH] feat: add appium:usePreinstalledWDA for real iOS 17 devices (#2350) * feat: add appium:usePreinstalledWDA for real iOS 17 devices * add Xcode 15 * add version --- docs/guides/run-preinstalled-wda.md | 19 +++++++++++++++---- package.json | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/docs/guides/run-preinstalled-wda.md b/docs/guides/run-preinstalled-wda.md index 2de286726..cecaedd25 100644 --- a/docs/guides/run-preinstalled-wda.md +++ b/docs/guides/run-preinstalled-wda.md @@ -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 @@ -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 @@ -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//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//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 @@ -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 diff --git a/package.json b/package.json index 2410f5e7a..88a3eb254 100644 --- a/package.json +++ b/package.json @@ -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",