Pages

Showing posts with label install. Show all posts
Showing posts with label install. Show all posts

Monday, February 3, 2014

Mass install on android devices via BASH

How to install on all your android devices consecutively

This is the command you copy paste on your bash prompt or script:

for d in $(adb devices | egrep "device$" | sed "s/[[:space:]]device$//");
do
  adb -s $d install -r bin/some.apk;
done

Determine that adb can be accessed from the $PATH variable. That or write out the full path where the adb command is located.

PATH="$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$PATH"

Happy coding!

P.S. broken-ass implementations of sed like on mac os x don't acknowledge the existence of

[[:space:]]

so, use something like

\s+

or

[\t ]+

and you might have to use sed like this:

sed -e ...

Tuesday, July 20, 2010

Pstools part 3: pushing silent updates

Suppose that you use clamwin and spybot s&d because your boss is cheap and you sure as hell ain't gonna pay for it yourself, but you have to provide some type of baseline security for your AD (active directory) networked windows clients; and you're too lazy to manually install over 50 machines, while people are using the aforementioned machines.

Pstools and silent install to the rescue!

Type the following from a superuser account in the AD network in the command line interface (dos):

psexec @hosts.txt -s -n 3 -c -v "clamwin-x.y-setup.exe" /sp- /silent /norestart
psexec @hosts.txt -s -n 3 -c -v "spybotsdxyz.exe" /sp- /silent /suppressmsgboxes /norestart


Legend:

parameterexplanation
@hosts.txta file containing ip-addresses or domain client computer names seperated by endlines
-srun with system rights
-n 3try maximum of three times, before concluding that the client is not reachable
-c -vPush the following file (e.g. clamwin-x.y-setup.exe) to client; -v implies push only if it's newer (spare bandwidth, non-clobber).