lim 0.35.2 → 0.37.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/dist/commands/android/ca/add.d.ts +20 -0
- package/dist/commands/android/ca/add.d.ts.map +1 -0
- package/dist/commands/android/ca/add.js +59 -0
- package/dist/commands/android/ca/add.js.map +1 -0
- package/dist/commands/android/ca/add.test.d.ts +2 -0
- package/dist/commands/android/ca/add.test.d.ts.map +1 -0
- package/dist/commands/android/ca/add.test.js +44 -0
- package/dist/commands/android/ca/add.test.js.map +1 -0
- package/dist/commands/ios/clipboard/get.d.ts +18 -0
- package/dist/commands/ios/clipboard/get.d.ts.map +1 -0
- package/dist/commands/ios/clipboard/get.js +45 -0
- package/dist/commands/ios/clipboard/get.js.map +1 -0
- package/dist/commands/ios/clipboard/set.d.ts +20 -0
- package/dist/commands/ios/clipboard/set.d.ts.map +1 -0
- package/dist/commands/ios/clipboard/set.js +54 -0
- package/dist/commands/ios/clipboard/set.js.map +1 -0
- package/dist/commands/ios/defaults.d.ts +19 -0
- package/dist/commands/ios/defaults.d.ts.map +1 -0
- package/dist/commands/ios/defaults.js +52 -0
- package/dist/commands/ios/defaults.js.map +1 -0
- package/dist/commands/ios/notify.d.ts +22 -0
- package/dist/commands/ios/notify.d.ts.map +1 -0
- package/dist/commands/ios/notify.js +63 -0
- package/dist/commands/ios/notify.js.map +1 -0
- package/dist/commands/ios/simctl.d.ts.map +1 -1
- package/dist/commands/ios/simctl.js +7 -1
- package/dist/commands/ios/simctl.js.map +1 -1
- package/dist/lib/instance-client-factory.d.ts +9 -0
- package/dist/lib/instance-client-factory.d.ts.map +1 -1
- package/dist/lib/instance-client-factory.js +14 -0
- package/dist/lib/instance-client-factory.js.map +1 -1
- package/dist/lib/stdin.d.ts +3 -0
- package/dist/lib/stdin.d.ts.map +1 -0
- package/dist/lib/stdin.js +12 -0
- package/dist/lib/stdin.js.map +1 -0
- package/package.json +10 -4
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class AndroidCaAdd extends BaseCommand {
|
|
3
|
+
static summary: string;
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static args: {
|
|
7
|
+
path: 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=add.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../../src/commands/android/ca/add.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,WAAW;IACnD,MAAM,CAAC,OAAO,SAA0D;IACxE,MAAM,CAAC,WAAW,SAG0E;IAE5F,MAAM,CAAC,QAAQ,WAGb;IAEF,MAAM,CAAC,IAAI;;MAKT;IAEF,MAAM,CAAC,KAAK;;;;;;;;MAKV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAwB3B"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const fs_1 = __importDefault(require("fs"));
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const core_1 = require("@oclif/core");
|
|
9
|
+
const base_command_1 = require("../../../base-command");
|
|
10
|
+
const instance_client_factory_1 = require("../../../lib/instance-client-factory");
|
|
11
|
+
class AndroidCaAdd extends base_command_1.BaseCommand {
|
|
12
|
+
async run() {
|
|
13
|
+
const { args, flags } = await this.parse(AndroidCaAdd);
|
|
14
|
+
this.setParsedFlags(flags);
|
|
15
|
+
const localPath = path_1.default.resolve(args.path);
|
|
16
|
+
if (!fs_1.default.existsSync(localPath)) {
|
|
17
|
+
this.error(`File not found: ${localPath}`);
|
|
18
|
+
}
|
|
19
|
+
const pem = fs_1.default.readFileSync(localPath, 'utf8');
|
|
20
|
+
await this.withAuth(async () => {
|
|
21
|
+
const resolvedInstance = this.resolveAndroidInstance(flags.id);
|
|
22
|
+
const { client, disconnect } = await (0, instance_client_factory_1.getAndroidInstanceClient)(this.client, resolvedInstance);
|
|
23
|
+
try {
|
|
24
|
+
const trusted = await client.addCaCertificate(pem);
|
|
25
|
+
if (flags.json) {
|
|
26
|
+
this.outputJson(trusted);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
this.output(`Trusted ${trusted.filename} (SHA-256 ${trusted.sha256})`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
finally {
|
|
33
|
+
disconnect();
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
AndroidCaAdd.summary = 'Trust a CA certificate on a running Android instance';
|
|
39
|
+
AndroidCaAdd.description = "Add a PEM-encoded CA certificate to the device's trust stores, for example the CA of an " +
|
|
40
|
+
'intercepting proxy you record traffic with. Apps, WebViews and the Chrome browser trust it on their ' +
|
|
41
|
+
'next connection, without a restart. The certificate lasts for the life of the instance.';
|
|
42
|
+
AndroidCaAdd.examples = [
|
|
43
|
+
'<%= config.bin %> android ca add ./proxy-ca.pem',
|
|
44
|
+
'<%= config.bin %> android ca add ./proxy-ca.pem --id <instance-ID>',
|
|
45
|
+
];
|
|
46
|
+
AndroidCaAdd.args = {
|
|
47
|
+
path: core_1.Args.string({
|
|
48
|
+
description: 'Local PEM file holding one CA certificate.',
|
|
49
|
+
required: true,
|
|
50
|
+
}),
|
|
51
|
+
};
|
|
52
|
+
AndroidCaAdd.flags = {
|
|
53
|
+
...base_command_1.BaseCommand.baseFlags,
|
|
54
|
+
id: core_1.Flags.string({
|
|
55
|
+
description: 'Android instance ID to target. Defaults to the last created Android instance.',
|
|
56
|
+
}),
|
|
57
|
+
};
|
|
58
|
+
exports.default = AndroidCaAdd;
|
|
59
|
+
//# sourceMappingURL=add.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../../src/commands/android/ca/add.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,sCAA0C;AAC1C,wDAAoD;AACpD,kFAAgF;AAEhF,MAAqB,YAAa,SAAQ,0BAAW;IA0BnD,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QACvD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAC3B,MAAM,SAAS,GAAG,cAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC9B,IAAI,CAAC,KAAK,CAAC,mBAAmB,SAAS,EAAE,CAAC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|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.test.d.ts","sourceRoot":"","sources":["../../../../src/commands/android/ca/add.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const fs_1 = __importDefault(require("fs"));
|
|
7
|
+
const os_1 = __importDefault(require("os"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const add_1 = __importDefault(require("./add"));
|
|
10
|
+
const instance_client_factory_1 = require("../../../lib/instance-client-factory");
|
|
11
|
+
jest.mock('../../../lib/instance-client-factory', () => ({ getAndroidInstanceClient: jest.fn() }));
|
|
12
|
+
function setup(pemPath) {
|
|
13
|
+
const client = { addCaCertificate: jest.fn().mockResolvedValue({ filename: '8c1d60e6.0', sha256: 'ab' }) };
|
|
14
|
+
const disconnect = jest.fn();
|
|
15
|
+
jest.mocked(instance_client_factory_1.getAndroidInstanceClient).mockResolvedValue({ client, disconnect });
|
|
16
|
+
const command = Object.assign(Object.create(add_1.default.prototype), {
|
|
17
|
+
parse: async () => ({ args: { path: pemPath }, flags: { json: true, id: 'android_test' } }),
|
|
18
|
+
setParsedFlags: jest.fn(),
|
|
19
|
+
withAuth: async (run) => run(),
|
|
20
|
+
resolveAndroidInstance: () => 'android_test',
|
|
21
|
+
outputJson: jest.fn(),
|
|
22
|
+
error: (message) => {
|
|
23
|
+
throw new Error(message);
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(command, 'client', { value: {} });
|
|
27
|
+
return { command, client, disconnect };
|
|
28
|
+
}
|
|
29
|
+
beforeEach(() => jest.clearAllMocks());
|
|
30
|
+
test('sends the PEM file to the instance and reports the stored certificate', async () => {
|
|
31
|
+
const pemPath = path_1.default.join(fs_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), 'lim-ca-')), 'ca.pem');
|
|
32
|
+
fs_1.default.writeFileSync(pemPath, '-----BEGIN CERTIFICATE-----\nMIIB\n-----END CERTIFICATE-----\n');
|
|
33
|
+
const { command, client, disconnect } = setup(pemPath);
|
|
34
|
+
await command.run();
|
|
35
|
+
expect(client.addCaCertificate).toHaveBeenCalledWith(fs_1.default.readFileSync(pemPath, 'utf8'));
|
|
36
|
+
expect(command.outputJson).toHaveBeenCalledWith({ filename: '8c1d60e6.0', sha256: 'ab' });
|
|
37
|
+
expect(disconnect).toHaveBeenCalledTimes(1);
|
|
38
|
+
});
|
|
39
|
+
test('refuses a missing file before connecting', async () => {
|
|
40
|
+
const { command } = setup('/does/not/exist.pem');
|
|
41
|
+
await expect(command.run()).rejects.toThrow('File not found: /does/not/exist.pem');
|
|
42
|
+
expect(instance_client_factory_1.getAndroidInstanceClient).not.toHaveBeenCalled();
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=add.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.test.js","sourceRoot":"","sources":["../../../../src/commands/android/ca/add.test.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,4CAAoB;AACpB,gDAAwB;AACxB,gDAAiC;AACjC,kFAAgF;AAEhF,IAAI,CAAC,IAAI,CAAC,sCAAsC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,wBAAwB,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;AAEnG,SAAS,KAAK,CAAC,OAAe;IAC5B,MAAM,MAAM,GAAG,EAAE,gBAAgB,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAC3G,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC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AC;IAC5F,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;IACvD,MAAM,OAAO,CAAC,GAAG,EAAE,CAAC;IACpB,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,oBAAoB,CAAC,YAAE,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IACvF,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1F,MAAM,CAAC,UAAU,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;AAC9C,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;IAC1D,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACjD,MAAM,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,qCAAqC,CAAC,CAAC;IACnF,MAAM,CAAC,kDAAwB,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;AAC1D,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class IosClipboardGet extends BaseCommand {
|
|
3
|
+
static summary: string;
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static args: {};
|
|
7
|
+
static flags: {
|
|
8
|
+
id: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
'api-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
quiet: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
create: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
workspace: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
daemon: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=get.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../src/commands/ios/clipboard/get.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,WAAW;IACtD,MAAM,CAAC,OAAO,SAAmD;IACjE,MAAM,CAAC,WAAW,SACoL;IACtM,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,IAAI,KAAM;IAEjB,MAAM,CAAC,KAAK;;;;;;;;MAKV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAuB3B"}
|
|
@@ -0,0 +1,45 @@
|
|
|
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 IosClipboardGet extends base_command_1.BaseCommand {
|
|
7
|
+
async run() {
|
|
8
|
+
const { flags } = await this.parse(IosClipboardGet);
|
|
9
|
+
this.setParsedFlags(flags);
|
|
10
|
+
await this.withAuth(async () => {
|
|
11
|
+
const result = await (0, instance_client_factory_1.runIosSimctl)(this.client, this.resolveIosInstance(flags.id), [
|
|
12
|
+
'pbpaste',
|
|
13
|
+
'booted',
|
|
14
|
+
]);
|
|
15
|
+
if (result.code !== 0) {
|
|
16
|
+
this.error(result.stderr.trim() || `pbpaste failed with exit code ${result.code}`, {
|
|
17
|
+
exit: result.code,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
const text = result.stdout;
|
|
21
|
+
if (flags.json) {
|
|
22
|
+
this.outputJson({ text });
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
process.stdout.write(text);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
IosClipboardGet.summary = 'Print the clipboard of a running iOS instance';
|
|
31
|
+
IosClipboardGet.description = 'Print the pasteboard text of a running iOS instance to standard output, without a trailing newline. Prints nothing when the pasteboard holds no text. Same as `lim ios simctl -- pbpaste booted`.';
|
|
32
|
+
IosClipboardGet.examples = [
|
|
33
|
+
'<%= config.bin %> ios clipboard get',
|
|
34
|
+
'<%= config.bin %> ios clipboard get --id <instance-ID>',
|
|
35
|
+
'<%= config.bin %> ios clipboard get --json',
|
|
36
|
+
];
|
|
37
|
+
IosClipboardGet.args = {};
|
|
38
|
+
IosClipboardGet.flags = {
|
|
39
|
+
...base_command_1.BaseCommand.baseFlags,
|
|
40
|
+
id: core_1.Flags.string({
|
|
41
|
+
description: 'iOS instance ID to target. Defaults to the last created iOS instance.',
|
|
42
|
+
}),
|
|
43
|
+
};
|
|
44
|
+
exports.default = IosClipboardGet;
|
|
45
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../src/commands/ios/clipboard/get.ts"],"names":[],"mappings":";;AAAA,sCAAoC;AACpC,wDAAoD;AACpD,kFAAoE;AAEpE,MAAqB,eAAgB,SAAQ,0BAAW;IAmBtD,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QACpD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAE3B,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE;YAC7B,MAAM,MAAM,GAAG,MAAM,IAAA,sCAAY,EAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE;gBAChF,SAAS;gBACT,QAAQ;aACT,CAAC,CAAC;YACH,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;gBACtB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,iCAAiC,MAAM,CAAC,IAAI,EAAE,EAAE;oBACjF,IAAI,EAAE,MAAM,CAAC,IAAI;iBAClB,CAAC,CAAC;YACL,CAAC;YACD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;YAE3B,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;gBACf,IAAI,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;YAC5B,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC7B,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;;AAxCM,uBAAO,GAAG,+CAA+C,CAAC;AAC1D,2BAAW,GAChB,mMAAmM,CAAC;AAC/L,wBAAQ,GAAG;IAChB,qCAAqC;IACrC,wDAAwD;IACxD,4CAA4C;CAC7C,CAAC;AAEK,oBAAI,GAAG,EAAE,CAAC;AAEV,qBAAK,GAAG;IACb,GAAG,0BAAW,CAAC,SAAS;IACxB,EAAE,EAAE,YAAK,CAAC,MAAM,CAAC;QACf,WAAW,EAAE,uEAAuE;KACrF,CAAC;CACH,CAAC;kBAjBiB,eAAe"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class IosClipboardSet extends BaseCommand {
|
|
3
|
+
static summary: string;
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static args: {
|
|
7
|
+
text: import("@oclif/core/lib/interfaces").Arg<string | undefined, 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=set.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../../../src/commands/ios/clipboard/set.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIpD,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,WAAW;IACtD,MAAM,CAAC,OAAO,SAAiD;IAC/D,MAAM,CAAC,WAAW,SAC2M;IAC7N,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,IAAI;;MAKT;IAEF,MAAM,CAAC,KAAK;;;;;;;;MAKV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAgC3B"}
|
|
@@ -0,0 +1,54 @@
|
|
|
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 stdin_1 = require("../../../lib/stdin");
|
|
7
|
+
class IosClipboardSet extends base_command_1.BaseCommand {
|
|
8
|
+
async run() {
|
|
9
|
+
const { args, flags } = await this.parse(IosClipboardSet);
|
|
10
|
+
this.setParsedFlags(flags);
|
|
11
|
+
if (args.text === undefined && process.stdin.isTTY) {
|
|
12
|
+
this.error('Provide the text as an argument or pipe it on stdin.');
|
|
13
|
+
}
|
|
14
|
+
// Read once, outside withAuth: a retry against a replacement instance would find stdin drained.
|
|
15
|
+
const text = args.text ?? (await (0, stdin_1.readStdin)());
|
|
16
|
+
await this.withAuth(async () => {
|
|
17
|
+
const result = await (0, instance_client_factory_1.runIosSimctl)(this.client, this.resolveIosInstance(flags.id), ['pbcopy', 'booted'], {
|
|
18
|
+
stdin: text,
|
|
19
|
+
});
|
|
20
|
+
if (result.code !== 0) {
|
|
21
|
+
this.error(result.stderr.trim() || `pbcopy failed with exit code ${result.code}`, {
|
|
22
|
+
exit: result.code,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
if (flags.json) {
|
|
26
|
+
this.outputJson({ updated: true });
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
this.log('Clipboard set');
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
IosClipboardSet.summary = 'Set the clipboard of a running iOS instance';
|
|
35
|
+
IosClipboardSet.description = 'Replace the pasteboard of a running iOS instance with the given text, or with standard input when no text is given. Apps then paste it like text copied inside the simulator. Same as `lim ios simctl -- pbcopy booted`.';
|
|
36
|
+
IosClipboardSet.examples = [
|
|
37
|
+
'<%= config.bin %> ios clipboard set "hello world"',
|
|
38
|
+
'echo "one-time code 123456" | <%= config.bin %> ios clipboard set',
|
|
39
|
+
'<%= config.bin %> ios clipboard set "hello" --id <instance-ID>',
|
|
40
|
+
];
|
|
41
|
+
IosClipboardSet.args = {
|
|
42
|
+
text: core_1.Args.string({
|
|
43
|
+
description: 'Text to put on the clipboard. Reads standard input when omitted.',
|
|
44
|
+
required: false,
|
|
45
|
+
}),
|
|
46
|
+
};
|
|
47
|
+
IosClipboardSet.flags = {
|
|
48
|
+
...base_command_1.BaseCommand.baseFlags,
|
|
49
|
+
id: core_1.Flags.string({
|
|
50
|
+
description: 'iOS instance ID to target. Defaults to the last created iOS instance.',
|
|
51
|
+
}),
|
|
52
|
+
};
|
|
53
|
+
exports.default = IosClipboardSet;
|
|
54
|
+
//# sourceMappingURL=set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set.js","sourceRoot":"","sources":["../../../../src/commands/ios/clipboard/set.ts"],"names":[],"mappings":";;AAAA,sCAA0C;AAC1C,wDAAoD;AACpD,kFAAoE;AACpE,8CAA+C;AAE/C,MAAqB,eAAgB,SAAQ,0BAAW;IAwBtD,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QAC1D,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAE3B,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YACnD,IAAI,CAAC,KAAK,CAAC,sDAAsD,CAAC,CAAC;QACrE,CAAC;QACD,gGAAgG;QAChG,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,IAAA,iBAAS,GAAE,CAAC,CAAC;QAE9C,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE;YAC7B,MAAM,MAAM,GAAG,MAAM,IAAA,sCAAY,EAC/B,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,EACjC,CAAC,QAAQ,EAAE,QAAQ,CAAC,EACpB;gBACE,KAAK,EAAE,IAAI;aACZ,CACF,CAAC;YACF,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;gBACtB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,gCAAgC,MAAM,CAAC,IAAI,EAAE,EAAE;oBAChF,IAAI,EAAE,MAAM,CAAC,IAAI;iBAClB,CAAC,CAAC;YACL,CAAC;YAED,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;gBACf,IAAI,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;YACrC,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;;AAtDM,uBAAO,GAAG,6CAA6C,CAAC;AACxD,2BAAW,GAChB,0NAA0N,CAAC;AACtN,wBAAQ,GAAG;IAChB,mDAAmD;IACnD,mEAAmE;IACnE,gEAAgE;CACjE,CAAC;AAEK,oBAAI,GAAG;IACZ,IAAI,EAAE,WAAI,CAAC,MAAM,CAAC;QAChB,WAAW,EAAE,kEAAkE;QAC/E,QAAQ,EAAE,KAAK;KAChB,CAAC;CACH,CAAC;AAEK,qBAAK,GAAG;IACb,GAAG,0BAAW,CAAC,SAAS;IACxB,EAAE,EAAE,YAAK,CAAC,MAAM,CAAC;QACf,WAAW,EAAE,uEAAuE;KACrF,CAAC;CACH,CAAC;kBAtBiB,eAAe"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
export default class IosDefaults extends BaseCommand {
|
|
3
|
+
static summary: string;
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static strict: boolean;
|
|
7
|
+
static args: {};
|
|
8
|
+
static flags: {
|
|
9
|
+
id: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
'api-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
quiet: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
create: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
workspace: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
|
+
daemon: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../src/commands/ios/defaults.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,WAAW;IAClD,MAAM,CAAC,OAAO,SAA2D;IACzE,MAAM,CAAC,WAAW,SAC4O;IAC9P,MAAM,CAAC,QAAQ,WAKb;IAEF,MAAM,CAAC,MAAM,UAAS;IAEtB,MAAM,CAAC,IAAI,KAAM;IAEjB,MAAM,CAAC,KAAK;;;;;;;;MAKV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA2B3B"}
|
|
@@ -0,0 +1,52 @@
|
|
|
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 IosDefaults extends base_command_1.BaseCommand {
|
|
7
|
+
async run() {
|
|
8
|
+
const parsed = await this.parse(IosDefaults);
|
|
9
|
+
const flags = parsed.flags;
|
|
10
|
+
const rawArgs = parsed.argv ?? [];
|
|
11
|
+
this.setParsedFlags(flags);
|
|
12
|
+
// limulator decides which defaults verbs run; the CLI only needs something to send.
|
|
13
|
+
if (rawArgs.length === 0) {
|
|
14
|
+
this.error('Usage: lim ios defaults -- read|write|delete <domain> [key] [value...]');
|
|
15
|
+
}
|
|
16
|
+
await this.withAuth(async () => {
|
|
17
|
+
const result = await (0, instance_client_factory_1.runIosSimctl)(this.client, this.resolveIosInstance(flags.id), [
|
|
18
|
+
'spawn',
|
|
19
|
+
'booted',
|
|
20
|
+
'defaults',
|
|
21
|
+
...rawArgs,
|
|
22
|
+
]);
|
|
23
|
+
if (flags.json) {
|
|
24
|
+
this.outputJson(result);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
process.stdout.write(result.stdout);
|
|
28
|
+
process.stderr.write(result.stderr);
|
|
29
|
+
}
|
|
30
|
+
if (result.code !== 0)
|
|
31
|
+
this.exit(result.code);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
IosDefaults.summary = 'Read or write user defaults on a running iOS instance';
|
|
36
|
+
IosDefaults.description = "Run the simulator's `defaults read`, `write` or `delete`, for example to change the device language without UI automation. Pass the arguments after `--`. Apps launched afterwards see the change. Same as `lim ios simctl -- spawn booted defaults ...`.";
|
|
37
|
+
IosDefaults.examples = [
|
|
38
|
+
'<%= config.bin %> ios defaults -- write -g AppleLanguages -array fr-FR',
|
|
39
|
+
'<%= config.bin %> ios defaults -- write -g AppleLocale -string fr_FR',
|
|
40
|
+
'<%= config.bin %> ios defaults -- read -g AppleLanguages',
|
|
41
|
+
'<%= config.bin %> ios defaults --id <instance-ID> -- delete com.example.app someKey',
|
|
42
|
+
];
|
|
43
|
+
IosDefaults.strict = false;
|
|
44
|
+
IosDefaults.args = {};
|
|
45
|
+
IosDefaults.flags = {
|
|
46
|
+
...base_command_1.BaseCommand.baseFlags,
|
|
47
|
+
id: core_1.Flags.string({
|
|
48
|
+
description: 'iOS instance ID to target. Defaults to the last created iOS instance.',
|
|
49
|
+
}),
|
|
50
|
+
};
|
|
51
|
+
exports.default = IosDefaults;
|
|
52
|
+
//# sourceMappingURL=defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../../src/commands/ios/defaults.ts"],"names":[],"mappings":";;AAAA,sCAAoC;AACpC,qDAAiD;AACjD,+EAAiE;AAEjE,MAAqB,WAAY,SAAQ,0BAAW;IAsBlD,KAAK,CAAC,GAAG;QACP,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAkB,CAAC,CAAC;QACpD,MAAM,KAAK,GAAG,MAAM,CAAC,KAA4B,CAAC;QAClD,MAAM,OAAO,GAAI,MAAM,CAAC,IAAiB,IAAI,EAAE,CAAC;QAChD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAE3B,oFAAoF;QACpF,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,IAAI,CAAC,KAAK,CAAC,wEAAwE,CAAC,CAAC;QACvF,CAAC;QAED,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE;YAC7B,MAAM,MAAM,GAAG,MAAM,IAAA,sCAAY,EAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE;gBAChF,OAAO;gBACP,QAAQ;gBACR,UAAU;gBACV,GAAG,OAAO;aACX,CAAC,CAAC;YACH,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;gBACf,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YAC1B,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBACpC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACtC,CAAC;YACD,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC;gBAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;IACL,CAAC;;AA/CM,mBAAO,GAAG,uDAAuD,CAAC;AAClE,uBAAW,GAChB,2PAA2P,CAAC;AACvP,oBAAQ,GAAG;IAChB,wEAAwE;IACxE,sEAAsE;IACtE,0DAA0D;IAC1D,qFAAqF;CACtF,CAAC;AAEK,kBAAM,GAAG,KAAK,CAAC;AAEf,gBAAI,GAAG,EAAE,CAAC;AAEV,iBAAK,GAAG;IACb,GAAG,0BAAW,CAAC,SAAS;IACxB,EAAE,EAAE,YAAK,CAAC,MAAM,CAAC;QACf,WAAW,EAAE,uEAAuE;KACrF,CAAC;CACH,CAAC;kBApBiB,WAAW"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
export default class IosNotify extends BaseCommand {
|
|
3
|
+
static summary: string;
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static args: {
|
|
7
|
+
action: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
8
|
+
name: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
9
|
+
state: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
10
|
+
};
|
|
11
|
+
static flags: {
|
|
12
|
+
id: 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=notify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notify.d.ts","sourceRoot":"","sources":["../../../src/commands/ios/notify.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAKjD,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,WAAW;IAChD,MAAM,CAAC,OAAO,SAAuE;IACrF,MAAM,CAAC,WAAW,SAC6M;IAC/N,MAAM,CAAC,QAAQ,WAKb;IAEF,MAAM,CAAC,IAAI;;;;MAQT;IAEF,MAAM,CAAC,KAAK;;;;;;;;MAKV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA8B3B"}
|
|
@@ -0,0 +1,63 @@
|
|
|
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 NOTIFYUTIL_FLAGS = { post: '-p', set: '-s', get: '-g' };
|
|
7
|
+
class IosNotify extends base_command_1.BaseCommand {
|
|
8
|
+
async run() {
|
|
9
|
+
const { args, flags } = await this.parse(IosNotify);
|
|
10
|
+
this.setParsedFlags(flags);
|
|
11
|
+
const action = args.action;
|
|
12
|
+
if ((action === 'set') !== (args.state !== undefined)) {
|
|
13
|
+
this.error('Pass a state for `set`, and only for `set`.');
|
|
14
|
+
}
|
|
15
|
+
const notifyArgs = [
|
|
16
|
+
NOTIFYUTIL_FLAGS[action],
|
|
17
|
+
args.name,
|
|
18
|
+
...(args.state === undefined ? [] : [args.state]),
|
|
19
|
+
];
|
|
20
|
+
await this.withAuth(async () => {
|
|
21
|
+
const result = await (0, instance_client_factory_1.runIosSimctl)(this.client, this.resolveIosInstance(flags.id), [
|
|
22
|
+
'spawn',
|
|
23
|
+
'booted',
|
|
24
|
+
'notifyutil',
|
|
25
|
+
...notifyArgs,
|
|
26
|
+
]);
|
|
27
|
+
if (flags.json) {
|
|
28
|
+
this.outputJson(result);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
process.stdout.write(result.stdout);
|
|
32
|
+
process.stderr.write(result.stderr);
|
|
33
|
+
}
|
|
34
|
+
if (result.code !== 0)
|
|
35
|
+
this.exit(result.code);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
IosNotify.summary = 'Post, set or read a Darwin notification on a running iOS instance';
|
|
40
|
+
IosNotify.description = "Run the simulator's `notifyutil`, for example to enroll Face ID and make the next scan match or fail. `post` is `notifyutil -p`, `set` is `-s` and `get` is `-g`. Same as `lim ios simctl -- spawn booted notifyutil ...`.";
|
|
41
|
+
IosNotify.examples = [
|
|
42
|
+
'<%= config.bin %> ios notify set com.apple.BiometricKit.enrollmentChanged 1',
|
|
43
|
+
'<%= config.bin %> ios notify post com.apple.BiometricKit.enrollmentChanged',
|
|
44
|
+
'<%= config.bin %> ios notify post com.apple.BiometricKit_Sim.pearl.match',
|
|
45
|
+
'<%= config.bin %> ios notify get com.apple.BiometricKit.enrollmentChanged --id <instance-ID>',
|
|
46
|
+
];
|
|
47
|
+
IosNotify.args = {
|
|
48
|
+
action: core_1.Args.string({
|
|
49
|
+
description: 'What to do with the notification',
|
|
50
|
+
options: Object.keys(NOTIFYUTIL_FLAGS),
|
|
51
|
+
required: true,
|
|
52
|
+
}),
|
|
53
|
+
name: core_1.Args.string({ description: 'Notification name', required: true }),
|
|
54
|
+
state: core_1.Args.string({ description: 'State to set, for `set` only' }),
|
|
55
|
+
};
|
|
56
|
+
IosNotify.flags = {
|
|
57
|
+
...base_command_1.BaseCommand.baseFlags,
|
|
58
|
+
id: core_1.Flags.string({
|
|
59
|
+
description: 'iOS instance ID to target. Defaults to the last created iOS instance.',
|
|
60
|
+
}),
|
|
61
|
+
};
|
|
62
|
+
exports.default = IosNotify;
|
|
63
|
+
//# sourceMappingURL=notify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notify.js","sourceRoot":"","sources":["../../../src/commands/ios/notify.ts"],"names":[],"mappings":";;AAAA,sCAA0C;AAC1C,qDAAiD;AACjD,+EAAiE;AAEjE,MAAM,gBAAgB,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAW,CAAC;AAEvE,MAAqB,SAAU,SAAQ,0BAAW;IA4BhD,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACpD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAE3B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAuC,CAAC;QAC5D,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,EAAE,CAAC;YACtD,IAAI,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAC;QAC5D,CAAC;QACD,MAAM,UAAU,GAAG;YACjB,gBAAgB,CAAC,MAAM,CAAC;YACxB,IAAI,CAAC,IAAI;YACT,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAClD,CAAC;QAEF,MAAM,IAAI,CAAC,QAAQ,CAAC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,EAAE,EAAE,YAAK,CAAC,MAAM,CAAC;QACf,WAAW,EAAE,uEAAuE;KACrF,CAAC;CACH,CAAC;kBA1BiB,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simctl.d.ts","sourceRoot":"","sources":["../../../src/commands/ios/simctl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"simctl.d.ts","sourceRoot":"","sources":["../../../src/commands/ios/simctl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAUjD,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,WAAW;IAChD,MAAM,CAAC,OAAO,SAA0C;IACxD,MAAM,CAAC,WAAW,SAC+J;IACjL,MAAM,CAAC,QAAQ,WAMb;IAEF,MAAM,CAAC,MAAM,UAAS;IAEtB,MAAM,CAAC,IAAI,KAAM;IAEjB,MAAM,CAAC,KAAK;;;;;;;;MAKV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA0D3B"}
|
|
@@ -3,12 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
4
|
const base_command_1 = require("../../base-command");
|
|
5
5
|
const instance_client_factory_1 = require("../../lib/instance-client-factory");
|
|
6
|
+
const stdin_1 = require("../../lib/stdin");
|
|
6
7
|
class IosSimctl extends base_command_1.BaseCommand {
|
|
7
8
|
async run() {
|
|
8
9
|
const parsed = await this.parse(IosSimctl);
|
|
9
10
|
const flags = parsed.flags;
|
|
10
11
|
const rawArgs = parsed.argv ?? [];
|
|
11
12
|
this.setParsedFlags(flags);
|
|
13
|
+
// pbcopy is the only allowed subcommand that reads standard input. Read it once, outside
|
|
14
|
+
// withAuth: a retry against a replacement instance would find stdin drained.
|
|
15
|
+
const stdin = rawArgs[0] === 'pbcopy' ? await (0, stdin_1.readStdin)() : undefined;
|
|
12
16
|
await this.withAuth(async () => {
|
|
13
17
|
if (rawArgs.length === 0) {
|
|
14
18
|
this.error('Provide at least one simctl argument after `lim ios simctl --`.');
|
|
@@ -20,7 +24,7 @@ class IosSimctl extends base_command_1.BaseCommand {
|
|
|
20
24
|
}
|
|
21
25
|
const { client, disconnect } = await (0, instance_client_factory_1.getIosInstanceClient)(this.client, resolvedInstance);
|
|
22
26
|
try {
|
|
23
|
-
const execution = client.simctl(rawArgs);
|
|
27
|
+
const execution = client.simctl(rawArgs, stdin === undefined ? {} : { stdin });
|
|
24
28
|
if (flags.json) {
|
|
25
29
|
const result = (await execution.wait());
|
|
26
30
|
this.outputJson(result);
|
|
@@ -59,6 +63,8 @@ IosSimctl.examples = [
|
|
|
59
63
|
'<%= config.bin %> ios simctl -- listapps booted',
|
|
60
64
|
'<%= config.bin %> ios simctl -- getenv booted HOME',
|
|
61
65
|
'<%= config.bin %> ios simctl -- listapps booted --json',
|
|
66
|
+
'echo hello | <%= config.bin %> ios simctl -- pbcopy booted',
|
|
67
|
+
'<%= config.bin %> ios simctl -- pbpaste booted',
|
|
62
68
|
];
|
|
63
69
|
IosSimctl.strict = false;
|
|
64
70
|
IosSimctl.args = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simctl.js","sourceRoot":"","sources":["../../../src/commands/ios/simctl.ts"],"names":[],"mappings":";;AAAA,sCAAoC;AACpC,qDAAiD;AACjD,+EAAyE;
|
|
1
|
+
{"version":3,"file":"simctl.js","sourceRoot":"","sources":["../../../src/commands/ios/simctl.ts"],"names":[],"mappings":";;AAAA,sCAAoC;AACpC,qDAAiD;AACjD,+EAAyE;AACzE,2CAA4C;AAQ5C,MAAqB,SAAU,SAAQ,0BAAW;IAuBhD,KAAK,CAAC,GAAG;QACP,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,SAAgB,CAAC,CAAC;QAClD,MAAM,KAAK,GAAG,MAAM,CAAC,KAA4B,CAAC;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;IAC5D,gDAAgD;CACjD,CAAC;AAEK,gBAAM,GAAG,KAAK,CAAC;AAEf,cAAI,GAAG,EAAE,CAAC;AAEV,eAAK,GAAG;IACb,GAAG,0BAAW,CAAC,SAAS;IACxB,EAAE,EAAE,YAAK,CAAC,MAAM,CAAC;QACf,WAAW,EAAE,uEAAuE;KACrF,CAAC;CACH,CAAC;kBArBiB,SAAS"}
|
|
@@ -39,6 +39,15 @@ export declare function sendSessionCommand(instanceId: string, command: string,
|
|
|
39
39
|
export declare function getAndroidInstanceClient(lim: Limrun, target: LastAndroidInstance, options?: {
|
|
40
40
|
adbPath?: string;
|
|
41
41
|
}): Promise<ResolvedAndroidInstanceClient>;
|
|
42
|
+
/**
|
|
43
|
+
* Runs one simctl command on an iOS instance and collects its output, for commands that
|
|
44
|
+
* print the result once instead of streaming it.
|
|
45
|
+
*/
|
|
46
|
+
export declare function runIosSimctl(lim: Limrun, target: LastIosInstance, args: string[], opts?: Ios.SimctlOptions): Promise<{
|
|
47
|
+
code: number;
|
|
48
|
+
stdout: string;
|
|
49
|
+
stderr: string;
|
|
50
|
+
}>;
|
|
42
51
|
export declare function getIosInstanceClient(lim: Limrun, target: LastIosInstance): Promise<ResolvedIosInstanceClient>;
|
|
43
52
|
export {};
|
|
44
53
|
//# sourceMappingURL=instance-client-factory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instance-client-factory.d.ts","sourceRoot":"","sources":["../../src/lib/instance-client-factory.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAwB,GAAG,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAGrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAqB,KAAK,mBAAmB,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAE7F,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AAElE,M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AM,EACf,IAAI,GAAE,OAAO,EAAO,EACpB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,OAAO,CAAC,CAElB;AAED,wBAAsB,wBAAwB,CAC5C,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,mBAAmB,EAC3B,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GACjC,OAAO,CAAC,6BAA6B,CAAC,CAiCxC;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAChC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,MAAM,EAAE,EACd,IAAI,GAAE,GAAG,CAAC,aAAkB,GAC3B,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAO3D;AAED,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,yBAAyB,CAAC,CAsBpC"}
|
|
@@ -5,6 +5,7 @@ exports.setSessionAutoStart = setSessionAutoStart;
|
|
|
5
5
|
exports.ensureDaemonSession = ensureDaemonSession;
|
|
6
6
|
exports.sendSessionCommand = sendSessionCommand;
|
|
7
7
|
exports.getAndroidInstanceClient = getAndroidInstanceClient;
|
|
8
|
+
exports.runIosSimctl = runIosSimctl;
|
|
8
9
|
exports.getIosInstanceClient = getIosInstanceClient;
|
|
9
10
|
const api_1 = require("@limrun/api");
|
|
10
11
|
const instance_token_1 = require("@limrun/api/instance-token");
|
|
@@ -102,6 +103,19 @@ async function getAndroidInstanceClient(lim, target, options = {}) {
|
|
|
102
103
|
});
|
|
103
104
|
return { type: 'android', client, disconnect: () => client.disconnect(), isSession: false };
|
|
104
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* Runs one simctl command on an iOS instance and collects its output, for commands that
|
|
108
|
+
* print the result once instead of streaming it.
|
|
109
|
+
*/
|
|
110
|
+
async function runIosSimctl(lim, target, args, opts = {}) {
|
|
111
|
+
const { client, disconnect } = await getIosInstanceClient(lim, target);
|
|
112
|
+
try {
|
|
113
|
+
return await client.simctl(args, opts).wait();
|
|
114
|
+
}
|
|
115
|
+
finally {
|
|
116
|
+
disconnect();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
105
119
|
async function getIosInstanceClient(lim, target) {
|
|
106
120
|
if (target.apiUrl && target.token) {
|
|
107
121
|
const client = await api_1.Ios.createInstanceClient({ apiUrl: target.apiUrl, token: target.token });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instance-client-factory.js","sourceRoot":"","sources":["../../src/lib/instance-client-factory.ts"],"names":[],"mappings":";;AAwBA,gDASC;AAKD,kDAEC;AAYD,kDA4BC;AAKD,gDAOC;AAED,4DAqCC;AAED,oDAyBC;
|
|
1
|
+
{"version":3,"file":"instance-client-factory.js","sourceRoot":"","sources":["../../src/lib/instance-client-factory.ts"],"names":[],"mappings":";;AAwBA,gDASC;AAKD,kDAEC;AAYD,kDA4BC;AAKD,gDAOC;AAED,4DAqCC;AAMD,oCAYC;AAED,oDAyBC;AAhLD,qCAAqF;AACrF,+DAA2D;AAC3D,mDAA+D;AAC/D,qCAA8C;AAC9C,qCAA6F;AAoB7F,SAAgB,kBAAkB,CAAC,EAAU;IAC3C,MAAM,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAChC,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC3C,IAAI,MAAM,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC;IACnC,IAAI,MAAM,KAAK,OAAO,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,OAAO,CAAC;IAC/D,IAAI,MAAM,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAC;IACzC,MAAM,IAAI,KAAK,CACb,wCAAwC,EAAE,4EAA4E,CACvH,CAAC;AACJ,C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":"","sources":["../../src/lib/stdin.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,wBAAsB,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAMjD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readStdin = readStdin;
|
|
4
|
+
/** Reads standard input until end of file. */
|
|
5
|
+
async function readStdin() {
|
|
6
|
+
const chunks = [];
|
|
7
|
+
for await (const chunk of process.stdin) {
|
|
8
|
+
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
9
|
+
}
|
|
10
|
+
return Buffer.concat(chunks);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=stdin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdin.js","sourceRoot":"","sources":["../../src/lib/stdin.ts"],"names":[],"mappings":";;AACA,8BAMC;AAPD,8CAA8C;AACvC,KAAK,UAAU,SAAS;IAC7B,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QACxC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lim",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
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"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"test": "jest"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@limrun/api": "0.
|
|
28
|
+
"@limrun/api": "0.57.0",
|
|
29
29
|
"@oclif/core": "^4",
|
|
30
30
|
"cli-progress": "^3.12.0",
|
|
31
31
|
"cli-table3": "^0.6.5",
|
|
@@ -54,7 +54,10 @@
|
|
|
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, launch-app, terminate-app, app-log, logcat, record, play-on-microphone, set-wifi-bandwidth, adb-shell"
|
|
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, app-log, logcat, record, play-on-microphone, set-wifi-bandwidth, adb-shell, ca"
|
|
58
|
+
},
|
|
59
|
+
"android:ca": {
|
|
60
|
+
"description": "Trust CA certificates on a running Android instance: add"
|
|
58
61
|
},
|
|
59
62
|
"asset": {
|
|
60
63
|
"description": "Upload, download, list, inspect, and delete files that can be used by iOS & Android as pre-installed apps: push, pull, list, delete"
|
|
@@ -66,7 +69,10 @@
|
|
|
66
69
|
"description": "Build Android projects on cloud Gradle sandboxes: create, list, get, delete, sync, build, run, logs, use, tools"
|
|
67
70
|
},
|
|
68
71
|
"ios": {
|
|
69
|
-
"description": "Execute any task on remote iOS Simulators: create, list, get, delete, attach-xcode, info, fold, list-apps, launch-app, terminate-app, app-log, syslog, sync, screenshot, tap, tap-element, element-tree, type, press-key, toggle-keyboard, scroll, open-url, install-app, keychain, record, camera, microphone, perform, ls, push-file, pull-file, delete-file, simctl, cp, xcrun, xcodebuild, lsof, reverse, tunnel"
|
|
72
|
+
"description": "Execute any task on remote iOS Simulators: create, list, get, delete, attach-xcode, info, fold, list-apps, launch-app, terminate-app, app-log, syslog, sync, screenshot, tap, tap-element, element-tree, type, press-key, toggle-keyboard, scroll, open-url, clipboard, defaults, notify, install-app, keychain, record, camera, microphone, perform, ls, push-file, pull-file, delete-file, simctl, cp, xcrun, xcodebuild, lsof, reverse, tunnel"
|
|
73
|
+
},
|
|
74
|
+
"ios:clipboard": {
|
|
75
|
+
"description": "Set or read the clipboard of a running iOS instance: set, get"
|
|
70
76
|
},
|
|
71
77
|
"session": {
|
|
72
78
|
"description": "Manage persistent background sessions for device interaction: start, status, stop. Sessions are used to execute commands on remote devices without the need to reconnect to the device after each command."
|