From abda204a7f5cf5d6d87c3db276385caed2d67f96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Wed, 10 Dec 2014 20:50:32 +0100 Subject: [PATCH] [WatchKit] Add options to launch different watch app `type`. --- lib/motion/project/template/ios.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/motion/project/template/ios.rb b/lib/motion/project/template/ios.rb index b842d3b2..288e4b98 100644 --- a/lib/motion/project/template/ios.rb +++ b/lib/motion/project/template/ios.rb @@ -87,7 +87,13 @@ task :simulate_watch_app do app = App.config.app_bundle('iPhoneSimulator') sim = File.join(App.config.bindir, 'watch-sim') App.info 'Simulate', watch_extension.destination_bundle_path - sh "'#{sim}' '#{app}' -verbose #{App::VERBOSE ? 'YES' : 'NO'} -start-suspended #{ENV['no_continue'] ? 'YES' : 'NO'}" + command = "'#{sim}' '#{app}' -verbose #{App::VERBOSE ? 'YES' : 'NO'} -start-suspended #{ENV['no_continue'] ? 'YES' : 'NO'}" + command << " -type #{ENV['type']}" if ENV['type'] + if ENV['type'] && ENV['type'].downcase == 'notification' && ENV['payload'].nil? + App.fail '[!] The `notification` option is required with `type=notification`.' + end + command << " -notification-payload '#{ENV['payload']}'" if ENV['payload'] + sh(command) end desc "Run the simulator"