-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathapp.py
executable file
·45 lines (32 loc) · 929 Bytes
/
app.py
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
36
37
38
39
40
41
42
43
#!/usr/bin/env python
import sys, os
def command(cmd):
print cmd
os.system(cmd)
def details(args):
package = args[0]
command("adb shell am start -a android.settings.APPLICATION_DETAILS_SETTINGS -d package:%s" % package)
def clear(args):
package = args[0]
command("adb shell pm clear %s" % package)
def list(args):
package = args[0]
command("adb shell pm list package | grep %s " % package)
def editme(args):
command("vi /home/jdsong/workspace/scripts/app.py")
def dump(args):
package = args[0]
command("adb shell dumpsys package %s" % package)
def uninstall(args):
package = args[0]
command("adb shell pm uninstall %s" % package)
def hierarchy(args):
command("adb shell dumpsys activity top ")
def main():
action = sys.argv[1]
args = sys.argv[2:]
call = "%s(%s)" % (action, args)
print call
exec(call)
if __name__ == "__main__":
main()