UNPKG

appium-adb

Version:

Android Debug Bridge interface

141 lines 4.95 kB
import { SubProcess } from 'teen_process'; import type { ADB } from '../adb'; import type { ScreenrecordOptions } from './types'; /** * Get the path to adb executable amd assign it * to this.executable.path and this.binaries.adb properties. * * @return ADB instance. */ export declare function getAdbWithCorrectAdbPath(this: ADB): Promise<ADB>; /** * Get the full path to aapt tool and assign it to * this.binaries.aapt property */ export declare function initAapt(this: ADB): Promise<void>; /** * Get the full path to aapt2 tool and assign it to * this.binaries.aapt2 property */ export declare function initAapt2(this: ADB): Promise<void>; /** * Get the full path to zipalign tool and assign it to * this.binaries.zipalign property */ export declare function initZipAlign(this: ADB): Promise<void>; /** * Get the full path to bundletool binary and assign it to * this.binaries.bundletool property */ export declare function initBundletool(this: ADB): Promise<void>; /** * Retrieve the API level of the device under test. * * @return The API level as integer number, for example 21 for * Android Lollipop. The result of this method is cached, so all the further * calls return the same value as the first one. */ export declare function getApiLevel(this: ADB): Promise<number>; /** * Verify whether a device is connected. * * @return True if at least one device is visible to adb. */ export declare function isDeviceConnected(this: ADB): Promise<boolean>; /** * Clear the active text field on the device under test by sending * special keyevents to it. * * @param length - The maximum length of the text in the field to be cleared. */ export declare function clearTextField(this: ADB, length?: number): Promise<void>; /** * Send the special keycode to the device under test in order to emulate * Back button tap. */ export declare function back(this: ADB): Promise<void>; /** * Send the special keycode to the device under test in order to emulate * Home button tap. */ export declare function goToHome(this: ADB): Promise<void>; /** * @return the actual path to adb executable. */ export declare function getAdbPath(this: ADB): string; /** * Restart the device under test using adb commands. * * @throws {Error} If start fails. */ export declare function restart(this: ADB): Promise<void>; /** * Retrieve the `adb bugreport` command output. This * operation may take up to several minutes. * * @param timeout - Command timeout in milliseconds * @returns Command stdout */ export declare function bugreport(this: ADB, timeout?: number): Promise<string>; /** * Initiate screenrecord utility on the device * * @param destination - Full path to the writable media file destination * on the device file system. * @param options - Screenrecord options * @returns screenrecord process, which can be then controlled by the client code */ export declare function screenrecord(this: ADB, destination: string, options?: ScreenrecordOptions): SubProcess; /** * Retrieves the list of features supported by the device under test * * @returns the list of supported feature names or an empty list. * An example adb command output: * ``` * cmd * ls_v2 * fixed_push_mkdir * shell_v2 * abb * stat_v2 * apex * abb_exec * remount_shell * fixed_push_symlink_timestamp * ``` * @throws {Error} if there was an error while retrieving the list */ export declare function listFeatures(this: ADB): Promise<string[]>; /** * Checks the state of streamed install feature. * This feature allows to speed up apk installation * since it does not require the original apk to be pushed to * the device under test first, which also saves space. * Although, it is required that both the device under test * and the adb server have the mentioned functionality. * See https://github.com/aosp-mirror/platform_system_core/blob/master/adb/client/adb_install.cpp * for more details * * @returns `true` if the feature is supported by both adb and the * device under test */ export declare function isStreamedInstallSupported(this: ADB): Promise<boolean>; /** * Checks whether incremental install feature is supported by ADB. * Read https://developer.android.com/preview/features#incremental * for more details on it. * * @returns `true` if the feature is supported by both adb and the * device under test */ export declare function isIncrementalInstallSupported(this: ADB): Promise<boolean>; /** * Takes a screenshot of the given display or the default display. * * @param displayId A valid display identifier. If * no identifier is provided then the screenshot of the default display is returned. * Note that only recent Android APIs provide multi-screen support. * @returns PNG screenshot payload */ export declare function takeScreenshot(this: ADB, displayId?: number | string): Promise<Buffer>; //# sourceMappingURL=general-commands.d.ts.map