From cb6b303996b2948985cd960b139f5d384ff083a1 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Wed, 23 Sep 2015 12:54:29 -0700 Subject: [PATCH] Fix sky_tool start/listen on iOS --- packages/flutter/lib/sky_tool | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/packages/flutter/lib/sky_tool b/packages/flutter/lib/sky_tool index 55390ca41e..03049850fd 100755 --- a/packages/flutter/lib/sky_tool +++ b/packages/flutter/lib/sky_tool @@ -603,9 +603,8 @@ class IOSDevice(object): '1' ] logging.info(' '.join(cmd)) - out = subprocess.check_output(cmd) - match = re.search(r'\[\.\.\.\.\] Found [^\)]*\) connected', out) - cls._is_connected = match is not None + subprocess.check_output(cmd) + cls._is_connected = True except subprocess.CalledProcessError: cls._is_connected = False return cls._is_connected @@ -1030,15 +1029,17 @@ class StartListening(object): while True: logging.info('Updating running Sky apps...') - # Restart the app on Android. Android does not currently restart using skyx files. - cmd = [ - sys.executable, - os.path.abspath(__file__), - 'start', - '--poke' - ] - logging.info(' '.join(cmd)) - subprocess.check_call(cmd) + device = AndroidDevice() + if device.is_connected(): + # Restart the app on Android. Android does not currently restart using skyx files. + cmd = [ + sys.executable, + os.path.abspath(__file__), + 'start', + '--poke' + ] + logging.info(' '.join(cmd)) + subprocess.check_call(cmd) if args.local_build: # Currently sending to iOS only works if you are building Sky locally