appium-adb
Version:
Android Debug Bridge interface
137 lines • 5.25 kB
TypeScript
import type { ADB } from '../adb';
import type { EmuVersionInfo, StringRecord, PowerAcStates, Sensors, GsmCallActions, GsmSignalStrength, GsmVoiceStates, NetworkSpeed, ExecTelnetOptions } from './types';
/**
* Check the emulator state.
*
* @returns True if Emulator is visible to adb.
*/
export declare function isEmulatorConnected(this: ADB): Promise<boolean>;
/**
* Verify the emulator is connected.
*
* @throws If Emulator is not visible to adb.
*/
export declare function verifyEmulatorConnected(this: ADB): Promise<void>;
/**
* Emulate fingerprint touch event on the connected emulator.
*
* @param fingerprintId - The ID of the fingerprint.
*/
export declare function fingerprint(this: ADB, fingerprintId: string): Promise<void>;
/**
* Change the display orientation on the connected emulator.
* The orientation is changed (PI/2 is added) every time
* this method is called.
*/
export declare function rotate(this: ADB): Promise<void>;
/**
* Emulate power state change on the connected emulator.
*
* @param state - Either 'on' or 'off'.
*/
export declare function powerAC(this: ADB, state?: PowerAcStates): Promise<void>;
/**
* Emulate sensors values on the connected emulator.
*
* @param sensor - Sensor type declared in SENSORS items.
* @param value - Number to set as the sensor value.
* @throws - If sensor type or sensor value is not defined
*/
export declare function sensorSet(this: ADB, sensor: string, value: Sensors): Promise<void>;
/**
* Emulate power capacity change on the connected emulator.
*
* @param percent - Percentage value in range [0, 100].
*/
export declare function powerCapacity(this: ADB, percent?: string | number): Promise<void>;
/**
* Emulate power off event on the connected emulator.
*/
export declare function powerOFF(this: ADB): Promise<void>;
/**
* Emulate send SMS event on the connected emulator.
*
* @param phoneNumber - The phone number of message sender.
* @param message - The message content.
* @throws If phone number has invalid format.
*/
export declare function sendSMS(this: ADB, phoneNumber: string | number, message?: string): Promise<void>;
/**
* Emulate GSM call event on the connected emulator.
*
* @param phoneNumber - The phone number of the caller.
* @param action - One of available GSM call actions.
* @throws If phone number has invalid format.
* @throws If _action_ value is invalid.
*/
export declare function gsmCall(this: ADB, phoneNumber: string | number, action: GsmCallActions): Promise<void>;
/**
* Emulate GSM signal strength change event on the connected emulator.
*
* @param strength - A number in range [0, 4];
* @throws If _strength_ value is invalid.
*/
export declare function gsmSignal(this: ADB, strength?: GsmSignalStrength): Promise<void>;
/**
* Emulate GSM voice event on the connected emulator.
*
* @param state - Either 'on' or 'off'.
* @throws If _state_ value is invalid.
*/
export declare function gsmVoice(this: ADB, state?: GsmVoiceStates): Promise<void>;
/**
* Emulate network speed change event on the connected emulator.
*
* @param speed
* One of possible NETWORK_SPEED values.
* @throws If _speed_ value is invalid.
*/
export declare function networkSpeed(this: ADB, speed?: NetworkSpeed): Promise<void>;
/**
* Executes a command through emulator telnet console interface and returns its output
*
* @param cmd - The actual command to execute. See
* https://developer.android.com/studio/run/emulator-console for more details
* on available commands
* @param opts
* @returns The command output
* @throws If there was an error while connecting to the Telnet console
* or if the given command returned non-OK response
*/
export declare function execEmuConsoleCommand(this: ADB, cmd: string[] | string, opts?: ExecTelnetOptions): Promise<string>;
/**
* Retrieves emulator version from the file system
*
* @returns If no version info could be parsed then an empty
* object is returned
*/
export declare function getEmuVersionInfo(this: ADB): Promise<EmuVersionInfo>;
/**
* Retrieves emulator image properties from the local file system
*
* @param avdName Emulator name. Should NOT start with '@' character
* @throws if there was a failure while extracting the properties
* @returns The content of emulator image properties file.
* Usually this configuration .ini file has the following content:
* avd.ini.encoding=UTF-8
* path=/Users/username/.android/avd/Pixel_XL_API_30.avd
* path.rel=avd/Pixel_XL_API_30.avd
* target=android-30
*/
export declare function getEmuImageProperties(this: ADB, avdName: string): Promise<StringRecord>;
/**
* Check if given emulator exists in the list of available avds.
*
* @param avdName - The name of emulator to verify for existence.
* Should NOT start with '@' character
* @throws If the emulator with given name does not exist.
*/
export declare function checkAvdExist(this: ADB, avdName: string): Promise<boolean>;
/**
* Send an arbitrary Telnet command to the device under test.
*
* @param command - The command to be sent.
* @returns The actual output of the given command.
*/
export declare function sendTelnetCommand(this: ADB, command: string): Promise<string>;
//# sourceMappingURL=emulator-commands.d.ts.map