FORUMS
Remove All Ads from XDA

Scripts for Nautilus (Linux file browser)

49 posts
Thanks Meter: 1
 
Post Reply Email Thread
Hello !

I wrote some scripts for easily pushing and installing files/apks to your android device.

The advantage over "command line" and other scripts like mine :
- Multiple selection allowed (install 100 APKs in one click ! )
- You have a progress bar (shows only the progression between multiples files/ not the state of a single pushing).
- You can choose the destination on your phone with a simple prompt by choosing "Push to ..."
- It's a very simple and lightweight nautilus script...
- You don't have to (in fact, you can't) put the usb in "usb disk" mode, just have debugging enabled.

Examples
To simply install some applications, just select them, right click, go to scripts->ADB->install


Progression :


Idem for files :


Progress :


Confirmation :


(So the "Push to ..." allow you to choose a destination. "Push to musique" is just a copy of "Push to sdcard" with the second line of the script changed to copy files to /sdcard/music/ instead of /sdcard/ )

How to install
- Download the scripts :
http://www.itstudents.be/~tom/androi...autilus.tar.gz
- Uncompress the files in ~/.gnome2/nautilus_scripts/ADB/
So if your name is mario, you should copy the 3 files to :
/home/mario/.gnome2/nautilus-scripts/ADB/
You are not obliged to make the last folder named ADB, it's just to make "categories" in the Nautilus script menu (like in the screenshots)
Requirements
- A correctly installed ADB

What is a correctly installed ADB?
- The PATH environment variable has to be set, to be able to just type "adb" and not "/path/to/sdk/platform-tools/adb". If it's not done :
Edit the file ~/.bashrc , you can do that by typing in the console
Code:
gedit ~/.bashrc
and add this line changed for yourself at the end of the file
Code:
export PATH=${PATH}:/path/to/android-sdk-linux_86/platform-tools/
Or, if this does'nt work :
Edit the file /etc/environment , you can do that by typing in the console
Code:
gedit /etc/environment
and add this text changed for yourself at the end of the line "PATH:", before the last ["]
Code:
:/path/to/android-sdk-linux_86/platform-tools/


- The rules for udev have to be made to allow any non-root user to access to the device
Method for any HTC device :
Edit with root rights the file /etc/udev/rules.d/51.android.rules by typing in the console :
Code:
gksudo gedit /etc/udev/rules.d/51.android.rules
and add the lines :
Code:
SUBSYSTEM=="usb|usb_device", SYSFS{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"
Hope you'll enjoy !

Please correct my english
 
 
20th August 2010, 11:21 PM |#2  
DKuntz2's Avatar
Junior Member
Thanks Meter: 0
 
More
don't want people to know what you're listening to, eh?

It's cool; I like it.
21st August 2010, 04:17 AM |#3  
Junior Member
Thanks Meter: 0
 
More
very useful
thanks man
21st August 2010, 04:22 PM |#4  
zecoj's Avatar
Member
Flag Melbourne
Thanks Meter: 7
 
More
I've been wanting to do something like this but never had time to. Will definitely test this out!

Sent from my Nexus One using XDA App
21st August 2010, 09:31 PM |#5  
Grindboy's Avatar
Member
Flag Plymouth
Thanks Meter: 3
 
More
Oh epic win thanks for this!

Sent from my HTC Hero using XDA App
3rd December 2010, 08:40 PM |#6  
Junior Member
Thanks Meter: 4
 
More
Please reupload ADB Scripts for Nautilus.tar.gz somewhere.
19th January 2011, 11:55 AM |#7  
OP Member
Flag Liège
Thanks Meter: 1
 
Donate to Me
More
Stupid me...

http://www.kmel.be/~tom/android/ADB%...autilus.tar.gz

Please note a little "bug", the progress bar progress when a file start transfer. So if you send just one big file, it will be at 100% for a little time...
Easily correctible, but I haven't the time now...
The Following User Says Thank You to MappaM For This Useful Post: [ View ] Gift MappaM Ad-Free
2nd March 2011, 03:18 AM |#8  
pietro_spina's Avatar
Senior Member
Western MA
Thanks Meter: 21
 
More
Quote:
Originally Posted by MappaM

Stupid me...

http://www.kmel.be/~tom/android/ADB%...autilus.tar.gz

Please note a little "bug", the progress bar progress when a file start transfer. So if you send just one big file, it will be at 100% for a little time...
Easily correctible, but I haven't the time now...

nice work. very handy
EDIT: actually I may have spoke too soon, these don't seem to be working for me. Ubuntu 10.10
I know my udev and $PATH are all set up correctly. So I'm not sure where these are failing for me..
any thoughts?
EDIT2: OK it was a $PATH issue the ~.bashrc however is only for interactive non login shells adding the adb path to ~.profile and a re-login solved my problem with this script. Or alternatively you could call adb in the script using it's full path.
3rd March 2011, 10:22 PM |#9  
pietro_spina's Avatar
Senior Member
Western MA
Thanks Meter: 21
 
More
Thanks MappaM for the great base script!

Here is my version of "Push to Movies":
My solution to the immediately full progress bar was to use the --pulsate option in zenity this works for me because I am likely to only be sending one file anyway and don't need the fine grain feed back of an incremental progress bar. The one that bounces back and forth is what you will see.

echo "15" ; sleep 1
is a hack, you may not need it but for me it lets the pulsate flag work.

zenity bugs reported here
https://bugs.launchpad.net/zenity/+bug/291850
https://bugzilla.gnome.org/show_bug.cgi?id=567663

Code:
#!/bin/sh

#this is MY path, your path will be different . change this path.
android_path="/sdcard/media/video/movies/"
i=1
(
for thing in "$@"
do
# this first echo tricks the pulsate into working you may not need it. try it both with and without it.
	echo "15" ; sleep 1 
	echo $(($i * 100 / $#))
	echo "# Pushing \"${thing}\"" ; 
	adb push "${thing}" $android_path
	i=$(($i+1))
	
done; i=$(($i-1)) ; echo "# $i files pushed." ) | zenity --progress --pulsate --auto-kill --width=300 --text "Copying files..." --title "Pushing files to $android_path"
The Following User Says Thank You to pietro_spina For This Useful Post: [ View ] Gift pietro_spina Ad-Free
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes