We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bba02da commit 3aee098Copy full SHA for 3aee098
screenshot.py
@@ -1,11 +1,15 @@
1
import os
2
+import platform
3
4
5
def capture_screenshot(filename):
6
"""
7
Captures a screenshot of the Android screen using adb and saves it to a file.
8
Returns True if the adb command was successful, False otherwise.
9
- adb_command = "adb exec-out screencap -p > {}".format(filename)
10
+ if platform.system() == "Windows":
11
+ adb_command = "adb exec-out screencap -p > {}".format(filename)
12
+ else:
13
+ adb_command = "adb exec-out screencap -p > {} 2> /dev/null".format(filename)
14
error_code = os.system(adb_command)
15
return error_code == 0
0 commit comments