Created
October 2, 2012 10:52
-
-
Save falkorichter/3818144 to your computer and use it in GitHub Desktop.
A script that can do installs and deinstalls on all connected Android devices
This file contains 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
import os | |
import sys | |
argument = sys.argv[1] | |
install = False | |
if argument.endswith(".apk"): | |
install = True | |
revision = os.popen("adb devices").read() | |
devices = revision.split("\n") | |
for device in devices: | |
if device.endswith("device"): | |
deviceId = device.split("\t")[0] | |
print "\"" + deviceId + "\"" | |
if install: | |
print os.popen("adb -s " + deviceId + " install -r " + argument).read() | |
else: | |
print os.popen("adb -s " + deviceId + " uninstall " + argument).read() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment