Project: appceleratorstudio
Issue TISTUD-5225: Liveview: iOS: Second launch of LV enabled project in iOS simulator fails 
h5. Description: When launching a Liveview enabled simulator session, it works as expected. When you attempt to rebuild the project again, the simulator fails to launch and this error presented: {code} [INFO] : Finished building the application in 1s 97ms [LiveView] Closing file/event server process id: 34204 [INFO] : Running application in iOS Simulator [LiveView] version 0.1.32 [LiveView] File Server Started on Port 8324 [LiveView] Event Server Started on Port 8323 [INFO] : Launching application in iOS Simulator [INFO] : Focusing the iOS Simulator [ERROR] : Failed to focus the iPhone Simulator window [ERROR] : /Users/emerriman/Library/Application Support/Titanium/mobilesdk/osx/3.1.2.v20130807171139/iphone/iphone_sim_activate.scpt: execution error: iPhone Simulator got an error: Connection is invalid. (-609) [INFO] : Application has exited from iOS Simulator [INFO] : Project built successfully in 3s 58ms {code} This occurs with both the iPad and iPhone simulators. The order of the console output may vary slightly. Also note that the behavior prevents the user from turning off LV and then launching on the first attempt. The first launch with LV off after encountering this error will fail with the same console output. The second launch with LV off seems to work fine. This may be a clue as to root cause. h5. Steps to reproduce: 1) Create a default classic project in Studio 2) Enable Liveview and launch in the simulator 3) Make some edits if you wish 4) Relaunch the simulator - leaving liveview enabled h5. Result: Project fails to launch correctly in the simulator. Turning off LV and launching will also fail, but will work on the next and subsequent launches with LV off. h5. Expected Result: Project launches as expected and allows real-time editing h5. Notes I monitored the processes here, and it may be expected but subsequent launches of Liveview were killing the existing node PID and launching a new one. Process list: Normal non-LV launch: {code} 39786 1.6 0.8 3104976 67028 ?? S 3:07PM 0:02.09 node /usr/local/bin/titanium --no-colors --no-prompt build --platform ipad --sdk 3.1.2.v20130807171139 --log-level trace --target simulator --ios-version 6.1 --device-family ipad --skip-js-minify {code} Normal LV enabled launch {code} 39891 1.5 0.2 3063424 19808 ?? Ss 3:08PM 0:13.73 /usr/local/bin/node /Applications/Appcelerator_Studio/plugins/com.appcelerator.titanium.liveview.core_1.0.0.1375925433/node_modules/liveview/bin/liveview-server start --project-dir /Users/emerriman/Documents/anewworkspace/Yuntastic --platform ios --no-colors 39873 1.8 1.1 3120336 96244 ?? S 3:08PM 0:16.16 node /usr/local/bin/titanium --no-colors --no-prompt build --platform ipad --sdk 3.1.2.v20130807171139 --log-level trace --target simulator --ios-version 6.1 --device-family ipad --skip-js-minify --liveview --deploy-type development {code} Failed LV enabled launch: {code} 39978 1.6 0.2 3053660 17976 ?? Ss 3:24PM 0:00.29 /usr/local/bin/node /Applications/Appcelerator_Studio/plugins/com.appcelerator.titanium.liveview.core_1.0.0.1375925433/node_modules/liveview/bin/liveview-server start --project-dir /Users/emerriman/Documents/anewworkspace/Yuntastic --platform ios --no-colors 39959 0.0 0.7 3102660 58440 ?? S 3:24PM 0:02.03 node /usr/local/bin/titanium --no-colors --no-prompt build --platform ipad --sdk 3.1.2.v20130807171139 --log-level trace --target simulator --ios-version 6.1 --device-family ipad --skip-js-minify --liveview --deploy-type development {code} First launch non LV failure: No processes Second launch non LV: {code} 40678 2.5 0.7 3102660 58916 ?? S 3:26PM 0:01.99 node /usr/local/bin/titanium --no-colors --no-prompt build --platform ipad --sdk 3.1.2.v20130807171139 --log-level trace --target simulator --ios-version 6.1 --device-family ipad --skip-js-minify {code}
Story points: 8