Created
April 20, 2011 01:19
-
-
Save rummelonp/930137 to your computer and use it in GitHub Desktop.
繋いでる全てのAndroid端末に同じコマンド送る
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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