🚀. Socket Launch Week Day 2:Introducing Manifest Alerts.Learn more
Sign In

@limrun/node-simctl

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@limrun/node-simctl - npm Package Compare versions

Comparing version
8.1.1-lim.1
to
8.1.1-lim.2
+20
lib/subcommands/listapps.ts
import { parse } from '@plist/openstep.parse';
import type { Simctl } from '../simctl';
import type { AppInfo } from '../types';
/**
* List all installed apps on the Simulator.
*
* @returns A promise that resolves to a dictionary of app information.
*/
export async function listApps (this: Simctl): Promise<Record<string, AppInfo>> {
const {stdout} = await this.exec('listapps', {
args: [this.requireUdid('listapps')],
});
const plistString = stdout.trim();
try {
return parse(plistString) as unknown as Record<string, AppInfo>;
} catch (e) {
throw new Error(`Unable to parse simctl listapps output: ${e.message}`);
}
};
import type { Simctl } from '../simctl';
/**
* List all open files on the Simulator. This is equivalent of
* running `lsof` command against the launchd_sim process.
*
* @returns A promise that resolves to a list of open files.
*/
export async function lsof(this: Simctl): Promise<Array<{ kind: string, path: string }>> {
const lim = await this.requireLimClient();
return lim.lsof();;
}
+8
-84

@@ -1,85 +0,9 @@

export default commands;
export type ApplicationType = "System" | "User";
export type AppInfo = {
/**
* - Whether the app is a system or user-installed app
*/
ApplicationType: ApplicationType;
/**
* - File URL to the app bundle
*/
Bundle: string;
/**
* - File URL to the bundle container (User apps only)
*/
BundleContainer?: string | undefined;
/**
* - Display name of the app
*/
CFBundleDisplayName: string;
/**
* - Executable name
*/
CFBundleExecutable: string;
/**
* - Bundle identifier (e.g., 'com.apple.mobilesafari')
*/
CFBundleIdentifier: string;
/**
* - Bundle name
*/
CFBundleName: string;
/**
* - Version string
*/
CFBundleVersion: string;
/**
* - File URL to the data container
*/
DataContainer?: string | undefined;
/**
* - Map of group IDs to container URLs
*/
GroupContainers: {
[x: string]: string;
};
/**
* - Filesystem path to the app
*/
Path: string;
/**
* - Array of app tags
*/
SBAppTags: string[];
};
declare namespace commands {
/**
* @typedef {'System' | 'User'} ApplicationType
*/
/**
* @typedef {Object} AppInfo
* @property {ApplicationType} ApplicationType - Whether the app is a system or user-installed app
* @property {string} Bundle - File URL to the app bundle
* @property {string} [BundleContainer] - File URL to the bundle container (User apps only)
* @property {string} CFBundleDisplayName - Display name of the app
* @property {string} CFBundleExecutable - Executable name
* @property {string} CFBundleIdentifier - Bundle identifier (e.g., 'com.apple.mobilesafari')
* @property {string} CFBundleName - Bundle name
* @property {string} CFBundleVersion - Version string
* @property {string} [DataContainer] - File URL to the data container
* @property {Object<string, string>} GroupContainers - Map of group IDs to container URLs
* @property {string} Path - Filesystem path to the app
* @property {string[]} SBAppTags - Array of app tags
*/
/**
* Get the list of installed applications on the simulator.
*
* @this {import('../simctl').Simctl}
* @return {Promise<Object<string, AppInfo>>} Object mapping bundle identifiers to app info.
* @throws {Error} If the corresponding simctl command fails or output cannot be parsed
*/
function listApps(this: import("../simctl").default): Promise<{
[x: string]: AppInfo;
}>;
}
import type { Simctl } from '../simctl';
import type { AppInfo } from '../types';
/**
* List all installed apps on the Simulator.
*
* @returns A promise that resolves to a dictionary of app information.
*/
export declare function listApps(this: Simctl): Promise<Record<string, AppInfo>>;
//# sourceMappingURL=listapps.d.ts.map

@@ -1,1 +0,1 @@

{"version":3,"file":"listapps.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/listapps.js"],"names":[],"mappings":";8BAKa,QAAQ,GAAG,MAAM;;;;;qBAKhB,eAAe;;;;YACf,MAAM;;;;;;;;yBAEN,MAAM;;;;wBACN,MAAM;;;;wBACN,MAAM;;;;kBACN,MAAM;;;;qBACN,MAAM;;;;;;;;;;;;;;UAGN,MAAM;;;;eACN,MAAM,EAAE;;;IAjBtB;;OAEG;IAEH;;;;;;;;;;;;;;OAcG;IAEH;;;;;;OAMG;IACH,sDAHY,OAAO,CAAC;YAAO,MAAM,GAAE,OAAO;KAAC,CAAC,CAa3C"}
{"version":3,"file":"listapps.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/listapps.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC;;;;GAIG;AACH,wBAAsB,QAAQ,CAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAU9E"}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.listApps = listApps;
const openstep_parse_1 = require("@plist/openstep.parse");
const commands = {};
/**
* @typedef {'System' | 'User'} ApplicationType
*/
/**
* @typedef {Object} AppInfo
* @property {ApplicationType} ApplicationType - Whether the app is a system or user-installed app
* @property {string} Bundle - File URL to the app bundle
* @property {string} [BundleContainer] - File URL to the bundle container (User apps only)
* @property {string} CFBundleDisplayName - Display name of the app
* @property {string} CFBundleExecutable - Executable name
* @property {string} CFBundleIdentifier - Bundle identifier (e.g., 'com.apple.mobilesafari')
* @property {string} CFBundleName - Bundle name
* @property {string} CFBundleVersion - Version string
* @property {string} [DataContainer] - File URL to the data container
* @property {Object<string, string>} GroupContainers - Map of group IDs to container URLs
* @property {string} Path - Filesystem path to the app
* @property {string[]} SBAppTags - Array of app tags
*/
/**
* Get the list of installed applications on the simulator.
* List all installed apps on the Simulator.
*
* @this {import('../simctl').Simctl}
* @return {Promise<Object<string, AppInfo>>} Object mapping bundle identifiers to app info.
* @throws {Error} If the corresponding simctl command fails or output cannot be parsed
* @returns A promise that resolves to a dictionary of app information.
*/
commands.listApps = async function listApps() {
async function listApps() {
const { stdout } = await this.exec('listapps', {
args: [this.requireUdid('listapps')],
});
const plistString = stdout.toString('utf-8').trim();
const plistString = stdout.trim();
try {
return /** @type {Object<string, AppInfo>} */ ((0, openstep_parse_1.parse)(plistString));
return (0, openstep_parse_1.parse)(plistString);
}

@@ -41,4 +21,4 @@ catch (e) {

}
};
exports.default = commands;
}
;
//# sourceMappingURL=listapps.js.map

