Created
August 12, 2012 23:19
-
-
Save techmaniack/3335262 to your computer and use it in GitHub Desktop.
Smart `adb push`
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 | |
# Ever tried to use wildcard (*) while pushing multiple files to your droid via adb? | |
# This small little script helps you do it. Of Course there are many ways to do it | |
# but one is for the ruby-istas :) | |
# SAMPLE USAGE: ruby smart_push.rb *.pdf books # push all pdf's to /mnt/sdcard/books | |
ARGV.length > 1 ? (dest = "/mnt/sdcard/#{ARGV[-1]}"; ARGV.pop) : dest = "/mnt/sdcard/" | |
ARGV.each do |item| | |
puts File.basename("#{item}") + " is being pushed" | |
`adb push #{item} #{dest}` | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment