device-shots 0.5.5 → 0.5.6
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/index.js +8 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31,6 +31,7 @@ var DEFAULTS = {
|
|
|
31
31
|
output: "./.screenshots",
|
|
32
32
|
platform: "both",
|
|
33
33
|
time: "9:41",
|
|
34
|
+
androidTime: "9:30",
|
|
34
35
|
frame: true
|
|
35
36
|
};
|
|
36
37
|
async function loadConfig() {
|
|
@@ -51,6 +52,7 @@ function createDefaultConfig(bundleId) {
|
|
|
51
52
|
output: "./.screenshots",
|
|
52
53
|
platform: "both",
|
|
53
54
|
time: "9:41",
|
|
55
|
+
androidTime: "9:30",
|
|
54
56
|
frame: true
|
|
55
57
|
},
|
|
56
58
|
null,
|
|
@@ -332,7 +334,7 @@ async function discoverAndroidDevices(bundleId) {
|
|
|
332
334
|
}
|
|
333
335
|
return devices;
|
|
334
336
|
}
|
|
335
|
-
async function setAndroidDemoMode(serial, time) {
|
|
337
|
+
async function setAndroidDemoMode(serial, time = "9:30") {
|
|
336
338
|
const adb = getAdbPath();
|
|
337
339
|
const hhmm = time.replace(":", "");
|
|
338
340
|
const commands = [
|
|
@@ -597,7 +599,8 @@ async function captureCommand(options) {
|
|
|
597
599
|
const bundleIdDisplay = Array.isArray(bundleId) ? bundleId.join(", ") : bundleId;
|
|
598
600
|
const outputDir = options.output || config.output;
|
|
599
601
|
const platform = options.platform || config.platform;
|
|
600
|
-
const
|
|
602
|
+
const iosTime = options.time || config.time;
|
|
603
|
+
const androidTime = config.androidTime;
|
|
601
604
|
const shouldFrame = !options.noFrame && config.frame;
|
|
602
605
|
const spinner = ora("Discovering devices...").start();
|
|
603
606
|
const devices = await discoverDevices(bundleId, platform);
|
|
@@ -671,13 +674,13 @@ Detected ${devices.length} device(s) with ${bundleIdDisplay}:`)
|
|
|
671
674
|
const androidDevices = devices.filter((d) => d.platform === "android");
|
|
672
675
|
if (iosDevices.length > 0) {
|
|
673
676
|
const s = ora("Setting clean iOS status bar...").start();
|
|
674
|
-
await setIosStatusBar(
|
|
677
|
+
await setIosStatusBar(iosTime);
|
|
675
678
|
s.succeed("iOS status bar set");
|
|
676
679
|
}
|
|
677
680
|
if (androidDevices.length > 0) {
|
|
678
681
|
const s = ora("Setting clean Android status bar...").start();
|
|
679
682
|
for (const device of androidDevices) {
|
|
680
|
-
await setAndroidDemoMode(device.captureId,
|
|
683
|
+
await setAndroidDemoMode(device.captureId, androidTime);
|
|
681
684
|
}
|
|
682
685
|
s.succeed("Android demo mode set");
|
|
683
686
|
}
|
|
@@ -844,7 +847,7 @@ async function frameCommand(dir, options) {
|
|
|
844
847
|
var program = new Command();
|
|
845
848
|
program.name("device-shots").description(
|
|
846
849
|
"Capture and frame mobile app screenshots from iOS simulators and Android emulators"
|
|
847
|
-
).version("0.5.
|
|
850
|
+
).version("0.5.6");
|
|
848
851
|
program.command("capture").description("Capture screenshots from running devices").argument("[name]", "Screenshot name").option("-b, --bundle-id <id>", "App bundle ID").option("-o, --output <dir>", "Output directory").option("-p, --platform <platform>", "ios, android, or both").option("--no-frame", "Skip framing after capture").option("--time <time>", "Status bar time", "9:41").action(async (name, opts) => {
|
|
849
852
|
await captureCommand({ name, ...opts });
|
|
850
853
|
});
|