diff --git a/lib/motion/project/template/ios.rb b/lib/motion/project/template/ios.rb index 7af264f0..6ac595d2 100644 --- a/lib/motion/project/template/ios.rb +++ b/lib/motion/project/template/ios.rb @@ -109,7 +109,10 @@ END app_args = (ENV['args'] or '') App.info 'Simulate', app at_exit { system("stty echo") } if $stdout.tty? # Just in case the simulator launcher crashes and leaves the terminal without echo. - sh "#{env} #{sim} #{debug} #{family_int} #{target} \"#{xcode}\" \"#{app}\" #{app_args}" + system "#{env} #{sim} #{debug} #{family_int} #{target} \"#{xcode}\" \"#{app}\" #{app_args}" + if $?.exitstatus != 0 + $stderr.puts "\nThe application crashed. A crash report file may have been generated by the system, use `rake crashlog' to open it. Use `rake debug=1' to restart the app in the debugger." + end end desc "Create an .ipa archive" diff --git a/lib/motion/project/template/osx.rb b/lib/motion/project/template/osx.rb index dfdbf0fc..cf003f90 100644 --- a/lib/motion/project/template/osx.rb +++ b/lib/motion/project/template/osx.rb @@ -63,7 +63,10 @@ task :run do app_args = (ENV['args'] or '') App.info 'Run', exec at_exit { system("stty echo") } if $stdout.tty? # Just in case the process crashes and leaves the terminal without echo. - sh "#{env} #{sim} #{debug} #{target} \"#{exec}\" #{app_args}" + system "#{env} #{sim} #{debug} #{target} \"#{exec}\" #{app_args}" + if $?.exitstatus != 0 + $stderr.puts "\nThe application crashed. A crash report file may have been generated by the system, use `rake crashlog' to open it. Use `rake debug=1' to restart the app in the debugger." + end end desc "Run the test/spec suite"