UNPKG

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