A 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.
Note: Issue tracking for this repo has been disabled. Please use the main Appium issue tracker instead.
npm install appium-adbnpm run watchnpm run testBy default the functional tests use an avd named NEXUS_S_18_X86, with API Level
18. To change this, you can use the environment variables PLATFORM_VERSION,
API_LEVEL, and ANDROID_AVD. If PLATFORM_VERSION is set then it is not
necessary to set API_LEVEL as it will be inferred.
gulp e2e-testexample:
import ADB from 'appium-adb';
let adb = new ADB();
await adb.createADB();
console.log(await adb.getPIDsByName('m.android.phone'));createADBinitJarsgetAdbWithCorrectAdbPathinitAaptinitZipAligngetApiLevelisDeviceConnectedmkdirisValidClassforceStopclearstopAndClearavailableIMEsenabledIMEsenableIMEdisableIMEsetIMEdefaultIMEkeyeventlockbackgoToHomeisScreenLockedisSoftKeyboardPresentsendTelnetCommandisAirplaneModeOnsetAirplaneModebroadcastAirplaneModeisWifiOnsetWifiStateisDataOnsetDataStatesetWifiAndDatarimrafpushpullprocessExistsforwardPortforwardAbstractPortpingrestartstartLogcatstopLogcatgetLogcatLogsgetPIDsByNamekillProcessesByNamekillProcessByPIDbroadcastProcessEndbroadcastendAndroidCoverageinstrumentandroidCoverageprocessFromManifestpackageAndLaunchActivityFromManifestcompileManifestinsertManifesthasInternetPermissionFromManifestgetSdkBinaryPathgetCommandForOSgetBinaryFromSdkRootgetBinaryFromPathgetConnectedDevicesgetDevicesWithRetryrestartAdbadbExecshellgetAdbServerPortgetEmulatorPortgetPortFromEmulatorStringgetConnectedEmulatorssetEmulatorPortsetDeviceIdgetRunningAVDgetRunningAVDWithRetrykillAllEmulatorslaunchAVDwaitForEmulatorReadywaitForDevicerebootsignWithDefaultCertsignWithCustomCertsignzipAlignApkcheckApkCertcheckCustomApkCertgetKeystoreMd5checkApkKeystoreMatchisAppInstalledstartAppstartUrigetFocusedPackageAndActivitywaitForActivityOrNotwaitForActivitywaitForNotActivityuninstallApkinstallFromDevicePathinstallfingerprint(ApiLevel >=23)
