Okay so I got everything set up the way the android site says, and they way some other guides I have found said, but when I try starting up adb shell all I get is this error:
error: insufficient permissions for device
Anyone know what the problem may be? Thanks
Just a guess but sounds like it needs superuser and the phone isn't rooted
Sent from my Droid using XDA App
Yeah it sounded like that to me too, but the phone is definitely rooted, and I have the superuser app. I am running D1-MIUI v3.1 right now with no problems, and have run every other ROM under the sun. So that is what is really stumping me.
You need to add a udev android rules file so you can use adb and fastboot. Go to http://wiki.cyanogenmod.com/index.php?title=Howto:_Install_the_Android_SDK and follow the directions on how to set up udev. Run lsusb in a terminal while your droid is connected so you can pull the ID for it. the first 4 numbers are for vendor id and the last 4 are the device numbers. Reboot after you do this and adb and fastboot will both work. This applies for all android phones, just replace the vendor and product id #s and that's it. If you need help, feel free to follow me on twitter and I'll gladly help you all out.
I have written a very simple step by step instruction for that
http://menodev.com/mobile/debugging-your-android-device-on-linux/
Sent from my Milestone using XDA App
I always just start adb as root. Then after the server is started it can be called from a regular user.
Sent from my HERO200 using XDA App
do these commands to fix the issue
Code:
sudo gedit /etc/udev/rules.d/51-android.rules
then add this line to the file
Code:
SUBSYSTEM=="usb", SYSFS{idVendor}=="22b8", MODE="0666"
save, exit and reboot your computer.
should fix the issue
Related
What is the simplest way to send commands to my phone (HTC Hero CDMA Sprint) through my computer (Mac OS)?
I haven't explored Android SDK yet. I rooted my phone through Terminal and bash_profile file. I'm interested in:
- how to push .apk's to the device
- how to install a recovery image if my phone can't reboot and there is not a recovery image present
Thanks!
Android sdk is the easiest
-------------------------------------
Sent via the XDA Tapatalk App
What I do is use terminal and cd to the Android sdk/tools folder. After that use the ./adb commands, which there are several tutorials for and own your phone. Hope this is clear, doing it on my phone
-------------------------------------
Sent via the XDA Tapatalk App
What I do is use terminal and cd to the Android sdk/tools folder. After that use the ./adb commands, which there are several tutorials for and own your phone. Hope this is clear, doing it on my phone
Click to expand...
Click to collapse
Sweet. Thanks. I've searched the Android SDK site and it seems that I need other software or plunging such as Eclipse and Java. I'm not ruling these out eventually but know I'm not ready to get in this deep yet to start developing apps or customizing roms. Also, after a Google search all the queries came back with options for rooting your device which I've already done. If there's a good easy tutorial, would you mind posting a link?
-------------------------------------
Sent via the XDA Tapatalk App
When I get home from work I'll find something for you.
-------------------------------------
Sent via the XDA Tapatalk App
joshuaharp said:
Sweet. Thanks. I've searched the Android SDK site and it seems that I need other software or plunging such as Eclipse and Java. I'm not ruling these out eventually but know I'm not ready to get in this deep yet to start developing apps or customizing roms. Also, after a Google search all the queries came back with options for rooting your device which I've already done. If there's a good easy tutorial, would you mind posting a link?
-------------------------------------
Sent via the XDA Tapatalk App
Click to expand...
Click to collapse
Just download the 2.1 SDK, cd to Android/SDK/tools, and use ./adb, I think it can tell you some commands too.
I made an app to put my phone in recovery using ./adb so I wouldn't need to go through the trouble everytime, I just go to spotlight, type "recovery", and it puts it into recovery.
I might make an app/interface for Mac OS later for ADB commands (recovery, push files, etc)
derekwilkinson said:
Just download the 2.1 SDK, cd to Android/SDK/tools, and use ./adb, I think it can tell you some commands too.
I made an app to put my phone in recovery using ./adb so I wouldn't need to go through the trouble everytime, I just go to spotlight, type "recovery", and it puts it into recovery.
I might make an app/interface for Mac OS later for ADB commands (recovery, push files, etc)
Click to expand...
Click to collapse
That would be awesome dude...
joshuaharp said:
That would be awesome dude...
Click to expand...
Click to collapse
Don't hold your breath though, I have been working a lot, but I might make it in the next few weeks.
The only main problem is that I'm having trouble getting variables to run in the shell script. I think it might be possible with Automator (or AppleScript), but I will keep trying
Well, even though it may not be useful anymore, here are the links, as promised
Rooting guide for mac (What I used and a great way to get familiar with adb on the mac ) http://forum.xda-developers.com/showthread.php?t=581686
And here's an adb tutorial that was put together at the request of toast on the EVO 4G forum. http://forum.xda-developers.com/showthread.php?t=694250
After searching and having a headache for 5+ hours I wanted to make an easy how to for noobs running ubuntu 10.10.
I found a ton of information on a ton of sites, and after a lot of cross post referencing I finally figured it all out, so I will lay this out in as simple a way possible so nobody has to have the same issues I had.
Pre-requisites: latest android sdk, ubuntu 10.10, general knowlege of linux
Step 1. Obtaining and making fastboot/adb executable
Download THIS package containing the fastboot binary and the 70-android.rules file
extract files anywhere (remember for later use)
copy fastboot binary to your /android-sdk-linux_86/tools/ folder
open terminal and execute
Code:
chmod +x <path to>/android-sdk-linux_86/tools/fastboot
chmod +x <path to>/android-sdk-linux_86/platform-tools/adb
Step 2. Adding your tools and platform tools directories to the path
in teminal execute
Code:
gedit .bashrc
at the end of the file insert
Code:
# enable android tools directories in path
export PATH=${PATH}:~<path to>/android-sdk-linux_86/tools
export PATH=${PATH}:~<path to>/android-sdk-linux_86/platform-tools
Step 3. Getting ubuntu to recognize your phone in adb and fastboot
in terminal execute
Code:
sudo cp <path to>/70-android.rules /etc/udev/rules.d/70-android.rules
sudo chmod a+rx /etc/udev/rules.d/70-android.rules
sudo reboot
Step 4. Make sure it works
after reboot open terminal and execute
Code:
adb devices
as long as it returns a device with HTXXXXXXXXXX you should be golden
There's a typo in the Android SDK paths in your message. You're missing the x in _x86. Was wondering why adb wasn't in my path after I copy pasted that into my .bashrc.
Here's the correct forms.
Code:
chmod +x <path to>/android-sdk-linux_x86/tools/fastboot
chmod +x <path to>/android-sdk-linux_x86/platform-tools/adb
Code:
# enable android tools directories in path
export PATH=${PATH}:~<path to>/android-sdk-linux_x86/tools
export PATH=${PATH}:~<path to>/android-sdk-linux_x86/platform-tools
Another thing that puzzled me was that there appears to be a hard coded username in the udev rules file. Should that be edited too?
Yes, you need to update your udev rules:
http://forum.xda-developers.com/showthread.php?t=640158
I cant seem to find the path to /70-android.rules /etc/udev/rules.d/70-android.rules.
Not sure what you mean?
Try this method
Rogoshin said:
I cant seem to find the path to /70-android.rules /etc/udev/rules.d/70-android.rules.
Click to expand...
Click to collapse
Dude, I put these instructions together sometime in 2010, and should be easy enough to follow. Following all those other instructions used to have me trying for hours to set up adb & fastboot, so when I got a little more familiar with Linux I made my own, with root permissions, so you don't have to sudo anything. You can have adb & fastboot up and running in 5 minutes, if you follow the instructions step by step. http://forum.xda-developers.com/showthread.php?t=820122
blas4me said:
Dude, I put these instructions together sometime in 2010, and should be easy enough to follow. Following all those other instructions used to have me trying for hours to set up adb & fastboot, so when I got a little more familiar with Linux I made my own, with root permissions, so you don't have to sudo anything. You can have adb & fastboot up and running in 5 minutes, if you follow the instructions step by step. http://forum.xda-developers.com/showthread.php?t=820122
Click to expand...
Click to collapse
Well it did not work for me. In step 2 when you have to add auto prompt I get this error "Can't create user application configuration folder /home/rogoshin/.local/share/applications: Not a directory".
What i was looking for is the 70 android rules file.
You create the 70 Android rules file yourself...
danger-rat said:
You create the 70 Android rules file yourself...
Click to expand...
Click to collapse
I thought it was in the link, but the link does not work for me.
If I create the file myself, where do I get the content?
Sendt fra min Galaxy Nexus med Tapatalk
Talderon said:
As stated by DEEsx1 the following is correct:
Code:
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", MODE="0666"
However, it has been a mystery as to why the following location/file does not work for everyone:
Code:
/etc/udev/rules.d/51-android.rules
I am running Ubuntu 9.10 on my laptop with nothing special, just a straight load. the 51-android.rules code did not work for me.
I searched around on a few linux/android forums and found that some people had luck with creating the following file:
Code:
/etc/udev/rules.d/90-android.rules
However, that did not work for me. I had to create the following file:
Code:
/etc/udev/rules.d/99-android.rules
Now, if you are still getting the error, you don't need to reboot, you just need to restart udev:
Code:
sudo /etc/init.d/udev restart
You may also need to restart the adb daemon:
Code:
adb kill-server
adb start-server
adb devices
Now, worse case that I have seen, make sure the phone is not plugged into the computer, reboot the system AND the phone then try again (I have only seen this once).
Hope these tips help!
Click to expand...
Click to collapse
rotohammer said:
Welcome to Linux!
Actually, the more you use it, you'll find that you'll pickup these bits along the way, just like this.
The files are processed in order of their name so 51-xxx is mid-way through, 99-xx is at the tail end of the processing order. Sometimes, the order is important.
Also, after posting the wrong info to you earlier, I deleted the entry I posted. But, it turns out, the Nexus one poses as both id numbers. While in Android its VendorId=18d1, but in the bootloader (waiting in fastboot usb), the VendorId=0bb4.
So, I put both lines in one file today and all is well again.
I.e:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666"
and I changed my filename to 99-android.rules
then ran:
sudo restart udev
and now I can access the phone as a non root user again, either from adb or fastboot-linux.
Click to expand...
Click to collapse
This should be sufficient...
The auto script creates it for you, but up must have your phone connected for it to add your device id
Sent from my Nexus One using xda premium
blas4me said:
The auto script creates it for you, but up must have your phone connected for it to add your device id
Sent from my Nexus One using xda premium
Click to expand...
Click to collapse
auto script i am not sure i follow
It's a script that automates the process...
danger-rat said:
It's a script that automates the process...[/QUO
Where is this script?
Sendt fra min Galaxy Nexus med Tapatalk
Click to expand...
Click to collapse
The link is in my first post, pay attention!!!!!!!!!!
Sent from my Nexus One using xda premium
blas4me said:
The link is in my first post, pay attention!!!!!!!!!!
Sent from my Nexus One using xda premium
Click to expand...
Click to collapse
After i have completed all the steps, i tried the last command and got "no such command". I tried android rules 99, but maybe with Ubuntu 11.10 i should try a different number.
Sendt fra min Galaxy Nexus med Tapatalk
Try restarting udev, or enter root session on your fs, and make adb and fastboot executables, then restart udev.
Sent from my Nexus One using xda premium
blas4me said:
Try restarting udev, or enter root session on your fs, and make adb and fastboot executables, then restart udev.
Sent from my Nexus One using xda premium
Click to expand...
Click to collapse
This might be the root of the problem, because in usr/local i cant find adb or fastboot.
?????????? insufficient permissions.
this is the message you get in linux when adb and fastboot have trouble detecting your device. im no guru. so you will have to bear with me. this procedure will work on most devices. and most debian or ubuntu based distros. but i am giving it for detecting htc vivid setup on ubuntu 10.10
after u recieve the error in terminal type in command (lsusb)
the terminal will spit out vendor id's for all usb devices attatched. on the vivid it is 0bb4:0cbb
then you need to create a new file (sudo gedit /etc/udev/rules.d/51-android.rules)
your vendor id is added to that file (SUBSYSTEMS==”usb”, ATTRS{idVendor}==”0bb4″, ATTRS{idProduct}==”0c01″, MODE=”0666″) save and exit
fix permissions to the file just in case (chmod a+r /etc/udev/rules.d/51-android.rules) i found i needed this.
then kill the adb server (./adb kill-server)
have at it again and you should be all good. (./adb devices) should show up now.
like i said im not hardcore. it took me some serious googling to get over this hump for me. i was wondering if this should be stickied so linux users with this issue can get passed it quickly. this is the first device i have owned that my ubuntu box didnt natively detect.
drwario said:
?????????? insufficient permissions.
this is the message you get in linux when adb and fastboot have trouble detecting your device. im no guru. so you will have to bear with me. this procedure will work on most devices. and most debian or ubuntu based distros. but i am giving it for detecting htc vivid setup on ubuntu 10.10
after u recieve the error in terminal type in command (lsusb)
the terminal will spit out vendor id's for all usb devices attatched. on the vivid it is 0bb4:0cbb
then you need to create a new file (sudo gedit /etc/udev/rules.d/51-android.rules)
your vendor id is added to that file (SUBSYSTEMS==”usb”, ATTRS{idVendor}==”0bb4″, ATTRS{idProduct}==”0c01″, MODE=”0666″) save and exit
fix permissions to the file just in case (chmod a+r /etc/udev/rules.d/51-android.rules) i found i needed this.
then kill the adb server (./adb kill-server)
have at it again and you should be all good. (./adb devices) should show up now.
like i said im not hardcore. it took me some serious googling to get over this hump for me. i was wondering if this should be stickied so linux users with this issue can get passed it quickly. this is the first device i have owned that my ubuntu box didnt natively detect.
Click to expand...
Click to collapse
This is all very basic for setting up adb on linux. I believe its even in the instructions for installing adb on Google's website
Sent from my HTC PH39100 using xda premium
you are correct. but some people, me especially dont understand any of that stuff. so i look for little copy paste procedures anywhere i can. so long as i can find them i dont ask for help. so i thought i would throw it out there for the people who dont look outside of xda for anything. so i hope its both accurate and usefull
This should be in the general Vivid forum. Moderator please move.
Sent from my HTC Vivid using XDA Premium.
What is it ? ADB Shell . is it CMD command on Windows or what ?
muslimbaha said:
What is it ? ADB Shell . is it CMD command on Windows or what ?
Click to expand...
Click to collapse
https://developer.android.com/tools/help/adb.html
It's Android Debug Bridge. Basically, it's a command line interface from your PC to your phone. Think of a terminal emulator that you run on the phone itself. ADB is pretty much the same, but from a PC. It is part of Android SDK. You can also find it included in many installation packages posted here on XDA, e.g. CWM recovery. There is an executable and a couple of DLLs.
P.S.: TrymHansen beat me to it...
kt-Froggy said:
It's Android Debug Bridge. Basically, it's a command line interface from your PC to your phone. Think of a terminal emulator that you run on the phone itself. ADB is pretty much the same, but from a PC. It is part of Android SDK. You can also find it included in many installation packages posted here on XDA, e.g. CWM recovery. There is an executable and a couple of DLLs.
P.S.: TrymHansen beat me to it...
Click to expand...
Click to collapse
Sorry, but i know what it is now, how do i run it though? im trying to follow the htc desire hd guide to root my phone, which everything is done up until the point i have to test that i have root in debug mode. Not sure how to do this? run abd.exe? it just showed me a cmd window which runs and then dissapears.
If you got your phone rooted or want to test it run adb.exe shell the type su and hit enter. If the prompt change from $ to # you have root access
Sent from my LG-P990 using xda app-developers app
bitdomo said:
If you got your phone rooted or want to test it run adb.exe shell the type su and hit enter. If the prompt change from $ to # you have root access
Sent from my LG-P990 using xda app-developers app
Click to expand...
Click to collapse
What is likely to be the problem if it says SU permission denied?
If you are on stock, that means that you have no root access. If you have cm10 or cm10.1 you have to enable adb root access somewhere in the settings. I am sorry but I can not tell you at the moment where to enable it because I am on stock right now.
Sent from my LG-P990 using xda app-developers app
kt-Froggy said:
It's Android Debug Bridge. Basically, it's a command line interface from your PC to your phone. Think of a terminal emulator that you run on the phone itself. ADB is pretty much the same, but from a PC. It is part of Android SDK. You can also find it included in many installation packages posted here on XDA, e.g. CWM recovery. There is an executable and a couple of DLLs.
P.S.: TrymHansen beat me to it...
Click to expand...
Click to collapse
Thanks Bro for this information
You are unable to just plug in your Nexus 4 in Linux but it is very easy to mount and unmount to move data to/from your sdcard. This is one option that will allow you to utilize Nautilis (or any other file browser) to copy files to/from your Nexus 4. This is written for Ubuntu, but should work the same for other Linux systems. Also, this should work for Nexus 7 and 10.
1. Enable Developer options and enable USB debugging.
2. Install necessary modules to your computer:
sudo apt-get install mtp-tools mtpfs
3. Configure 51-android.rules:
sudo gedit /etc/udev/rules.d/51-android.rules
paste the following at the end of the file (if the file does not exist then just paste):
#LG - Nexus 4
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"
#Samsung - Nexus 7 & 10
SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666"
Save and exit.
4. Make the file executable:
sudo chmod +x /etc/udev/rules.d/51-android.rules
5. Restart udev
sudo service udev restart
6. Create mount point and permissions (will need to do this for other Nexus' if using for the 7 or 10)
sudo mkdir /media/nexus4
chmod 755 /media/nexus4
7. Plug in the Nexus 4 and make sure MTP is enabled.
8. Mount with the following command:
sudo mtpfs -o allow_other /media/nexus4
9. When you have completed your work you must unmount:
sudo umount /media/nexus4
Now each time you need to copy from/to your Nexus 4 to your Linux computer you only need to plug in and run 8, then 9 when you have completed your work.
Good info! I'll try it out on my Ubuntu laptop later.
Thanks!
Awesome. Thanks
sent from my straight out of limbo 2 Nexus 4 using XDA-premium
This isn't so much a Nexus 4 guide as a general Linux mounting guide, but still cool. Thanks!
First, thanks to the OP! Just wanted to add another way for linux.
Just install and run gMTP plug your phone in and click connect. It is in the Ubuntu software center or for other versions of linux at http://gmtp.sourceforge.net/
I prefer adb+qtadb. Better speed and stability compared to mtp i think.
Sent from my Blade using xda app-developers app
Thanks for that write up. On my gentoo box my galaxy nexus worked flawlessly but the nexus 4 did not. Hopefully this will do it!
Sent from my Nexus 4 using Tapatalk 2
Kaar3l said:
I prefer adb+qtadb. Better speed and stability compared to mtp i think.
Sent from my Blade using xda app-developers app
Click to expand...
Click to collapse
Yes QtADB works very nicely also. It requires a little more setup than gMTP, but you are correct that it is a little faster and stable.
Kaar3l said:
I prefer adb+qtadb. Better speed and stability compared to mtp i think.
Sent from my Blade using xda app-developers app
Click to expand...
Click to collapse
the3dman said:
Yes QtADB works very nicely also. It requires a little more setup than gMTP, but you are correct that it is a little faster and stable.
Click to expand...
Click to collapse
Never heard of that. What is it?
Generating random authentication keys
---------- Post added at 07:48 AM ---------- Previous post was at 07:47 AM ----------
Konsyst said:
This isn't so much a Nexus 4 guide as a general Linux mounting guide, but still cool. Thanks!
Click to expand...
Click to collapse
Haven't gotten my N4 yet but I'm gonna try this on my sIII.
Generating random authentication keys
Thanks for your work! very useful..!
Konsyst said:
This isn't so much a Nexus 4 guide as a general Linux mounting guide, but still cool. Thanks!
Click to expand...
Click to collapse
Not such a general Linux guide as a Debian-derivative guide.
Helpful nonetheless marty331 for the correct udev strings, thanks!
I personally think using sshfs and sshdroid is a much more stable solution. MTP support on Linux is... shoddy to say the least.
Thanks given anyway though.
It seems that mtpfs 1.1 is broken. I downgraded to 1.0 and it worked. However, there is usually lag for some reason whenever the screen is off.
I had MTP/PTP crash several sdcards of mine which required me to format them (no write permissions had no way to get that back.)
Ever since that I just use ADB (Android Debugging Bridge) there are several GUI front-ends available in the default deb/rpm repositories, or if you are comfortable with the terminal (and with ADB it's really really simple to master) you can just get the binary and put it in your bin folder and transfer it via that. Highly reliable, speed is about 2-3mb/s -- but it works.
I gave up on this on Debian Testing. My Galaxy Nexus would not mount no matter what udev rules I used and mtpfs is not a solution. Instead, I just use a ftp server on the phone and ftp things to it or push things using adb. I've also tried airdroid a few times. I would not mind trying the sshfs alternative either. Gonna check that one out.
jamcar said:
Never heard of that. What is it?
Click to expand...
Click to collapse
QtADB is just a GUI for ADB and it works very well. Search QtADB on Google and you will find the download page with instructions.
Sent from my Nexus 4 using xda app-developers app
OP's use of udev inspired me to come up with this solution using ADB.
I'll assume you have ADB installed. There's plenty of indepth guides for that elsewhere.
This tutorial will have you playing around in system directories on your Linux install. I tried to make this guide user friendly but you should have at least SOME knowledge of Unix like OSes before you even try this.
Not for the faint of heart.
Get http://https://play.google.com/store/apps/details?id=berserker.android.apps.sshdroid&hl=en from the play store. Enable USB debugging in the developer options on your phone.
Open SSHDroid on your phone and set your port to something other than 22. I use 2222.
Open a terminal window on your computer and elevate yourself to root (Preferably using su -. Otherwise use sudo su -.).
Now that we got that done, try logging into your phone to make sure everything works. It'll be something like
Code:
ssh -p2222 [email protected][yourPhone'sIP]
. If you get asked a password it probably works. Just hit ^C (Ctrl+C) to exit that password prompt since we don't need to go further yet.
Next you'll need to create a passwordless SSH login. Run
Code:
ssh-keygen -t rsa
. Just hit enter to use the defaults on all the questions, we don't need anything more.
Now run
Code:
scp -P2222 ~/.ssh/id_rsa.pub [email protected][yourPhone'sIP]:/emulated/storage/legacy/
. When it asks for the password just type "admin", though it should tell you that anyway.
If the file copied over successfully you should no be able to type
Code:
ssh -p2222 [email protected][yourPhone'sIP]
again and not be prompted with a password at all. Cool!
At this point it's recommended you go into the SSHDroid settings on your phone and untick the "Enable Password" box, though it's not required, especially if you want to ssh to your phone from other devices/computers.
Run lsusb and look for the line that says Google in it. You want to look out for something like
Code:
Bus 001 Device 070: ID 18d1:4ee2 Google Inc.
Copy the two alphanumeric codes before "Google Inc.". The first is your vendor ID and the second is your device ID. You might want to label them so you remember which is which.
Here's the scary part of the tutorial. Use your favorite text editor (preferably command line based) and create a new file at "/etc/udev/rules.d/85-android_mount.rules". Copy and paste this and edit to fit the IDs you got in the previous command.
Code:
SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4ee2", RUN+="/usr/local/sbin/phone-mount -m" SYMLINK+="Nexus_4"
SUBSYSTEMS=="usb", ACTION=="remove", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4ee2", RUN+="/usr/local/sbin/phone-mount -u" SYMLINK+="Nexus_4"
It should be obvious where you need to put your Vendor and Device IDs now.
Save it and run these commands.
Code:
chmod +x /etc/udev/rules.d/85-android_mount.rules
chmod 775 /etc/udev/rules.d/85-android_mount.rules
chown root:root /etc/udev/rules.d/85-android_mount.rules
Now we need to create another file at "/usr/local/sbin/phone-mount" and paste this inside.
Code:
#!/bin/bash
export PATH=/opt/android-sdk-update-manager/platform-tools/:$PATH
case "$1" in
-m )
adb wait-for-device
adb forward tcp:2222 tcp:2222
# If you have SSHDroid Pro you just need to add "pro" to the "sshdroid".
adb shell am broadcast -a berserker.android.apps.sshdroid.command.START
sshfs -p2222 -o allow_other,idmap=user [email protected]:/storage/emulated/legacy/ /media/nexus4
exit 0
;;
-u )
umount /media/nexus4
exit 0
;;
esac
We need to modify the permissions for this file too.
Code:
chmod +x /usr/local/sbin/phone-mount
chmod 775 /usr/local/sbin/phone-mount
chown root:root /usr/local/sbin/phone-mount
Almost done. If you don't already have sshfs installed on your Linux install then do so now. You'll also need to enable the "allow_other" option. For my distro it's as simple as editing "/etc/fuse.conf" and uncommenting the "user_allow_other" line. Your results may vary.
Now finally we need to create the actual folder you'll be mounting your Nexus 4 at. If you blindly followed my guide that'll be /media/nexus4.
Code:
mkdir /media/nexus4
chown root:users /media/nexus4
chmod 775 /media/nexus4
Now all we need to do is restart udev. Right now you'll want to make sure the phone is unplugged, then restart your udev daemon. For Debian based distros like Mint, Ubuntu, Debian, Crunchbang, etc. you'd run.
Code:
service udev restart
After it's done restarting you can plug your phone in, wait a few seconds, and hopefully have your phone automount to /media/nexus4 .
You may have to improvise in a few spots because all distros are not the same, especially when you compare something like Gentoo to Debian. If you're having problems with sshfs chances are your answer is on Google. You'll honestly get better help there than having me trying to guess your system.
Also note this is a pretty hacky and dirty way to do things. Don't go yanking your phone's USB cord out without unmounting "/media/nexus4" first. You shouldn't have any problems if you're not reading or writing anything, but there is the potential for data loss and crashing udev.
i got this error at the last step
Code:
Attempting to connect device
PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device
Android device detected, assigning default bug flags
Listing File Information on Device with name: (NULL)
fuse: bad mount point `/media/nexus4': Transport endpoint is not connected
i dont have a nexus 4 and im not on linux. but dermann made a script for this i think.
http://forum.xda-developers.com/showthread.php?p=33499930#post33499930
I've been using AirDroid. Works great for transferring files.