Chromium Code Reviews| Index: sky/tools/skydb |
| diff --git a/sky/tools/skydb b/sky/tools/skydb |
| index 8ef14abf07f43dc834d5250f5766eac699381c19..a2696bbdda356533d94a8e9179b46eb96433322f 100755 |
| --- a/sky/tools/skydb |
| +++ b/sky/tools/skydb |
| @@ -175,17 +175,26 @@ class SkyDebugger(object): |
| self.paths = self._create_paths_for_build_dir(args.build_dir) |
| self.stop_command(None) # Quit any existing process. |
| - if not os.path.exists(self.paths.mojo_shell_path): |
| - print "mojo_shell not found in build_dir '%s'" % args.build_dir |
| - print "Are you sure you sure that's a valid build_dir location?" |
| - print "See skydb start --help for more info" |
| - sys.exit(2) |
| - |
| # FIXME: This is probably not the right way to compute is_android |
| # from the build directory? |
| gn_args = gn_args_from_build_dir(self.paths.build_dir) |
| is_android = 'android_sdk_version' in gn_args |
| + if is_android: |
|
eseidel
2015/04/21 17:18:28
I would have moved this into a helper function and
|
| + apk_path = os.path.join(self.paths.build_dir, 'apks', |
| + ANDROID_APK_NAME) |
| + if not os.path.exists(apk_path): |
| + print "%s not found in build_dir '%s'" % \ |
| + (ANDROID_APK_NAME, os.path.join(args.build_dir, 'apks')) |
| + print "Are you sure you sure that's a valid build_dir location?" |
| + print "See skydb start --help for more info" |
| + sys.exit(2) |
| + elif not os.path.exists(self.paths.mojo_shell_path): |
| + print "mojo_shell not found in build_dir '%s'" % args.build_dir |
| + print "Are you sure you sure that's a valid build_dir location?" |
| + print "See skydb start --help for more info" |
| + sys.exit(2) |
| + |
| if is_android and args.gdb and not 'is_debug' in gn_args: |
| # FIXME: We don't include gdbserver in the release APK... |
| print "Cannot debug Release builds on Android" |
| @@ -216,8 +225,6 @@ class SkyDebugger(object): |
| subprocess.check_call([ADB_PATH, 'root']) |
| # We could make installing conditional on an argument. |
| - apk_path = os.path.join(self.paths.build_dir, 'apks', |
| - ANDROID_APK_NAME) |
| subprocess.check_call([ADB_PATH, 'install', '-r', apk_path]) |
| port_string = 'tcp:%s' % sky_server.port |