Skip to content

Instantly share code, notes, and snippets.

@cho45
Created July 11, 2009 05:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cho45/145085 to your computer and use it in GitHub Desktop.
Save cho45/145085 to your computer and use it in GitHub Desktop.
require "rubygems"
require "rake"
require "pathname"
require "rexml/document"
manifest = REXML::Document.new(File.read("AndroidManifest.xml"))
PACKAGE = manifest.elements["/manifest/@package"].value
NAME = manifest.elements["/manifest/application/activity/@android:name"].value
task :default => :run
task :run do
sh "ant", "debug"
sh "adb", "install", "-r", Pathname.glob("bin/*.apk")[0]
sh "adb", "shell", "am start -a android.intent.action.MAIN -n #{PACKAGE}/#{NAME}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment