1.0.7 • Published 2 years ago
ait-adb
Licence
—
Version
1.0.7
Deps
12
Size
1.0 MB
Vulns
0
Weekly
0
ait-adb
Installing
npm install https://github.com/ait-software/ait-adb
Watch
npm run dev
Test
unit tests
npm run test
functional tests
By 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.
npm run e2e-test
Usage:
example:
import ADB from 'ait-adb';
const adb = await ADB.createADB();
console.log(await adb.getPIDsByName('com.android.phone'));
List of methods:
createADBgetAdbWithCorrectAdbPathinitAaptinitZipAligngetApiLevelisDeviceConnectedmkdirisValidClassforceStopclearstopAndClearavailableIMEsenabledIMEsenableIMEdisableIMEsetIMEdefaultIMEkeyeventlockbackgoToHomeisScreenLockedisSoftKeyboardPresentsendTelnetCommandisAirplaneModeOnsetAirplaneModebroadcastAirplaneModeisWifiOngetScreenSizegetScreenDensitysetWifiStateisDataOnsetDataStatesetWifiAndDatarimrafpushpullprocessExistsforwardPortreversePort(ApiLevel >=21)forwardAbstractPortpingrestartstartLogcatstopLogcatgetLogcatLogsgetPIDsByNamekillProcessesByNamekillProcessByPIDbroadcastProcessEndbroadcastpackageAndLaunchActivityFromManifestcompileManifestinsertManifesthasInternetPermissionFromManifestgetSdkBinaryPathgetBinaryFromSdkRootgetBinaryFromPathgetConnectedDevicesgetDevicesWithRetryrestartAdbadbExecshellgetAdbServerPortgetEmulatorPortgetPortFromEmulatorStringgetConnectedEmulatorssetEmulatorPortsetDeviceIdgetRunningAVDgetRunningAVDWithRetrykillAllEmulatorslaunchAVDwaitForEmulatorReadywaitForDevicerebootsignWithDefaultCertsignWithCustomCertsignzipAlignApkcheckApkCertcheckCustomApkCertgetKeystoreHashisAppInstalledstartAppstartUrigetFocusedPackageAndActivitywaitForActivityOrNotwaitForActivitywaitForNotActivityuninstallApkinstallFromDevicePathinstallfingerprint(ApiLevel >=23 | emulator only)sendSMS(emulator only)rotate(emulator only)powerAC(emulator only)powerCapacity(emulator only)powerOFF(emulator only)gsmCall(emulator only)gsmSignal(emulator only)gsmVoice(emulator only)rootunroot