forked from yan12125/python3-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsend.py
More file actions
26 lines (16 loc) · 738 Bytes
/
Copy pathsend.py
File metadata and controls
26 lines (16 loc) · 738 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
import os.path
from .package import Package
from .util import run_in_dir
target_destdir = '/data/local/tmp/python3'
# TODO: don't send unused files (headers, static libraries)
def send_package(pkgname):
target_tarball_path = '/data/local/tmp/python3-android.tar.bz2'
target_tarball_name = os.path.basename(target_tarball_path)
run_in_dir(['tar', 'jcvf', target_tarball_name, 'sysroot'], cwd=Package.SYSROOT.parent)
run_in_dir(['adb', 'push', str(Package.SYSROOT.parent / target_tarball_name), target_tarball_path])
def main():
run_in_dir(['adb', 'shell', 'rm', '-rf', target_destdir])
run_in_dir(['adb', 'shell', 'mkdir', target_destdir])
send_package('python')
if __name__ == '__main__':
main()