From 64c8163a014cbda522cfca1b18cac9f3d2acfa9e Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 4 Feb 2019 07:19:42 -0800 Subject: [PATCH] Fix screen recording bug on Pixel devices Summary: Pixels don't seem to allow modifying the modification time of files on the "sdcard". You can repro this by getting a Pixel device and running ``` $ adb shell touch /sdcard/boop $ adb shell touch /sdcard/boop touch: '/sdcard/boop': Invalid argument ``` Access time seems to work, strangely enough, but I'd rather not play games and just create an empty file instead with echo. Reviewed By: danielbuechele Differential Revision: D13941381 fbshipit-source-id: 1321482a07a6698aa5eaf71e5a022c8e7dfe0b18 --- src/chrome/ScreenCaptureButtons.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chrome/ScreenCaptureButtons.js b/src/chrome/ScreenCaptureButtons.js index 71315552794..a1068c2b987 100644 --- a/src/chrome/ScreenCaptureButtons.js +++ b/src/chrome/ScreenCaptureButtons.js @@ -166,7 +166,7 @@ class ScreenCaptureButtons extends Component { this.executeShell( selectedDevice, - `mkdir -p "${devicePath}" && touch "${devicePath}/.nomedia"`, + `mkdir -p "${devicePath}" && echo -n > "${devicePath}/.nomedia"`, ) .then(output => { if (output) {