UNPKG

3.65 kBMarkdownView Raw
1appium-adb
2==========
3
4[![NPM version](http://img.shields.io/npm/v/appium-adb.svg)](https://npmjs.org/package/appium-adb)
5[![Downloads](http://img.shields.io/npm/dm/appium-adb.svg)](https://npmjs.org/package/appium-adb)
6[![Dependency Status](https://david-dm.org/appium/appium-adb.svg)](https://david-dm.org/appium/appium-adb)
7[![devDependency Status](https://david-dm.org/appium/appium-adb/dev-status.svg)](https://david-dm.org/appium/appium-adb#info=devDependencies)
8
9[![Build Status](https://api.travis-ci.org/appium/appium-adb.png?branch=master)](https://travis-ci.org/appium/appium-adb)
10
11A wrapper over android-adb, implemented using ES6 and along with `async/await`. This package is mainly used by Appium to perform all adb operations on android device.
12
13*Note*: Issue tracking for this repo has been disabled. Please use the [main Appium issue tracker](https://github.com/appium/appium/issues) instead.
14
15## Installing
16
17```bash
18npm install appium-adb
19```
20
21## Watch
22
23```bash
24npm run watch
25```
26
27## Test
28
29### unit tests
30
31```bash
32npm run test
33```
34
35### functional tests
36
37By default the functional tests use an avd named `NEXUS_S_18_X86`, with API Level
3818. To change this, you can use the environment variables `PLATFORM_VERSION`,
39`API_LEVEL`, and `ANDROID_AVD`. If `PLATFORM_VERSION` is set then it is not
40necessary to set `API_LEVEL` as it will be inferred.
41
42```bash
43gulp e2e-test
44```
45
46## Usage:
47
48example:
49
50```js
51import ADB from 'appium-adb';
52
53const adb = await ADB.createADB();
54console.log(await adb.getPIDsByName('com.android.phone'));
55```
56
57### List of methods:
58
59- `createADB`
60- `getAdbWithCorrectAdbPath`
61- `initAapt`
62- `initZipAlign`
63- `getApiLevel`
64- `isDeviceConnected`
65- `mkdir`
66- `isValidClass`
67- `forceStop`
68- `clear`
69- `stopAndClear`
70- `availableIMEs`
71- `enabledIMEs`
72- `enableIME`
73- `disableIME`
74- `setIME`
75- `defaultIME`
76- `keyevent`
77- `lock`
78- `back`
79- `goToHome`
80- `isScreenLocked`
81- `isSoftKeyboardPresent`
82- `sendTelnetCommand`
83- `isAirplaneModeOn`
84- `setAirplaneMode`
85- `broadcastAirplaneMode`
86- `isWifiOn`
87- `getScreenSize`
88- `getScreenDensity`
89- `setWifiState`
90- `isDataOn`
91- `setDataState`
92- `setWifiAndData`
93- `rimraf`
94- `push`
95- `pull`
96- `processExists`
97- `forwardPort`
98- `reversePort` (ApiLevel >=21)
99- `forwardAbstractPort`
100- `ping`
101- `restart`
102- `startLogcat`
103- `stopLogcat`
104- `getLogcatLogs`
105- `getPIDsByName`
106- `killProcessesByName`
107- `killProcessByPID`
108- `broadcastProcessEnd`
109- `broadcast`
110- `endAndroidCoverage`
111- `instrument`
112- `androidCoverage`
113- `packageAndLaunchActivityFromManifest`
114- `compileManifest`
115- `insertManifest`
116- `hasInternetPermissionFromManifest`
117- `getSdkBinaryPath`
118- `getBinaryFromSdkRoot`
119- `getBinaryFromPath`
120- `getConnectedDevices`
121- `getDevicesWithRetry`
122- `restartAdb`
123- `adbExec`
124- `shell`
125- `getAdbServerPort`
126- `getEmulatorPort`
127- `getPortFromEmulatorString`
128- `getConnectedEmulators`
129- `setEmulatorPort`
130- `setDeviceId`
131- `getRunningAVD`
132- `getRunningAVDWithRetry`
133- `killAllEmulators`
134- `launchAVD`
135- `waitForEmulatorReady`
136- `waitForDevice`
137- `reboot`
138- `signWithDefaultCert`
139- `signWithCustomCert`
140- `sign`
141- `zipAlignApk`
142- `checkApkCert`
143- `checkCustomApkCert`
144- `getKeystoreHash`
145- `isAppInstalled`
146- `startApp`
147- `startUri`
148- `getFocusedPackageAndActivity`
149- `waitForActivityOrNot`
150- `waitForActivity`
151- `waitForNotActivity`
152- `uninstallApk`
153- `installFromDevicePath`
154- `install`
155- `fingerprint` (ApiLevel >=23 | emulator only)
156- `sendSMS` (emulator only)
157- `rotate` (emulator only)
158- `powerAC` (emulator only)
159- `powerCapacity` (emulator only)
160- `powerOFF` (emulator only)
161- `gsmCall` (emulator only)
162- `gsmSignal` (emulator only)
163- `gsmVoice` (emulator only)
164- `root`
165- `unroot`