Skip to content

Instantly share code, notes, and snippets.

@techmaniack
Created August 12, 2012 23:19
Show Gist options
  • Save techmaniack/3335262 to your computer and use it in GitHub Desktop.
Save techmaniack/3335262 to your computer and use it in GitHub Desktop.
Smart `adb push`
#!/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