@@ -1,1 +0,1 @@

{"version":3,"file":"listapps.js","sourceRoot":"","sources":["../../../lib/subcommands/listapps.js"],"names":[],"mappings":";;AAAA,0DAAoE;AAEpE,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB;;GAEG;AAEH;;;;;;;;;;;;;;GAcG;AAEH;;;;;;GAMG;AACH,QAAQ,CAAC,QAAQ,GAAG,KAAK,UAAU,QAAQ;IACzC,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;QAC3C,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;KACrC,CAAC,CAAC;IACH,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;IACpD,IAAI,CAAC;QACH,OAAO,sCAAsC,CAAC,CAAC,IAAA,sBAAkB,EAAC,WAAW,CAAC,CAAC,CAAC;IAClF,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
{"version":3,"file":"listapps.js","sourceRoot":"","sources":["../../../lib/subcommands/listapps.ts"],"names":[],"mappings":";;AASA,4BAUC;AAnBD,0DAA8C;AAI9C;;;;GAIG;AACI,KAAK,UAAU,QAAQ;IAC1B,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;QACzC,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;KACvC,CAAC,CAAC;IACH,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;IAClC,IAAI,CAAC;QACD,OAAO,IAAA,sBAAK,EAAC,WAAW,CAAuC,CAAC;IACpE,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;AACL,CAAC;AAAA,CAAC"}

@@ -1,17 +0,12 @@

export default commands;
declare namespace commands {
/**
* List all open files on the Simulator.
*
* @this {import('../simctl').Simctl}
* @return {Promise<Array<{ kind: string, path: string }>>} List of open files.
* @throws {Error} If the corresponding simctl subcommand command
* returns non-zero return code.
* @throws {Error} If the `udid` instance property is unset
*/
function lsof(this: import("../simctl").default): Promise<Array<{
kind: string;
path: string;
}>>;
}
import type { Simctl } from '../simctl';
/**
* List all open files on the Simulator. This is equivalent of
* running `lsof` command against the launchd_sim process.
*
* @returns A promise that resolves to a list of open files.
*/
export declare function lsof(this: Simctl): Promise<Array<{
kind: string;
path: string;
}>>;
//# sourceMappingURL=lsof.d.ts.map

@@ -1,1 +0,1 @@

{"version":3,"file":"lsof.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/lsof.js"],"names":[],"mappings":";;IAIA;;;;;;;;OAQG;IACH,kDALY,OAAO,CAAC,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CASzD"}
{"version":3,"file":"lsof.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/lsof.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC;;;;;GAKG;AACH,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAGvF"}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const commands = {};
exports.lsof = lsof;
/**
* List all open files on the Simulator.
* List all open files on the Simulator. This is equivalent of
* running `lsof` command against the launchd_sim process.
*
* @this {import('../simctl').Simctl}
* @return {Promise<Array<{ kind: string, path: string }>>} List of open files.
* @throws {Error} If the corresponding simctl subcommand command
* returns non-zero return code.
* @throws {Error} If the `udid` instance property is unset
* @returns A promise that resolves to a list of open files.
*/
commands.lsof = async function lsof() {
const lim = await this.getLimClient();
const result = await lim.lsof();
return result;
};
exports.default = commands;
async function lsof() {
const lim = await this.requireLimClient();
return lim.lsof();
;
}
//# sourceMappingURL=lsof.js.map

@@ -1,1 +0,1 @@

{"version":3,"file":"lsof.js","sourceRoot":"","sources":["../../../lib/subcommands/lsof.js"],"names":[],"mappings":";;AAEA,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB;;;;;;;;GAQG;AACH,QAAQ,CAAC,IAAI,GAAG,KAAK,UAAU,IAAI;IACjC,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;IACtC,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IAChC,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
{"version":3,"file":"lsof.js","sourceRoot":"","sources":["../../../lib/subcommands/lsof.ts"],"names":[],"mappings":";;AAQA,oBAGC;AATD;;;;;GAKG;AACI,KAAK,UAAU,IAAI;IACtB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1C,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC;IAAA,CAAC;AACvB,CAAC"}

@@ -9,3 +9,3 @@ {

],
"version": "8.1.1-lim.1",
"version": "8.1.1-lim.2",
"author": "Appium Contributors",

@@ -39,2 +39,3 @@ "license": "Apache-2.0",

"@limrun/api": "^0.17.1",
"@plist/openstep.parse": "^1.1.1",
"asyncbox": "^3.0.0",

@@ -41,0 +42,0 @@ "bluebird": "^3.5.1",