'rake device' now honors the 'id' environment variable that can be used to specify the ID of the device where the app should be installed (useful when there are multiple devices connected)

This commit is contained in:
Laurent Sansonetti
2012-09-01 20:12:51 +02:00
parent b59e128018
commit e8036d2eaa

View File

@@ -147,12 +147,13 @@ end
desc "Deploy on the device"
task :device => 'archive:development' do
App.info 'Deploy', App.config.archive
unless App.config.provisioned_devices.include?(App.config.device_id)
App.fail "Connected device ID `#{App.config.device_id}' not provisioned in profile `#{App.config.provisioning_profile}'"
device_id = (ENV['id'] or App.config.device_id)
unless App.config.provisioned_devices.include?(device_id)
App.fail "Device ID `#{device_id}' not provisioned in profile `#{App.config.provisioning_profile}'"
end
deploy = File.join(App.config.bindir, 'deploy')
flags = Rake.application.options.trace ? '-d' : ''
sh "#{deploy} #{flags} \"#{App.config.device_id}\" \"#{App.config.archive}\""
sh "#{deploy} #{flags} \"#{device_id}\" \"#{App.config.archive}\""
end
desc "Clear build objects"