diff --git a/desktop/app/src/utils/IOSBridge.tsx b/desktop/app/src/utils/IOSBridge.tsx index d65b95e80..7f7aa2a7f 100644 --- a/desktop/app/src/utils/IOSBridge.tsx +++ b/desktop/app/src/utils/IOSBridge.tsx @@ -97,16 +97,14 @@ function makeTempScreenshotFilePath() { return path.join(directory, imageName); } -function runScreenshotCommand( +async function runScreenshotCommand( command: string, imagePath: string, ): Promise { - return exec(command) - .then(() => fs.readFile(imagePath)) - .then(async (buffer) => { - await fs.unlink(imagePath); - return buffer; - }); + await exec(command); + const buffer = await fs.readFile(imagePath); + await fs.unlink(imagePath); + return buffer; } export async function xcrunScreenshot(serial: string): Promise {