lim 0.28.4 → 0.28.5

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.
@@ -0,0 +1,22 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ export default class AndroidLaunchApp extends BaseCommand {
3
+ static summary: string;
4
+ static description: string;
5
+ static examples: string[];
6
+ static args: {
7
+ packageName: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
8
+ };
9
+ static flags: {
10
+ id: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ detach: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
+ mode: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ 'api-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
+ quiet: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
+ create: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
17
+ workspace: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
18
+ daemon: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
19
+ };
20
+ run(): Promise<void>;
21
+ }
22
+ //# sourceMappingURL=launch-app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"launch-app.d.ts","sourceRoot":"","sources":["../../../src/commands/android/launch-app.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAIjD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,WAAW;IACvD,MAAM,CAAC,OAAO,SAAiD;IAC/D,MAAM,CAAC,WAAW,SACyW;IAC3X,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,IAAI;;MAET;IAEF,MAAM,CAAC,KAAK;;;;;;;;;;MAeV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAmD3B"}
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_command_1 = require("../../base-command");
5
+ const instance_client_factory_1 = require("../../lib/instance-client-factory");
6
+ const format_app_exit_1 = require("../../lib/format-app-exit");
7
+ class AndroidLaunchApp extends base_command_1.BaseCommand {
8
+ async run() {
9
+ const { args, flags } = await this.parse(AndroidLaunchApp);
10
+ this.setParsedFlags(flags);
11
+ await this.withAuth(async () => {
12
+ const resolvedInstance = this.resolveAndroidInstance(flags.id);
13
+ const mode = flags.mode;
14
+ // The appExit notification that ends this command is delivered on the
15
+ // launching client's signaling WebSocket, so both paths use a direct
16
+ // connection rather than a daemon session.
17
+ const { client, disconnect } = await (0, instance_client_factory_1.getAndroidInstanceClient)(this.client, resolvedInstance);
18
+ try {
19
+ if (flags.detach) {
20
+ await client.launchApp(args.packageName, { mode });
21
+ this.log(`Launched ${args.packageName}`);
22
+ return;
23
+ }
24
+ let notifyAppExited = () => { };
25
+ const appExited = new Promise((resolve) => {
26
+ notifyAppExited = resolve;
27
+ });
28
+ await client.launchApp(args.packageName, {
29
+ mode,
30
+ onExit: (logs, info) => {
31
+ this.log((0, format_app_exit_1.formatAppExit)(info, logs));
32
+ notifyAppExited();
33
+ },
34
+ });
35
+ this.logToStderr(`Launched ${args.packageName}. Watching until the app exits; press Ctrl+C to stop earlier, or pass --detach to skip watching.`);
36
+ await new Promise((resolve) => {
37
+ const keepAlive = setInterval(() => { }, 1 << 30);
38
+ const finish = () => {
39
+ clearInterval(keepAlive);
40
+ resolve();
41
+ };
42
+ process.on('SIGINT', finish);
43
+ process.on('SIGTERM', finish);
44
+ void appExited.then(finish);
45
+ });
46
+ }
47
+ finally {
48
+ disconnect();
49
+ }
50
+ });
51
+ }
52
+ }
53
+ AndroidLaunchApp.summary = 'Launch an app on a running Android instance';
54
+ AndroidLaunchApp.description = 'Launch an installed app on a running Android instance by package name and watch it until it exits: when the app crashes, ANRs, or stops, the exit reason, crash details, and a recent app log tail are printed. Use `--detach` to exit right after the launch instead. Choose `ForegroundIfRunning` to bring an already-running app to the front or `RelaunchIfRunning` to restart it.';
55
+ AndroidLaunchApp.examples = [
56
+ '<%= config.bin %> android launch-app com.example.app',
57
+ '<%= config.bin %> android launch-app com.example.app --detach',
58
+ '<%= config.bin %> android launch-app com.example.app --mode RelaunchIfRunning --id <instance-ID>',
59
+ ];
60
+ AndroidLaunchApp.args = {
61
+ packageName: core_1.Args.string({ description: 'Package name of the app to launch', required: true }),
62
+ };
63
+ AndroidLaunchApp.flags = {
64
+ ...base_command_1.BaseCommand.baseFlags,
65
+ id: core_1.Flags.string({
66
+ description: 'Android instance ID to target. Defaults to the last created Android instance.',
67
+ }),
68
+ detach: core_1.Flags.boolean({
69
+ char: 'd',
70
+ description: 'Exit right after launching instead of watching until the app exits',
71
+ default: false,
72
+ }),
73
+ mode: core_1.Flags.string({
74
+ description: 'Launch behavior to use when the app may already be running. Default: ForegroundIfRunning.',
75
+ options: ['ForegroundIfRunning', 'RelaunchIfRunning'],
76
+ }),
77
+ };
78
+ exports.default = AndroidLaunchApp;
79
+ //# sourceMappingURL=launch-app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"launch-app.js","sourceRoot":"","sources":["../../../src/commands/android/launch-app.ts"],"names":[],"mappings":";;AAAA,sCAA0C;AAE1C,qDAAiD;AACjD,+EAA6E;AAC7E,+DAA0D;AAE1D,MAAqB,gBAAiB,SAAQ,0BAAW;IA+BvD,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;QAC3D,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAE3B,MAAM,IAAI,CAAC,QAAQ,CAAC,K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I,EAAE,CAAC,CAAC;oBACjD,MAAM,MAAM,GAAG,GAAG,EAAE;wBAClB,aAAa,CAAC,SAAS,CAAC,CAAC;wBACzB,OAAO,EAAE,CAAC;oBACZ,CAAC,CAAC;oBACF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;oBAC7B,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;oBAC9B,KAAK,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBAC9B,CAAC,CAAC,CAAC;YACL,CAAC;oBAAS,CAAC;gBACT,UAAU,EAAE,CAAC;YACf,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;;AAhFM,wBAAO,GAAG,6CAA6C,CAAC;AACxD,4BAAW,GAChB,wXAAwX,CAAC;AACpX,yBAAQ,GAAG;IAChB,sDAAsD;IACtD,+DAA+D;IAC/D,kGAAkG;CACnG,CAAC;AAEK,qBAAI,GAAG;IACZ,WAAW,EAAE,WAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,mCAAmC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;CAC/F,CAAC;AAEK,sBAAK,GAAG;IACb,GAAG,0BAAW,CAAC,SAAS;IACxB,EAAE,EAAE,YAAK,CAAC,MAAM,CAAC;QACf,WAAW,EAAE,+EAA+E;KAC7F,CAAC;IACF,MAAM,EAAE,YAAK,CAAC,OAAO,CAAC;QACpB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,oEAAoE;QACjF,OAAO,EAAE,KAAK;KACf,CAAC;IACF,IAAI,EAAE,YAAK,CAAC,MAAM,CAAC;QACjB,WAAW,EACT,2FAA2F;QAC7F,OAAO,EAAE,CAAC,qBAAqB,EAAE,mBAAmB,CAAC;KACtD,CAAC;CACH,CAAC;kBA7BiB,gBAAgB"}
@@ -0,0 +1,20 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ export default class AndroidTerminateApp extends BaseCommand {
3
+ static summary: string;
4
+ static description: string;
5
+ static examples: string[];
6
+ static args: {
7
+ packageName: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
8
+ };
9
+ static flags: {
10
+ id: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ 'api-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
+ quiet: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
+ create: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
+ workspace: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
16
+ daemon: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
17
+ };
18
+ run(): Promise<void>;
19
+ }
20
+ //# sourceMappingURL=terminate-app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terminate-app.d.ts","sourceRoot":"","sources":["../../../src/commands/android/terminate-app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,WAAW;IAC1D,MAAM,CAAC,OAAO,SAAoD;IAClE,MAAM,CAAC,WAAW,SACwJ;IAC1K,MAAM,CAAC,QAAQ,WAGb;IAEF,MAAM,CAAC,IAAI;;MAKT;IAEF,MAAM,CAAC,KAAK;;;;;;;;MAKV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAe3B"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_command_1 = require("../../base-command");
5
+ const instance_client_factory_1 = require("../../lib/instance-client-factory");
6
+ class AndroidTerminateApp extends base_command_1.BaseCommand {
7
+ async run() {
8
+ const { args, flags } = await this.parse(AndroidTerminateApp);
9
+ this.setParsedFlags(flags);
10
+ await this.withAuth(async () => {
11
+ const resolvedInstance = this.resolveAndroidInstance(flags.id);
12
+ const { client, disconnect } = await (0, instance_client_factory_1.getAndroidInstanceClient)(this.client, resolvedInstance);
13
+ try {
14
+ await client.terminateApp(args.packageName);
15
+ }
16
+ finally {
17
+ disconnect();
18
+ }
19
+ this.log(`Terminated ${args.packageName}`);
20
+ });
21
+ }
22
+ }
23
+ AndroidTerminateApp.summary = 'Terminate an app on a running Android instance';
24
+ AndroidTerminateApp.description = 'Stop a running app on an Android instance by package name. This is useful when resetting application state or ending a foreground app before another automation step.';
25
+ AndroidTerminateApp.examples = [
26
+ '<%= config.bin %> android terminate-app com.example.app',
27
+ '<%= config.bin %> android terminate-app com.example.app --id <instance-ID>',
28
+ ];
29
+ AndroidTerminateApp.args = {
30
+ packageName: core_1.Args.string({
31
+ description: 'Package name of the running app to terminate',
32
+ required: true,
33
+ }),
34
+ };
35
+ AndroidTerminateApp.flags = {
36
+ ...base_command_1.BaseCommand.baseFlags,
37
+ id: core_1.Flags.string({
38
+ description: 'Android instance ID to target. Defaults to the last created Android instance.',
39
+ }),
40
+ };
41
+ exports.default = AndroidTerminateApp;
42
+ //# sourceMappingURL=terminate-app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terminate-app.js","sourceRoot":"","sources":["../../../src/commands/android/terminate-app.ts"],"names":[],"mappings":";;AAAA,sCAA0C;AAC1C,qDAAiD;AACjD,+EAA6E;AAE7E,MAAqB,mBAAoB,SAAQ,0BAAW;IAuB1D,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC9D,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAE3B,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE;YAC7B,MAAM,gBAAgB,GAAG,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAC/D,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,IAAA,kDAAwB,EAAC,IAAI,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;YAC7F,IAAI,CAAC;gBACH,MAAM,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAC9C,CAAC;oBAAS,CAAC;gBACT,UAAU,EAAE,CAAC;YACf,CAAC;YACD,IAAI,CAAC,GAAG,CAAC,cAAc,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACL,CAAC;;AApCM,2BAAO,GAAG,gDAAgD,CAAC;AAC3D,+BAAW,GAChB,uKAAuK,CAAC;AACnK,4BAAQ,GAAG;IAChB,yDAAyD;IACzD,4EAA4E;CAC7E,CAAC;AAEK,wBAAI,GAAG;IACZ,WAAW,EAAE,WAAI,CAAC,MAAM,CAAC;QACvB,WAAW,EAAE,8CAA8C;QAC3D,QAAQ,EAAE,IAAI;KACf,CAAC;CACH,CAAC;AAEK,yBAAK,GAAG;IACb,GAAG,0BAAW,CAAC,SAAS;IACxB,EAAE,EAAE,YAAK,CAAC,MAAM,CAAC;QACf,WAAW,EAAE,+EAA+E;KAC7F,CAAC;CACH,CAAC;kBArBiB,mBAAmB"}
@@ -0,0 +1,8 @@
1
+ import type { AppExitInfo } from '@limrun/api';
2
+ /**
3
+ * Renders an Android appExit notification as human-readable text: the exit
4
+ * reason, crash or ANR details when present, and the recent app log tail
5
+ * delivered with the event.
6
+ */
7
+ export declare function formatAppExit(info: AppExitInfo, logs: string[]): string;
8
+ //# sourceMappingURL=format-app-exit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-app-exit.d.ts","sourceRoot":"","sources":["../../src/lib/format-app-exit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAuBvE"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatAppExit = formatAppExit;
4
+ /**
5
+ * Renders an Android appExit notification as human-readable text: the exit
6
+ * reason, crash or ANR details when present, and the recent app log tail
7
+ * delivered with the event.
8
+ */
9
+ function formatAppExit(info, logs) {
10
+ const lines = [`${info.packageName} exited (reason: ${info.reason})`];
11
+ if (info.crash) {
12
+ lines.push(`Crash in ${info.crash.processName} (pid ${info.crash.pid}): ${info.crash.shortMsg}`);
13
+ if (info.crash.stackTrace) {
14
+ lines.push(info.crash.stackTrace.trimEnd());
15
+ }
16
+ }
17
+ if (info.anr) {
18
+ lines.push(`ANR in ${info.anr.processName} (pid ${info.anr.pid})`);
19
+ if (info.anr.processStats) {
20
+ lines.push(info.anr.processStats.trimEnd());
21
+ }
22
+ }
23
+ if (logs.length > 0) {
24
+ lines.push(`--- Recent app logs (${logs.length} lines) ---`);
25
+ lines.push(...logs);
26
+ }
27
+ return lines.join('\n');
28
+ }
29
+ //# sourceMappingURL=format-app-exit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-app-exit.js","sourceRoot":"","sources":["../../src/lib/format-app-exit.ts"],"names":[],"mappings":";;AAOA,sCAuBC;AA5BD;;;;GAIG;AACH,SAAgB,aAAa,CAAC,IAAiB,EAAE,IAAc;IAC7D,MAAM,KAAK,GAAa,CAAC,GAAG,IAAI,CAAC,WAAW,oBAAoB,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAEhF,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,KAAK,CAAC,WAAW,SAAS,IAAI,CAAC,KAAK,CAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;QACjG,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;YAC1B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IAED,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;QACb,KAAK,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,GAAG,CAAC,WAAW,SAAS,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;QACnE,IAAI,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;YAC1B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IAED,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpB,KAAK,CAAC,IAAI,CAAC,wBAAwB,IAAI,CAAC,MAAM,aAAa,CAAC,CAAC;QAC7D,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IACtB,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=format-app-exit.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-app-exit.test.d.ts","sourceRoot":"","sources":["../../src/lib/format-app-exit.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const format_app_exit_1 = require("./format-app-exit");
4
+ describe('formatAppExit', () => {
5
+ it('formats a plain exit with logs', () => {
6
+ const info = { packageName: 'com.example.app', reason: 'exit' };
7
+ const out = (0, format_app_exit_1.formatAppExit)(info, ['line one', 'line two']);
8
+ expect(out).toContain('com.example.app exited (reason: exit)');
9
+ expect(out).toContain('--- Recent app logs (2 lines) ---');
10
+ expect(out).toContain('line one');
11
+ expect(out.endsWith('line two')).toBe(true);
12
+ });
13
+ it('formats a crash with stack trace before the logs', () => {
14
+ const info = {
15
+ packageName: 'com.example.app',
16
+ reason: 'crash',
17
+ crash: {
18
+ processName: 'com.example.app',
19
+ pid: 4242,
20
+ shortMsg: 'java.lang.RuntimeException',
21
+ longMsg: 'java.lang.RuntimeException: boom',
22
+ stackTrace: 'java.lang.RuntimeException: boom\n\tat MainActivity.onCreate\n',
23
+ timeMillis: 1700000000000,
24
+ },
25
+ };
26
+ const out = (0, format_app_exit_1.formatAppExit)(info, ['log line']);
27
+ expect(out).toContain('exited (reason: crash)');
28
+ expect(out).toContain('Crash in com.example.app (pid 4242): java.lang.RuntimeException');
29
+ expect(out).toContain('\tat MainActivity.onCreate');
30
+ expect(out.indexOf('MainActivity')).toBeLessThan(out.indexOf('Recent app logs'));
31
+ });
32
+ it('formats an ANR with process stats', () => {
33
+ const info = {
34
+ packageName: 'com.example.app',
35
+ reason: 'anr',
36
+ anr: { processName: 'com.example.app', pid: 77, processStats: 'CPU usage: 99%\n' },
37
+ };
38
+ const out = (0, format_app_exit_1.formatAppExit)(info, []);
39
+ expect(out).toContain('exited (reason: anr)');
40
+ expect(out).toContain('ANR in com.example.app (pid 77)');
41
+ expect(out).toContain('CPU usage: 99%');
42
+ expect(out).not.toContain('Recent app logs');
43
+ });
44
+ it('omits the log section when no logs were delivered', () => {
45
+ const info = { packageName: 'com.example.app', reason: 'terminated' };
46
+ expect((0, format_app_exit_1.formatAppExit)(info, [])).toBe('com.example.app exited (reason: terminated)');
47
+ });
48
+ });
49
+ //# sourceMappingURL=format-app-exit.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-app-exit.test.js","sourceRoot":"","sources":["../../src/lib/format-app-exit.test.ts"],"names":[],"mappings":";;AAAA,uDAAkD;AAGlD,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,gCAAgC,E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AC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACnF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC3C,MAAM,IAAI,GAAgB;YACxB,WAAW,EAAE,iBAAiB;YAC9B,MAAM,EAAE,KAAK;YACb,GAAG,EAAE,EAAE,WAAW,EAAE,iBAAiB,EAAE,GAAG,EAAE,EAAE,EAAE,YAAY,EAAE,kBAAkB,EAAE;SACnF,CAAC;QACF,MAAM,GAAG,GAAG,IAAA,+BAAa,EAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACpC,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC;QAC9C,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,iCAAiC,CAAC,CAAC;QACzD,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;QACxC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QAC3D,MAAM,IAAI,GAAgB,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;QACnF,MAAM,CAAC,IAAA,+BAAa,EAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAC;IACtF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lim",
3
- "version": "0.28.4",
3
+ "version": "0.28.5",
4
4
  "description": "Use remote XCode, Gradle, iOS Simulator, Android Emulator and more to build and test apps from Linux, Windows or macOS.",
5
5
  "bin": {
6
6
  "lim": "./bin/run.js"
@@ -54,7 +54,7 @@
54
54
  "topicSeparator": " ",
55
55
  "topics": {
56
56
  "android": {
57
- "description": "Execute any task on remote Android Emulators: create, list, get, delete, connect, sync, screenshot, tap, tap-element, find-element, element-tree, type, press-key, scroll, open-url, install-app, record, play-on-microphone, set-wifi-bandwidth"
57
+ "description": "Execute any task on remote Android Emulators: create, list, get, delete, connect, sync, screenshot, tap, tap-element, find-element, element-tree, type, press-key, scroll, open-url, install-app, launch-app, terminate-app, record, play-on-microphone, set-wifi-bandwidth"
58
58
  },
59
59
  "asset": {
60
60
  "description": "Upload, download, list, inspect, and delete files that can be used by iOS & Android as pre-installed apps: push, pull, list, delete"