Skip to content

Instantly share code, notes, and snippets.

@rummelonp
Created April 20, 2011 01:19
Show Gist options
  • Save rummelonp/930137 to your computer and use it in GitHub Desktop.
Save rummelonp/930137 to your computer and use it in GitHub Desktop.
繋いでる全てのAndroid端末に同じコマンド送る
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
ANDROID_TOOLS = '/Applications/android-sdk-mac_86/platform-tools'
devices_info = `#{ANDROID_TOOLS}/adb devices`
devices = devices_info.split("\n").map {|line| line.split(' ').map.first}[1..-1]
args = ARGV.join(' ')
devices.each do |device|
command = "#{ANDROID_TOOLS}/adb -s #{device} #{args}"
puts command
system command
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment