Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(549)

Unified Diff: sky/tools/skydb

Issue 849923002: Teach 'stop' command how to kill the running Android process (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tools/skydb
diff --git a/sky/tools/skydb b/sky/tools/skydb
index 6f063640bafc146dec0915e0a991a121caac84c3..eca44490be3c8cd6baf4c43572174047600dfce1 100755
--- a/sky/tools/skydb
+++ b/sky/tools/skydb
@@ -36,6 +36,8 @@ SKY_SERVER_PORT = 9999
PID_FILE_PATH = "/tmp/skydb.pids"
DEFAULT_URL = "https://raw.githubusercontent.com/domokit/mojo/master/sky/examples/home.sky"
+ANDROID_PACKAGE = "org.chromium.mojo.shell"
+ANDROID_ACTIVITY = "%s/.MojoShellActivity" % ANDROID_PACKAGE
# FIXME: Move this into mopy.config
def gn_args_from_build_dir(build_dir):
@@ -88,7 +90,7 @@ class SkyDebugger(object):
'-W',
'-S',
'-a', 'android.intent.action.VIEW',
- '-n', 'org.chromium.mojo.shell/.MojoShellActivity',
+ '-n', ANDROID_ACTIVITY,
# FIXME: This quoting is very error-prone. Perhaps we should read
# our args from a file instead?
'--esa', 'parameters', ','.join(escaped_args),
@@ -107,9 +109,6 @@ class SkyDebugger(object):
'--args-for=mojo:sky_debugger_prompt %d' % remote_command_port,
'mojo:window_manager',
]
- # FIXME: This probably is wrong for android?
- if args.use_osmesa:
- shell_args.append('--args-for=mojo:native_viewport_service --use-osmesa')
if 'remote_sky_server_port' in self.pids:
shell_command = self._wrap_for_android(shell_args)
@@ -179,9 +178,15 @@ class SkyDebugger(object):
shell_command = self._build_mojo_shell_command(args)
- # On android we can't launch inside gdb, but rather have to attach.
- if args.gdb and not is_android:
- shell_command = ['gdbserver', ':%s' % GDB_PORT] + shell_command
+ if not is_android:
+ # Desktop-only work-around for mojo crashing under chromoting.
+ if args.use_osmesa:
+ shell_args.append(
+ '--args-for=mojo:native_viewport_service --use-osmesa')
+
+ # On android we can't launch inside gdb, but rather have to attach.
+ if args.gdb:
+ shell_command = ['gdbserver', ':%s' % GDB_PORT] + shell_command
print ' '.join(map(pipes.quote, shell_command))
self.pids['mojo_shell_pid'] = subprocess.Popen(shell_command).pid
@@ -233,6 +238,9 @@ class SkyDebugger(object):
port_string = 'tcp:%s' % self.pids['sky_command_port']
subprocess.call(['adb', 'forward', '--remove', port_string])
+ subprocess.call([
+ 'adb', 'shell', 'am', 'force-stop', ANDROID_PACKAGE])
+
if 'remote_gdbserver_port' in self.pids:
port_string = 'tcp:%s' % self.pids['remote_gdbserver_port']
subprocess.call(['adb', 'forward', '--remove', port_string])
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698