wip
This commit is contained in:
parent
55b5632bb8
commit
29132f5a58
3 changed files with 160 additions and 140 deletions
|
|
@ -2,4 +2,12 @@
|
|||
|
||||
FOLDER=$(dirname "$(realpath $0)")
|
||||
|
||||
"${FOLDER}/venv/bin/collect-runtime-data" --apk "${1}" --device "${2}" --output "${3}/data.json" --dex-dir "${3}"
|
||||
APK="${1}"
|
||||
DEVICE="${2}"
|
||||
OUT_DIR="${3}"
|
||||
|
||||
echo "APK=${APK}"
|
||||
echo "DEVICE=${DEVICE}"
|
||||
echo "OUT_DIR=${OUT_DIR}"
|
||||
|
||||
"${FOLDER}/venv/bin/collect-runtime-data" --apk "${APK}" --device "${DEVICE}" --output "${OUT_DIR}/data.json" --dex-dir "${3}"
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import subprocess
|
|||
import threading
|
||||
import argparse
|
||||
|
||||
EMULATORS = [f"root34-{i}" for i in range(20)]
|
||||
EMULATORS = [f"root34-{i}" for i in range(1)]
|
||||
ANDROID_IMG = "system-images;android-34;default;x86_64"
|
||||
|
||||
if "ANDROID_HOME" in os.environ:
|
||||
|
|
@ -105,6 +105,8 @@ def del_emulators():
|
|||
|
||||
def worker(emu: str, apklist: list[str], out_folder: Path, script: Path):
|
||||
console_port, adb_port = get_ports(emu)
|
||||
script_env = os.environ.copy()
|
||||
script_env["ANDROID_HOME"] = str(ANDROID_HOME)
|
||||
while apklist:
|
||||
apk = apklist.pop()
|
||||
folder_name = apk.split("/")[-1].removesuffix(".apk")
|
||||
|
|
@ -127,10 +129,12 @@ def worker(emu: str, apklist: list[str], out_folder: Path, script: Path):
|
|||
f"{console_port},{adb_port}",
|
||||
]
|
||||
)
|
||||
subprocess.run([ADB, "-s", f"emulator-{console_port}", "wait-for-device"])
|
||||
|
||||
# Run script
|
||||
subprocess.run(
|
||||
["bash", str(script), f"emulator-{console_port}", apk, str(out_folder)]
|
||||
["bash", str(script), apk, f"emulator-{console_port}", str(folder)],
|
||||
env=script_env,
|
||||
)
|
||||
|
||||
# stop emulator
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue