@mcesystems/adb-kit 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -0
- package/build/Release/@mcesystems+usb-device-listener.node +0 -0
- package/dist/index.js +31130 -0
- package/dist/index.js.map +7 -0
- package/dist/resources/bin/windows/AdbWinApi.dll +0 -0
- package/dist/resources/bin/windows/AdbWinUsbApi.dll +0 -0
- package/dist/resources/bin/windows/adb.exe +0 -0
- package/dist/resources/licenses/APACHE-2.0.txt +6 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/logic/adbDeviceKit.d.ts +55 -0
- package/dist/types/logic/adbDeviceKit.d.ts.map +1 -0
- package/dist/types/logic/devicesMonitor.d.ts +13 -0
- package/dist/types/logic/devicesMonitor.d.ts.map +1 -0
- package/dist/types/utils/adbPath.d.ts +24 -0
- package/dist/types/utils/adbPath.d.ts.map +1 -0
- package/dist/types/utils/debug.d.ts +7 -0
- package/dist/types/utils/debug.d.ts.map +1 -0
- package/package.json +58 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Client } from "@devicefarmer/adbkit";
|
|
2
|
+
declare const deviceProps: {
|
|
3
|
+
Manufacturer: string;
|
|
4
|
+
Name: string;
|
|
5
|
+
Model: string;
|
|
6
|
+
"Android Version": string;
|
|
7
|
+
Platform: string;
|
|
8
|
+
CPU: string;
|
|
9
|
+
"CPU.abi2": string;
|
|
10
|
+
Description: string;
|
|
11
|
+
Fingerprint: string;
|
|
12
|
+
Brand: string;
|
|
13
|
+
Device: string;
|
|
14
|
+
"GSM Flexversion": string;
|
|
15
|
+
"Locale Language": string;
|
|
16
|
+
"Locale Region": string;
|
|
17
|
+
"Wifi Channels": string;
|
|
18
|
+
"Board Platform": string;
|
|
19
|
+
"Product Board": string;
|
|
20
|
+
"Display ID": string;
|
|
21
|
+
"GSM IMEI": string;
|
|
22
|
+
"Version Incremental": string;
|
|
23
|
+
"Version SDK": string;
|
|
24
|
+
"Version Codename": string;
|
|
25
|
+
"Version Release": string;
|
|
26
|
+
"Build Date": string;
|
|
27
|
+
"Build Type": string;
|
|
28
|
+
"Build User": string;
|
|
29
|
+
};
|
|
30
|
+
export type DeviceProperty = keyof typeof deviceProps;
|
|
31
|
+
export declare class AdbDeviceKit {
|
|
32
|
+
private readonly port;
|
|
33
|
+
private client;
|
|
34
|
+
private device;
|
|
35
|
+
private deviceId;
|
|
36
|
+
constructor(deviceId: string, port: number);
|
|
37
|
+
listDevices(): Promise<Bluebird<import("@devicefarmer/adbkit").Device[]>>;
|
|
38
|
+
private getProperty;
|
|
39
|
+
getAllDeviceProperties(): Promise<Bluebird<import("@devicefarmer/adbkit").Properties>>;
|
|
40
|
+
getDeviceProperties(properties: DeviceProperty[]): Promise<string[]>;
|
|
41
|
+
installApp(appPath: string): Promise<void>;
|
|
42
|
+
uninstallApp(packageName: string): Promise<void>;
|
|
43
|
+
isAppInstalled(packageName: string): Promise<Bluebird<boolean>>;
|
|
44
|
+
/**
|
|
45
|
+
* Applications have life of their own, so we need to get the client to use it in other parts of the code.
|
|
46
|
+
* @returns The adb client
|
|
47
|
+
*/
|
|
48
|
+
getClient(): Promise<Client>;
|
|
49
|
+
hasUsbDebugging(): Promise<boolean>;
|
|
50
|
+
waitForUsbDebugging(timeout?: number): Promise<unknown>;
|
|
51
|
+
getDeviceId(): Promise<string>;
|
|
52
|
+
getPort(): Promise<number>;
|
|
53
|
+
}
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=adbDeviceKit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adbDeviceKit.d.ts","sourceRoot":"","sources":["../../../src/logic/adbDeviceKit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,sBAAsB,CAAC;AAkBjE,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BhB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,WAAW,CAAC;AAEtD,qBAAa,YAAY;IAOvB,OAAO,CAAC,QAAQ,CAAC,IAAI;IANtB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,QAAQ,CAAS;gBAGxB,QAAQ,EAAE,MAAM,EACC,IAAI,EAAE,MAAM;IAUjB,WAAW;YAKV,WAAW;IAiBZ,sBAAsB;IAOtB,mBAAmB,CAAC,UAAU,EAAE,cAAc,EAAE;IAWhD,UAAU,CAAC,OAAO,EAAE,MAAM;IAQ1B,YAAY,CAAC,WAAW,EAAE,MAAM;IAQhC,cAAc,CAAC,WAAW,EAAE,MAAM;IAQ/C;;;OAGG;IACU,SAAS;IAUT,eAAe;IAKf,mBAAmB,CAAC,OAAO,SAAS;IA6BpC,WAAW;IAIX,OAAO;CAGpB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import EventEmitter from "node:events";
|
|
2
|
+
import type { ListenerConfig } from "@mcesystems/usb-device-listener";
|
|
3
|
+
export declare class DevicesMonitor {
|
|
4
|
+
private config;
|
|
5
|
+
private identifyAlreadyConnected;
|
|
6
|
+
private kits;
|
|
7
|
+
private eventEmitter?;
|
|
8
|
+
constructor(config: ListenerConfig, identifyAlreadyConnected?: boolean);
|
|
9
|
+
startTracking(): Promise<EventEmitter>;
|
|
10
|
+
stopTracking(): Promise<void>;
|
|
11
|
+
private connectedDevices;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=devicesMonitor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devicesMonitor.d.ts","sourceRoot":"","sources":["../../../src/logic/devicesMonitor.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,aAAa,CAAC;AAMvC,OAAO,KAAK,EAAc,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAgBlF,qBAAa,cAAc;IAKzB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,wBAAwB;IALjC,OAAO,CAAC,IAAI,CAAwC;IACpD,OAAO,CAAC,YAAY,CAAC,CAAe;gBAG3B,MAAM,EAAE,cAAc,EACtB,wBAAwB,UAAQ;IAG5B,aAAa,IAAI,OAAO,CAAC,YAAY,CAAC;IAkCtC,YAAY;YAUX,gBAAgB;CAoB9B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve the path to the ADB binary
|
|
3
|
+
*
|
|
4
|
+
* This function looks for the ADB binary in the following order:
|
|
5
|
+
* 1. In dist/resources/bin/{platform}/ (production/bundled)
|
|
6
|
+
* 2. In resources/bin/{platform}/ (development)
|
|
7
|
+
* 3. Falls back to system PATH
|
|
8
|
+
*
|
|
9
|
+
* @returns The absolute path to the ADB binary, or null if not found
|
|
10
|
+
*/
|
|
11
|
+
export declare function getAdbBinaryPath(): string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Get the directory containing ADB binaries for the current platform
|
|
14
|
+
*
|
|
15
|
+
* @returns The absolute path to the ADB binaries directory, or null if not found
|
|
16
|
+
*/
|
|
17
|
+
export declare function getAdbBinDirectory(): string | null;
|
|
18
|
+
/**
|
|
19
|
+
* Check if ADB binary is available in bundled resources
|
|
20
|
+
*
|
|
21
|
+
* @returns true if ADB binary is found in resources, false otherwise
|
|
22
|
+
*/
|
|
23
|
+
export declare function hasBundledAdb(): boolean;
|
|
24
|
+
//# sourceMappingURL=adbPath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adbPath.d.ts","sourceRoot":"","sources":["../../../src/utils/adbPath.ts"],"names":[],"mappings":"AA+BA;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CA+BhD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,GAAG,IAAI,CA2BlD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAEvC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import debug from "debug";
|
|
2
|
+
declare const logTask: debug.Debugger;
|
|
3
|
+
declare const logInfo: debug.Debugger;
|
|
4
|
+
declare const logWarning: debug.Debugger;
|
|
5
|
+
declare const logError: debug.Debugger;
|
|
6
|
+
export { logTask, logInfo, logWarning, logError };
|
|
7
|
+
//# sourceMappingURL=debug.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../../src/utils/debug.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,QAAA,MAAM,OAAO,gBAAwB,CAAC;AACtC,QAAA,MAAM,OAAO,gBAAwB,CAAC;AACtC,QAAA,MAAM,UAAU,gBAA2B,CAAC;AAC5C,QAAA,MAAM,QAAQ,gBAAyB,CAAC;AAOxC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mcesystems/adb-kit",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "ADB (Android Debug Bridge) toolkit for device management",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/types/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"types": "./dist/types/index.d.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"adb",
|
|
16
|
+
"android",
|
|
17
|
+
"debug",
|
|
18
|
+
"bridge",
|
|
19
|
+
"device",
|
|
20
|
+
"management",
|
|
21
|
+
"typescript",
|
|
22
|
+
"esm"
|
|
23
|
+
],
|
|
24
|
+
"author": "Device Management Tools Contributors",
|
|
25
|
+
"license": "ISC",
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=18.0.0"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@devicefarmer/adbkit": "^3.3.8",
|
|
31
|
+
"debug": "^4.4.3",
|
|
32
|
+
"@mcesystems/usb-device-listener": "1.0.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/debug": "^4.1.12",
|
|
36
|
+
"@types/node": "^22.10.2",
|
|
37
|
+
"esbuild": "^0.27.0",
|
|
38
|
+
"esbuild-plugin-copy": "^2.1.1",
|
|
39
|
+
"rimraf": "^6.0.1",
|
|
40
|
+
"tsx": "^4.21.0",
|
|
41
|
+
"typescript": "^5.7.2",
|
|
42
|
+
"vitest": "^2.1.8"
|
|
43
|
+
},
|
|
44
|
+
"files": [
|
|
45
|
+
"dist",
|
|
46
|
+
"build/Release/*.node",
|
|
47
|
+
"README.md"
|
|
48
|
+
],
|
|
49
|
+
"scripts": {
|
|
50
|
+
"prebuild": "tsx scripts/prebuild.ts",
|
|
51
|
+
"build": "npm run prebuild && npm run build:ts",
|
|
52
|
+
"build:ts": "tsx esbuild.config.ts && tsc --emitDeclarationOnly",
|
|
53
|
+
"clean": "rimraf dist resources build",
|
|
54
|
+
"pack": "npm pack",
|
|
55
|
+
"test": "vitest run",
|
|
56
|
+
"test:watch": "vitest"
|
|
57
|
+
}
|
|
58
|
+
}
|