aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/post_build_commands.py
diff options
context:
space:
mode:
authorMukilan Thiyagarajan <mukilan@igalia.com>2024-07-01 13:40:00 +0530
committerGitHub <noreply@github.com>2024-07-01 08:10:00 +0000
commit0615428aa9e03345c44bba555065233984d35ffe (patch)
treed063b76792e8cdd997ab2f981e745116f06824f1 /python/servo/post_build_commands.py
parente2e7476404e407caa3e6625f4cf4bd6aed9ded6b (diff)
downloadservo-0615428aa9e03345c44bba555065233984d35ffe.tar.gz
servo-0615428aa9e03345c44bba555065233984d35ffe.zip
android: fix application name used in ./mach run (#32652)
This patch also switches the code to python format strings so that the application name can be interpolated where needed. Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Diffstat (limited to 'python/servo/post_build_commands.py')
-rw-r--r--python/servo/post_build_commands.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/python/servo/post_build_commands.py b/python/servo/post_build_commands.py
index 3f8453cbcdf..9a085c93f51 100644
--- a/python/servo/post_build_commands.py
+++ b/python/servo/post_build_commands.py
@@ -33,6 +33,9 @@ from servo.command_base import (
)
+ANDROID_APP_NAME = "org.servo.servoshell"
+
+
def read_file(filename, if_exists=False):
if if_exists and not path.exists(filename):
return None
@@ -104,7 +107,7 @@ class PostBuildCommands(CommandBase):
print("https://github.com/servo/servo/wiki/Building-for-Android#debugging-on-device")
return
script = [
- "am force-stop org.servo.servoshell",
+ f"am force-stop {ANDROID_APP_NAME}",
]
json_params = shell_quote(json.dumps(params))
extra = "-e servoargs " + json_params
@@ -115,10 +118,10 @@ class PostBuildCommands(CommandBase):
if gst_debug:
extra += " -e gstdebug " + gst_debug
script += [
- "am start " + extra + " org.servo.servoshell/org.servo.servoshell.MainActivity",
+ f"am start {extra} {ANDROID_APP_NAME}/{ANDROID_APP_NAME}.MainActivity",
"sleep 0.5",
- "echo Servo PID: $(pidof org.servo.servoshell)",
- "logcat --pid=$(pidof org.servo.sevoshell)",
+ f"echo Servo PID: $(pidof {ANDROID_APP_NAME})",
+ f"logcat --pid=$(pidof {ANDROID_APP_NAME})",
"exit"
]
args = [self.android_adb_path(env)]