Taking screenshot only shows`screencap` usage
Executing `screenshot()` only logs:
```
usage: screencap [-hp] [-d display-id] [FILENAME]
-h: this message
-p: save the file as a png.
-d: specify the display ID to capture (default: 4619827259835644672)
see "dumpsys SurfaceFlinger --display-id" for valid display IDs.
--hint-for-seamless If set will use the hintForSeamless path in SF
If FILENAME ends with .png it will be saved as a png.
If FILENAME is not given, the results will be printed to stdout.
```
Code to fix this:
```python
def screenshot(outputpath: str):
subprocess.run(f"adb exec-out screencap -p > {outputpath}", shell=True)
return outputpath
```
OS: MacOS 14.4.1
Python: 3.12
0 条评论