-
-
Notifications
You must be signed in to change notification settings - Fork 424
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update build-wda script to a regular file
We can't rely on directory hierarchies to find the script within WDA. Also, it turns out that what we wanted out of this script was different anyway.
- Loading branch information
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { WebDriverAgent } from 'appium-webdriveragent'; | ||
import { translateDeviceName, getAndCheckXcodeVersion, getAndCheckIosSdkVersion } from './utils'; | ||
import { getExistingSim } from './simulator-management'; | ||
import { asyncify } from 'asyncbox'; | ||
|
||
const DEFAULT_SIM_NAME = 'iPhone 12'; | ||
|
||
// TODO: allow passing in all the various build params as CLI args | ||
async function build () { | ||
const xcodeVersion = await getAndCheckXcodeVersion(); | ||
const iosVersion = await getAndCheckIosSdkVersion(); | ||
const deviceName = translateDeviceName(iosVersion, DEFAULT_SIM_NAME); | ||
const device = await getExistingSim({ | ||
platformVersion: iosVersion, | ||
deviceName | ||
}); | ||
const wda = new WebDriverAgent(xcodeVersion, { | ||
iosSdkVersion: iosVersion, | ||
platformVersion: iosVersion, | ||
showXcodeLog: true, | ||
device, | ||
}); | ||
await wda.xcodebuild.start(true); | ||
} | ||
|
||
if (require.main === module) { | ||
asyncify(build); | ||
} | ||
|
||
export default build; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters