Update tpt-libs, add support for android

This commit is contained in:
Tamás Bálint Misius
2022-04-11 21:11:03 +02:00
parent 29ed52d50e
commit f7527b46e6
53 changed files with 837 additions and 118 deletions

28
android/install-apk.py Normal file
View File

@@ -0,0 +1,28 @@
import os
import os.path
import subprocess
import sys
(
script,
adb,
build_dir,
phony,
apk_name,
) = sys.argv
apk_path = os.path.join(build_dir, apk_name)
phony_path = os.path.join(build_dir, phony)
if os.path.exists(phony_path):
os.remove(phony_path)
if subprocess.run([
adb,
'install',
apk_path,
]).returncode:
sys.exit(1)
with open(phony_path, 'w') as _:
pass