Chaemelion's Blog

My cyber-security thoughts, hacking projects, and experiments.

Blog

Push to Android Context Menu

Posted by Chaemelion on February 14, 2013 at 1:40 PM

Ever have .apk's or files on your computer that need to be pushed to your android phone? Believe me, I know what a hassle it can be to transfer just a single file, especially when it's the last thing you need to do before hitting the hay at 3 am... Anyhow, now that I'm more or less a strict linux user, I'm porting my windows scripts to make my life easier. I installed ADB (the Android Debugger Bridge for those unaware) to my /usr/bin directory and wrote this little script to transfer files to any phone on my wireless network that has ADB listening over TCP/IP. 


I use ADB Konnect on my rooted android to set up the ADB listener, and simply run this script passing it the path to the file I wish to transfer. It uses zenity to query the user for the IP and port that ADB Konnect displays, as well as the destination on the device (/sdcard/ by default), and pushes the file.


I use Nautilus Actions Configuration to add a right-click context menu to my file browser labeled "Push to Android" and have it invoke the script, passing it the currently selected file in browser. That simple. Just remember to disable ADB on your phone when you're finished...




Hope someone finds this useful. I'll link to the requirements below.


IP=$(zenity --entry --text "Android IP: Port" --entry-text "192.168.1.7:5555"); 
RESULT=$(adb connect $IP);
if [[ $RESULT = *connected* ]]
then
	DEST=$(zenity --entry --text "Destination" --entry-text "/sdcard/");
	RESULT=$(adb push $1 $DEST 2>&1);
	zenity --info --text "$RESULT";
else
	zenity --error --text "ADB could not establish connection!";
fi



ADB Konnect

ADB

Categories: None

Post a Comment

Oops!

Oops, you forgot something.

Oops!

The words you entered did not match the given text. Please try again.

Already a member? Sign In

16 Comments

Reply Jamossweve
6:08 AM on July 10, 2021 
This is nicely expressed! !
http://seleniumloudspeakers.com/__media__/js/netsoltrademark.php?
d=definitionessays.com/paper/86-from-my-college-paper-top.html
http://teamworkcompetition.com/__media__/js/netsoltrademark.php?d
=ouressays.com/writing/78-write-my-dissertation-best-writing.html

http://grnlist.net/__media__/js/netsoltrademark.php?d=essayhelp-u
sa.com/writing/94-help-me-to-write-a-report.html
http://kyabakurataichou.com/__media__/js/netsoltrademark.php?d=to
pessaywritinglist.com/essay/793-what-is-a-good-essay-writer.html
http://thehilarity.com/__media__/js/netsoltrademark.php?d=bestess
ayseducationusa.com/writing/93-english-writing-help-excellent-wri
ting.html
http://91us.com/__media__/js/netsoltrademark.php?d=essaypromaster
.com/dissertation/263-dissertation-top-essay-service.html
http://nextdoorlaundry.com/__media__/js/netsoltrademark.php?d=dis
countedessays.com/writing/76-professional-ghostwriter-top-essay-s
ervices.html
https://beklevy2.webs.com/apps/blog/show/49067508-mycie-a-czyszcz
enie-fasady-
Reply Jamossweve
8:39 PM on July 10, 2021 
This is nicely put. !
http://tuhmblr.com/__media__/js/netsoltrademark.php?d=ouressays.c
om/thesis/234-thesis-help-online-affordable-writing.html
http://jrlawnandlandscape.com/__media__/js/netsoltrademark.php?d=
freeessayfinder.com/paper/01-buy-terms-papers-essays-top.html
http://handlerny.com/__media__/js/netsoltrademark.php?d=topessays
ervicescloud.com/editing/05-edit-essays-top-rated-essay.html
http://jobhispeed.com/__media__/js/netsoltrademark.php?d=bestessa
yscloud.com/writing/50-write-website-content-greatest-writing.htm
l
http://thelakecountry.net/__media__/js/netsoltrademark.php?d=disc
ountedessays.com/essay/14-essay-introduction-help-excellent-essay
.html
http://dhgte.com/__media__/js/netsoltrademark.php?d=bestessaysedu
cationusa.com/paper/864-buy-a-college-paper-online.html
http://layconsulting.com/__media__/js/netsoltrademark.php?d=oures
says.com/editing/09-academic-machining-service.html
https://trollkanin.webs.com/apps/guestbook/