Skip to content

Commit

Permalink
feat: add udid parameter to EmulatorConfig (#242)
Browse files Browse the repository at this point in the history
* feat: add udid parameter to EmulatorConfig

Co-Authored-By: [email protected] <[email protected]>

* feat: implement udid in EmulatorProvider createConfig

Co-Authored-By: [email protected] <[email protected]>

* Create blue-teachers-crash.md

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: [email protected] <[email protected]>
Co-authored-by: Pushpam Saxena <[email protected]>
  • Loading branch information
3 people authored Dec 19, 2024
1 parent 2a42ca7 commit f53d282
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/blue-teachers-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"appwright": patch
---

feat: add udid parameter to EmulatorConfig
2 changes: 2 additions & 0 deletions src/providers/emulator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ Follow the steps mentioned in ${androidSimulatorConfigDocLink} to run test on An

private async createConfig() {
const platformName = this.project.use.platform;
const udid = (this.project.use.device as EmulatorConfig).udid;
let appPackageName: string | undefined;
let appLaunchableActivity: string | undefined;

Expand All @@ -104,6 +105,7 @@ Follow the steps mentioned in ${androidSimulatorConfigDocLink} to run test on An
port: 4723,
capabilities: {
"appium:deviceName": this.project.use.device?.name,
"appium:udid": udid,
"appium:automationName":
platformName == Platform.ANDROID ? "uiautomator2" : "xcuitest",
"appium:platformVersion": (this.project.use.device as EmulatorConfig)
Expand Down
5 changes: 5 additions & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ export type EmulatorConfig = {
name?: string;
osVersion?: string;

/**
* The unique device identifier (UDID) of the emulator.
*/
udid?: string;

/**
* The orientation of the emulator.
* Default orientation is "portrait".
Expand Down

0 comments on commit f53d282

Please sign in to comment.