Permalink
Browse files

Try quitting via the preload library for now.

  • Loading branch information...
1 parent 2130ec3 commit ed0d6816c73c3da3a606c824e9914900f8bf39a1 Rob Holland committed Jun 20, 2010
Showing with 13 additions and 7 deletions.
  1. +8 −6 lib/icuke/iphonesim.rb
  2. +1 −1 lib/icuke/sdk.rb
  3. +4 −0 lib/icuke/simulator.rb
View
14 lib/icuke/iphonesim.rb
@@ -15,8 +15,14 @@ def launch(project_file, options = {})
options[:env]['CFFIXED_USER_HOME'] = Dir.mktmpdir
- command = ICuke::SDK.launch("#{directory}/#{app_name}.app/#{app_name}", options[:platform], options[:env])
- puts `#{command}`
+ command = ICuke::SDK.launch("#{directory}/#{app_name}.app", options[:platform], options[:env])
+ fork {
+ STDERR.close
+ STDIN.close
+ STDOUT.close
+
+ exec command
+ }
timeout(30) do
begin
@@ -27,9 +33,5 @@ def launch(project_file, options = {})
end
end
end
-
- def quit
- # Not sure what, if anything, to do here.
- end
end
end
View
2 lib/icuke/sdk.rb
@@ -122,7 +122,7 @@ def self.ld
def self.launch(application, family = :ipad, environment = {})
environment_args = environment.map { |k, v| %Q{#{k}="#{v}"} }.join(' ')
- %Q{#{ICUKE_BIN_DIR}/iphonesim #{environment_args} "#{application}" #{version} #{family}}
+ %Q{#{ICUKE_BIN_DIR}/iphonesim #{environment_args} launch "#{application}" #{version} #{family}}
end
private
View
4 lib/icuke/simulator.rb
@@ -47,6 +47,10 @@ def set_defaults(defaults)
get '/defaults', :query => defaults.to_json
end
+ def quit
+ get '/quit'
+ end
+
def get(path, options = {})
options[:query] = URI.escape(options[:query]) if options.has_key?(:query)
response = self.class.get(path, options)

0 comments on commit ed0d681

Please sign in to comment.