-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpushlatestcode2tab.py
More file actions
50 lines (27 loc) · 1.12 KB
/
Copy pathpushlatestcode2tab.py
File metadata and controls
50 lines (27 loc) · 1.12 KB
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
44
45
46
47
48
49
50
import datetime
import subprocess
import os
tabCodeLocation='/storage/self/primary'
localSource='/home/trabitboy/Dropbox/lua/zaz2nim'
def rename_file_on_device(old_name, new_name):
command = 'mv ' + old_name +' '+new_name
result = subprocess.run(['adb', 'shell', command], capture_output=True, text=True)
print(result.stdout)
print(result.stderr)
def create_code_folder_on_device(path, new_name):
command = 'mkdir ' + path +new_name
result = subprocess.run(['adb', 'shell', command], capture_output=True, text=True)
print(result.stdout)
print(result.stderr)
def pushfiles(files):
os.chdir(localSource)
for source in files :
print("file to push :"+source)
result=subprocess.run(['adb','push',source,tabCodeLocation+'/lovegame/'+source])
print(result)
backPhoneCodeName=datetime.datetime.now().strftime("%Y%m%d%H%M%S")+'backzzn'
# rename_file_on_device(tabCodeLocation+'/lovegame', tabCodeLocation+'/'+backPhoneCodeName)
# create_code_folder_on_device(tabCodeLocation+'/', 'lovegame')
sourceFiles=os.listdir(localSource)
print(sourceFiles)
pushfiles(sourceFiles)