I'm trying to take a screenshot on an Android-device/emulator, which should be triggered from within an macOS application.
I've created a bash-script - and it works well if I run it from the terminal.
However, when I run it from my macOS application, I get an error when I try to pull
the image from the device.
ADB="$1"
DEVICE="$2"
PATH="$3"
FILENAME="$4"
$ADB -s "$DEVICE" shell screencap -p "/sdcard/${FILENAME}"
$ADB -s "$DEVICE" pull "/sdcard/${FILENAME}"
I get the following error:
adb: error: cannot create './EBC34F20-4624-4435-806B-15D844F4540C.png': Read-only file system
Why is it different from when I run it in the terminal? I've tried looking at which user is executing though adb and that all comes back with the same info.
I've removed sandbox and hardened runtime from my macOS app to to avoid it interfering.
It doesn't seem to matter if I change location (not /sdcard
) on the emulator either.