appium-adb
Version:
Android Debug Bridge interface
54 lines • 2.33 kB
TypeScript
import type { ADB } from '../adb';
/**
* At some point of time Google has changed the default `ps` behaviour, so it only
* lists processes that belong to the current shell user rather to all
* users. It is necessary to execute ps with -A command line argument
* to mimic the previous behaviour.
*
* @returns the output of `ps` command where all processes are included
*/
export declare function listProcessStatus(this: ADB): Promise<string>;
/**
* Returns process name for the given process identifier
*
* @param pid - The valid process identifier
* @returns The process name
* @throws {Error} If the given PID is either invalid or is not present
* in the active processes list
*/
export declare function getProcessNameById(this: ADB, pid: string | number): Promise<string>;
/**
* Get the list of process ids for the particular process on the device under test.
*
* @param name - The part of process name.
* @returns The list of matched process IDs or an empty list.
*/
export declare function getProcessIdsByName(this: ADB, name: string): Promise<number[]>;
/**
* Kill all processes with the given name on the device under test.
*
* @param name - The part of process name.
* @param signal - The signal to send to the process. Default is 'SIGTERM' ('15').
* @throws {Error} If the processes cannot be killed.
*/
export declare function killProcessesByName(this: ADB, name: string, signal?: string): Promise<void>;
/**
* Kill the particular process on the device under test.
* The current user is automatically switched to root if necessary in order
* to properly kill the process.
*
* @param pid - The ID of the process to be killed.
* @param signal - The signal to send to the process. Default is 'SIGTERM' ('15').
* @throws {Error} If the process cannot be killed.
*/
export declare function killProcessByPID(this: ADB, pid: string | number, signal?: string): Promise<void>;
/**
* Check whether the process with the particular name is running on the device
* under test.
*
* @param processName - The name of the process to be checked.
* @returns True if the given process is running.
* @throws {Error} If the given process name is not a valid class name.
*/
export declare function processExists(this: ADB, processName: string): Promise<boolean>;
//# sourceMappingURL=process-commands.d.ts.map