start debugger if any value is passed to 'debug'

This commit is contained in:
Laurent Sansonetti
2012-09-15 16:58:01 +02:00
parent 067ba2e151
commit 472cd8a6fd

View File

@@ -95,8 +95,7 @@ task :simulator => ['build:simulator'] do
env = xcode.match(/^\/Applications/) ? "DYLD_FRAMEWORK_PATH=\"#{xcode}/../Frameworks\":\"#{xcode}/../OtherFrameworks\"" : ''
env << ' NO_FOREGROUND_SIM=1' if App.config.spec_mode
sim = File.join(App.config.bindir, 'sim')
debug = (ENV['debug'] || (App.config.spec_mode ? '0' : '2')).to_i
debug = 2 if debug < 0 or debug > 2
debug = (ENV['debug'] ? 1 : (App.config.spec_mode ? '0' : '2'))
App.info 'Simulate', app
at_exit { system("stty echo") } # Just in case the simulator launcher crashes and leaves the terminal without echo.
sh "#{env} #{sim} #{debug} #{family_int} #{target} \"#{xcode}\" \"#{app}\""