device-shots 0.5.3 → 0.5.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.
- package/dist/index.js +8 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -339,7 +339,8 @@ async function setAndroidDemoMode(serial, time) {
|
|
|
339
339
|
["settings", "put", "global", "sysui_demo_allowed", "1"],
|
|
340
340
|
["am", "broadcast", "-a", "com.android.systemui.demo", "-e", "command", "enter"],
|
|
341
341
|
["am", "broadcast", "-a", "com.android.systemui.demo", "-e", "command", "clock", "-e", "hhmm", hhmm],
|
|
342
|
-
["am", "broadcast", "-a", "com.android.systemui.demo", "-e", "command", "wifi", "-e", "fully", "true"],
|
|
342
|
+
["am", "broadcast", "-a", "com.android.systemui.demo", "-e", "command", "wifi", "-e", "fully", "true", "-e", "wifi", "show"],
|
|
343
|
+
["am", "broadcast", "-a", "com.android.systemui.demo", "-e", "command", "network", "-e", "mobile", "show", "-e", "fully", "true", "-e", "level", "4"],
|
|
343
344
|
["am", "broadcast", "-a", "com.android.systemui.demo", "-e", "command", "battery", "-e", "level", "100", "-e", "plugged", "false"],
|
|
344
345
|
["am", "broadcast", "-a", "com.android.systemui.demo", "-e", "command", "notifications", "-e", "visible", "false"]
|
|
345
346
|
];
|
|
@@ -482,8 +483,9 @@ async function frameAndroidScreenshot(inputPath, outputPath) {
|
|
|
482
483
|
if (!match) return false;
|
|
483
484
|
const width = parseInt(match[1], 10);
|
|
484
485
|
const height = parseInt(match[2], 10);
|
|
485
|
-
const padding =
|
|
486
|
-
const
|
|
486
|
+
const padding = 30;
|
|
487
|
+
const innerRadius = 60;
|
|
488
|
+
const outerRadius = innerRadius + padding;
|
|
487
489
|
const totalW = width + padding * 2;
|
|
488
490
|
const totalH = height + padding * 2;
|
|
489
491
|
const uid = Date.now();
|
|
@@ -497,7 +499,7 @@ async function frameAndroidScreenshot(inputPath, outputPath) {
|
|
|
497
499
|
"-fill",
|
|
498
500
|
"white",
|
|
499
501
|
"-draw",
|
|
500
|
-
`roundrectangle 0,0 ${width - 1},${height - 1} ${
|
|
502
|
+
`roundrectangle 0,0 ${width - 1},${height - 1} ${innerRadius},${innerRadius}`,
|
|
501
503
|
tmpMask
|
|
502
504
|
]);
|
|
503
505
|
await runOrFail("magick", [
|
|
@@ -517,7 +519,7 @@ async function frameAndroidScreenshot(inputPath, outputPath) {
|
|
|
517
519
|
"-fill",
|
|
518
520
|
"black",
|
|
519
521
|
"-draw",
|
|
520
|
-
`roundrectangle 0,0 ${totalW - 1},${totalH - 1} ${
|
|
522
|
+
`roundrectangle 0,0 ${totalW - 1},${totalH - 1} ${outerRadius},${outerRadius}`,
|
|
521
523
|
tmpRounded,
|
|
522
524
|
"-gravity",
|
|
523
525
|
"center",
|
|
@@ -842,7 +844,7 @@ async function frameCommand(dir, options) {
|
|
|
842
844
|
var program = new Command();
|
|
843
845
|
program.name("device-shots").description(
|
|
844
846
|
"Capture and frame mobile app screenshots from iOS simulators and Android emulators"
|
|
845
|
-
).version("0.5.
|
|
847
|
+
).version("0.5.5");
|
|
846
848
|
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) => {
|
|
847
849
|
await captureCommand({ name, ...opts });
|
|
848
850
|
});
|