-
-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathandroid.ts
More file actions
26 lines (23 loc) · 792 Bytes
/
android.ts
File metadata and controls
26 lines (23 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { AndroidUiautomator2Driver } from 'appium-uiautomator2-driver';
import type { AppiumFlutterDriver } from './driver';
import type ADB from 'appium-adb';
export async function startAndroidSession(
this: AppiumFlutterDriver,
...args: any[]
): Promise<AndroidUiautomator2Driver> {
this.log.info(`Starting an Android proxy session`);
const androiddriver = new AndroidUiautomator2Driver();
//@ts-ignore Args are ok
await androiddriver.createSession(...args);
return androiddriver;
}
export async function androidPortForward(
adb: ADB,
systemPort: number,
devicePort: number,
) {
await adb.forwardPort(systemPort!, devicePort);
}
export async function androidRemovePortForward(adb: ADB, systemPort: number) {
await adb.removePortForward(systemPort);
}