-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.py
More file actions
35 lines (26 loc) · 1006 Bytes
/
Test.py
File metadata and controls
35 lines (26 loc) · 1006 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
26
27
28
29
30
31
32
33
34
35
from AndroidAPIs import DeviceInfo, DevicePower, OpenApp, AndroidInfo, SideloadAPK
ADBPath = str(input("Path to ADB: "))
FastbootPath = str(input("Path to fastboot: "))
print("=== Device State ===")
state = DeviceInfo.GetDeviceInfo(ADBPath, FastbootPath)
print(f"Current state: {state}")
print("\n=== Match States ===")
match = DeviceInfo._match_states(ADBPath, FastbootPath, "recovery")
if match is not None:
print(match)
else:
print("Device is not in recovery")
print("\n=== Android Info ===")
AndroidInfo.AndroidVersion(ADBPath, say=True)
AndroidInfo.AndroidSDKVersion(ADBPath, say=True)
AndroidInfo.AndroidBuildID(ADBPath, say=True)
print("\n=== Open App ===")
OpenApp.Open(ADBPath, "com.android.chrome")
import time
time.sleep(3)
print("\n=== Close App ===")
OpenApp.Close(ADBPath, "com.android.chrome")
print("\n=== Sideload APK ===")
SideloadAPK.SideloadAPK(ADBPath, "/home/user/Downloads/myapp.apk")
print("\n=== Shutdown (graceful) ===")
DevicePower.Shutdown(ADBPath, "graceful")