diff --git a/docs/real-device-config.md b/docs/real-device-config.md index b54254abc..3cad052a4 100644 --- a/docs/real-device-config.md +++ b/docs/real-device-config.md @@ -244,3 +244,5 @@ echo "$(dirname "$(find "$HOME/.appium" -name WebDriverAgent.xcodeproj)")" ``` The resulting output will contain the full path to WDA's source folder. + +Since XCUITest driver v4.13.0 there is a possibility to open `WebDriverAgent.xcodeproj` in Xcode by simply executing `appium driver run xcuitest open-wda` command. diff --git a/package.json b/package.json index 2f9f68cc7..a3ae7609a 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,8 @@ ], "mainClass": "XCUITestDriver", "scripts": { - "build-wda": "./build/lib/build-wda.js" + "build-wda": "./build/lib/build-wda.js", + "open-wda": "./scripts/open-wda.js" }, "schema": { "$schema": "http://json-schema.org/draft-07/schema", @@ -77,6 +78,7 @@ "asyncbox": "^2.3.1", "bluebird": "^3.5.1", "css-selector-parser": "^1.4.1", + "fancy-log": "^2.0.0", "js2xmlparser2": "^0.x", "lodash": "^4.17.10", "lru-cache": "^7.0.1", diff --git a/scripts/open-wda.js b/scripts/open-wda.js new file mode 100644 index 000000000..e0c662757 --- /dev/null +++ b/scripts/open-wda.js @@ -0,0 +1,14 @@ +const path = require('path'); +const { exec } = require('teen_process'); +const log = require('fancy-log'); +const { BOOTSTRAP_PATH } = require('appium-webdriveragent'); +const XCODEPROJ_NAME = 'WebDriverAgent.xcodeproj'; + + +async function openWda () { + const dstPath = path.resolve(BOOTSTRAP_PATH, XCODEPROJ_NAME); + log.info(`Opening '${dstPath}'`); + await exec('open', [dstPath]); +} + +(async () => await openWda())();