-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstop_apk.py
More file actions
25 lines (21 loc) · 883 Bytes
/
stop_apk.py
File metadata and controls
25 lines (21 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from android_scripts_python.library import main_functions
from android_scripts_python.library.device_operations import display_selected_device, is_adb_device
from android_scripts_python.library.apk_operations import apk_operations
from android_scripts_python.library.text_formatting import pbold
def main():
if len(sys.argv) < 2:
pbold("\n Enter the apk string to search : ")
apk_name = input().strip()
else:
apk_name = sys.argv[1]
main_functions.get_device_choice()
display_selected_device(main_functions.deviceSerial)
if is_adb_device(main_functions.deviceSerial):
apk_operations(main_functions.deviceSerial, apk_name, "stop")
else:
print(" Device is not in 'adb' mode")
if __name__ == "__main__":
main()