MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / downloadSimulatorScreenshot

Function downloadSimulatorScreenshot

packages/client/src/app/AppShell.tsx:2062–2090  ·  view source on GitHub ↗
(withBezel: boolean)

Source from the content-addressed store, hash-verified

2060 }
2061
2062 async function downloadSimulatorScreenshot(withBezel: boolean) {
2063 if (!selectedSimulator) {
2064 return;
2065 }
2066 setLocalError("");
2067 const statusLabel = withBezel
2068 ? "Capturing screenshot with bezel..."
2069 : "Capturing screenshot...";
2070 setTransientCaptureStatus(statusLabel, true);
2071 try {
2072 const blob = await captureSimulatorScreenshot(selectedSimulator.udid, {
2073 withBezel,
2074 });
2075 downloadBlob(
2076 blob,
2077 `${captureFileBaseName(selectedSimulator, "Screenshot")}${withBezel ? " Bezel" : ""}.png`,
2078 );
2079 const successLabel = "Screenshot downloaded";
2080 setTransientCaptureStatus(successLabel, false);
2081 clearCaptureStatusLater(successLabel);
2082 } catch (captureError) {
2083 setCaptureStatus(null);
2084 setLocalError(
2085 captureError instanceof Error
2086 ? captureError.message
2087 : "Capture failed.",
2088 );
2089 }
2090 }
2091
2092 async function toggleSimulatorRecording() {
2093 if (!selectedSimulator) {

Callers 1

AppShellFunction · 0.85

Calls 5

downloadBlobFunction · 0.85
captureFileBaseNameFunction · 0.85
clearCaptureStatusLaterFunction · 0.85

Tested by

no test coverage detected