Skip to content

Commit

Permalink
feat: Add a script to open WDA in Xcode (#1457)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach authored Dec 1, 2022
1 parent 401092f commit e2255fe
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/real-device-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
14 changes: 14 additions & 0 deletions scripts/open-wda.js
Original file line number Diff line number Diff line change
@@ -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())();

0 comments on commit e2255fe

Please sign in to comment.