Coding with MTP - Other Tools & General Discussion

Hello all, im working on a app to transfer pictures from a camera to the phone and i would like some assistance. i got the camera connected after putting together some code reading around about it. but i can't or don't know how to transfer the files over. any assistance would be great. thanks!

inspector94 said:
Hello all, im working on a app to transfer pictures from a camera to the phone and i would like some assistance. i got the camera connected after putting together some code reading around about it. but i can't or don't know how to transfer the files over. any assistance would be great. thanks!
Click to expand...
Click to collapse
Use adb.exe
1) Set ADB to &PATH
2) Make a loop running "adb devices"
3) Parse out the devices when one is detected
4) Run adb -s "DEVICE-SERIAL" push /sdcard/ or pull /sdcard/ to send files across
Here is some Regex for java for parsing out adb devices if you have more than one device connected and want to add concurrency -
Code:
private static final String mRegex = "^([a-zA-Z0-9\\-]+)(\\s+)(device)";
Hope this helps,
Ryan
P.S - Some devices like the Kindles have non-standard file systems, you may want to make some logic around this if you plan to make it large scale; for example user input to the destination path using tree/ls mappings.

SkysRad said:
Use adb.exe
1) Set ADB to &PATH
2) Make a loop running "adb devices"
3) Parse out the devices when one is detected
4) Run adb -s "DEVICE-SERIAL" push /sdcard/ or pull /sdcard/ to send files across
Here is some Regex for java for parsing out adb devices if you have more than one device connected and want to add concurrency -
Code:
private static final String mRegex = "^([a-zA-Z0-9\\-]+)(\\s+)(device)";
Hope this helps,
Ryan
P.S - Some devices like the Kindles have non-standard file systems, you may want to make some logic around this if you plan to make it large scale; for example user input to the destination path using tree/ls mappings.
Click to expand...
Click to collapse
Thanks for the reply, i'll see if i can give this a try. Is there a way to do it with the mtp API? similar to how the android camera gallery works. cause else i have to redo the code. Thanks

Related

Ubuntu 8.10 x64 can't find G1

Connect my G1 with my laptop(Ubuntu 8.10 x64)
When I run the adb devices, it only said: List of devices attached
No devices line; It lists one line when I start the emulator program.
And not like the SDK for windows, there is not some folder related to drivers.
Does it support for linux x64? plz help.~
have you activated the debugger in your g1 ?
oh I remember when I was in ubuntu now
you gotta launch adb daemon as root
try this :
adb kill-server && sudo adb devices
and let me know if it worked
dixxa said:
have you activated the debugger in your g1 ?
Click to expand...
Click to collapse
Absolutely, it works fine in Vista x64 with SDK 1.1 r1
I had to do two things to get this to work (although this was on x86) -
1) Build the kernel with the Android drivers enabled. This might not be necessary; I have no idea if they are turned on in the kernels you get from the Ubuntu repository as mine has been custom built for a while, but I'm guessing that they aren't enabled by default because they are in the "staging" area as of 2.6.29.1. So these were in Device Drivers/Staging Drivers/Android.
2) Add a "50-android.rules" file to /etc/udev/rules.d that has this line:
SUBSYSTEM=="usb",SYSFS{idVendor}=="0bb4",SYMLINK+="android_adb",MODE="0666"
The idVendor is different if you have an ADP phone, I believe; this was the value worked for mine (non-dev). You can do an 'lsusb' after it's been plugged in and see what shows up. Also, try grepping /var/log/messages for "udev" after you plug it into a USB port and see if there are meaningful messages.
- Chris
Hi all,
I got similar issue here, the main difference is that i got ubuntu 9.04.
running adb daemons as root permit to see devices when it's started normally, but not when in fastboot mode.
I tried all suggestions above (and others!) without success :/
Thanks for any help
noz.geek said:
Hi all,
I got similar issue here, the main difference is that i got ubuntu 9.04.
running adb daemons as root permit to see devices when it's started normally, but not when in fastboot mode.
I tried all suggestions above (and others!) without success :/
Thanks for any help
Click to expand...
Click to collapse
copy the 50-android.rules file you created into a file called 51-android.rules. The problem is related to the order in which things are launched and copying this file to the new name will solve your problem.
I should also note that you will have to restart udev Or reboot or logout/in
to restart udev, In terminal type:
Code:
sudo /etc/init.d/udev restart
sudo is necessary~ thx
Hi all,
After creating 50-android.rules file in /etc/udev/rules.d, I can mount my sdcard on my gPhone to Ubuntu8.04 but I still see no thing when i type command : adb devices. I also did some commands which you gave here. Can anybody help me?
Thanks so much,
NPAK
npak243 said:
Hi all,
After creating 50-android.rules file in /etc/udev/rules.d, I can mount my sdcard on my gPhone to Ubuntu8.04 but I still see no thing when i type command : adb devices. I also did some commands which you gave here. Can anybody help me?
Thanks so much,
NPAK
Click to expand...
Click to collapse
Code:
$ sudo mv /etc/udev/rules.d/50-android.rules /etc/udev/rules.d/51-android.rules/code]
that should fix it ;)
Thanks,
It can work now!
I have the same problem here. adb used to be able to see my phone when I was using Ubuntu 8.10. After I upgraded to 9.04, it never worked. I tried change the udev rule file from 50-** to 51-** or as haykuro suggested to 51-**/code. I also changed the permission to 777. And I did kill and restart adb-server several times under root, but I still get nothing~~~
Can anyone help?

[HOWTO] Guide to running ADB under Fedora 11 (and equivalent distros)

Ok, I have fedora 11 installed on most of my computers, since i love this distro to death. My big thing was trying to get adb to work. This is my guide to get it to work, for now.
First things first. Navigate to /etc/udev/rules.d as root. Create a rules file called 50-android.rules (touch 50-android.rules). NOTE: You are better off looking at the contents and picking a rules number set other than what is listed. Sometimes udev is picky. For the newbies, so if any rules start with '50', then change the number by one or two, like 51 or 52. Paste this into the file:
Code:
SUBSYSTEM=="usb",ATTRS{idVendor}=="0bb4",SYMLINK+="android_adb",MODE="0666"
Make sure you use ATTRS, not ATTR or SYSFS, since this is a newer updated udev system.
After that, run udevadm control --reload-rules to reload your rules files. Now just run ./adb devices as root to make sure it recognized your HTC dream. I am working on this fix right now so you don't need to be root, keep patient. Now you can adb shell into your device either as root OR normal user, just as long as you start the server as root. This is a permissions problem, and hopefully I can fix this and/or find a fix soon.
I wrote this because i searched high and low through google, and only found a few good parts as far as a fix. Hopefully this helps a few people out there.
Just wondering if this has helped anyone. If not, delete this thread or do whatever with it....
I have adb on my eeepc 900 with f11 I believe this method works too as well. although it says it has been tested with ubuntu, it works pretty well with f11.
http://www.talkandroid.com/android-sdk-install-guide/
Installing The Android SDK
First you will need to download the Android SDK pack .zip archive, once downloaded find a suitable installation location on your machine and extract the zipped files.
Please note: This installation location will be referred to as $SDK_ROOT from now on through this tutorial
Alternatively you can add /tools to your root path which will prevent the need to specify the full path to the tools directory along with enabling you to run Android Debug Bridge (adb) along with other command line tools.
To add /tools:
Linux
1. Edit the ~/.bash_profile or ~/.bashrc files looking for a line that sets the PATH variable.
2. Add the full path location to your $SDK_ROOT/tools location for the PATH variable.
3. If no PATH line exists you can add the line by typing the following:
4. export PATH=${PATH}:<path to your $SDK_ROOT/tools>
Click to expand...
Click to collapse
It helped me, since the creation of the file my OpenSuSE 11.0 recognizes the phone perfectly
Thanks a lot for your hint.
thanks it helped me. ill be looking forward to getting it to work without root
just use sudo instead
Just a heads up for user's using Ubuntu 9.10, this isn't needed. I connected my G1 to it and ran ADB with no adjustments to udev or anything else.
Pretty much it works out of the box.
Here is my version
download the .tgz file from googlecode
http://developer.android.com/sdk/index.html
sudo tar -xzvf android-sdk_r3-linux.tgz
Click to expand...
Click to collapse
Code:
sudo gedit ~/.bash_profile
heres my bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH=$PATH:/android-sdk-linux/tools
Click to expand...
Click to collapse
logout
login
connect android g1 device via usb to pc
open a terminal
Code:
adb devices
if you cant get a device try it with superuser.
Don't you think that this is all just a little bit excessive?
To make it work in F11, just do this;
Download SDK, extract.
To use, type:
/path/to/sdk/tools/adb
Another option is to edit the /etc/profile and add
PATH=$PATH:/<Path to android-sdk>/tools
This option will allow any user to use the adb tools when logged in or if you
su -
into another user
I wrote a short guide as well for Windows and Ubuntu. Might help others.
Unfortunately, as anyone with a passing acquaintence with ADB knows, the scrolling issue can be a killer. I swear the other day I pressed "up" twice and it composed "rm /sdcard/rootfs.img /sdcard/system.ext2" and executed it. We run Android on our SD's btw.. Was not cool. Instead, I use ADB via telnet and it works beautifully. Here's how:
Code:
adb shell telnetd &
adb forward tcp:9999 tcp:23
Now type this: "telnet localhost 9999"
Enter "root" and hit enter
Finally update PATH: "export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/system/sbin:/system/bin:/system/xbin:/system/xbin/bb:/data/local/bin"
Okay, so 4 lines to enter and you have a "regular, sane" shell connection to the phone and you can actually scroll through history and text without it jumbling the text and executing random code. Enjoy.
lbcoder said:
Don't you think that this is all just a little bit excessive?
To make it work in F11, just do this;
Download SDK, extract.
To use, type:
/path/to/sdk/tools/adb
Click to expand...
Click to collapse
that works too as well but i would rather open up a terminal and type
sudo adb devices
sensimila said:
that works too as well but i would rather open up a terminal and type
sudo adb devices
Click to expand...
Click to collapse
WHY would you want to make it *MORE COMPLICATED*??
There is NO NEED for root.
/path/to/adb ...
THATS ALL.
This is kind of funny... i wrote this because i had trouble with it, so i am just sharing my fix...
In case this is interesting to someone:
The fix mentioned in the first post has to be applied to open SuSE x86 and x64 edition to make the G1 work. The external device works without it, but not the adb device.
Thanks again!
Just wanted to come and post that this does work with OpenSUSE 11.2 x86. Did this hoping to get adb to work with my LG Ally and it does. Thanks!
(Still) works for me on 64bit SUSE 11.4.
Before adding this file, I could not access my device with adb, received permissions errors.
Added this file, and I can shell into my device.
Permissions on adb itself was not the problem, it was access to the device when udev found it.
[edit]Actually used the lines from http://developer.android.com/guide/developing/device.html[/edit]

[Q] ADB doesn't work on Mac

When I CD to the platform-tools folder and type
Code:
adb devices
it says "adb: command not found" If anyone could help me that would be wonderful. I am on the Inspire/DesireHD running AOSP Gingerbread. Thanks!
You have two choices. You can either run the command prefixed with ./ (dot slash), which allows for executing an executable in the current directory:
Code:
./adb devices
Or, the other choice (which will be better if you intend to use adb a lot) is to add the platform-tools folder to your path by editing or creating the file .bashrc in your home folder (~/.bashrc).
Let's suppose your platform tools folder is: ~/.android-sdk/platform-tools
Then, you would want to add something along the lines of the following to your bashrc:
Code:
export PATH="$PATH:$HOME/.android-sdk/platform-tools"
Save the file, the run this or log out/in:
Code:
source ~/.bashrc
Et voila, you should now be able to run adb from any folder without issue.
Explanation: adding the new path (folder) to your PATH environment variable tells BASH to include that folder in its search for an executable. The reason $PATH is added at the beginning of the new string is so that your default path does not get overwritten. $HOME will simply expand to /home/your_user_name when BASH interprets it.
GENIUS! IT WORKED! Thank you! Now, one more question- how do I get superuser privileges using ADB? (device is rooted, of course)
No problem.
On my G1 you were root as soon as you adb'd in. Just tested on my Defy and '$' - shocking. So once you have run adb shell, just run 'su' (without quotes of course) and accept the permission on your phone screen as usual for root programs and you should be good to go.
Sorry to keep asking questions, but when I typed
Code:
su
into adb, it asked for a password. No popup on device screen. I do have superuser installed on the device.
That is odd. I'm not sure why that would be. I'll see if I can think of something though. Hopefully someone else can make a suggestion.
Thanks! You have been very helpful.
Don't think I can hit the thanks button from the app, sorry
Sent from my Inspire 4G using XDA App

Mount Transformer to Linux Mint - automated.

Hey TF owners,
For anyone looking for a way to mount their Transformer to Linux Mint, I wrote a script to automate the process of configuring your machine to allow you to browse/modify files on the tablet's SSD. This will probably also work on Ubuntu, but I have only so far tested it on Linux Mint.
Download the attached file, and run it.
Edit: Connect your Transformer to your PC before running.
Edit 2: You only need to run this script once - not every time you connect the tablet to your PC.
Hit the thanks button/comment if this worked for you. If not, also comment and I/someone will probably help you out. Also, if anyone tests it on Ubuntu successfully, be sure to comment and let people know.
Note: All configuration files are backed up in the script before changes are made. You can always revert safely.
I'll throw in the ever so popular "use at your own risk" for safe measure.
Cheers.
June 29: Updated script uploaded.
-Cleaner
-Removes an unnecessary comment pushed into fstab in the previous script
-Already executable. Just run it. [Thanks MagnusRagnarok for the idea]
-Packed in 7z from Linux Mint this time as opposed to in zip format from the TF, for [hopefully] universal accessibility.
-md5sum 615f2bfa820ee9ac8ea2c967149a2f03 TransformerMount2.7z
ok so maybe a stupid question, but does my tf need to be rooted to try this? also if you can create an automated script to install a linux distro you think it would be possible for you to create a script to root?? btw any idea on what actually works? can the tegra 2 run with compiz??
0lddirtypaki said:
ok so maybe a stupid question, but does my tf need to be rooted to try this? also if you can create an automated script to install a linux distro you think it would be possible for you to create a script to root?? btw any idea on what actually works? can the tegra 2 run with compiz??
Click to expand...
Click to collapse
I thin you've misunderstood the intention of the OP.
It was to be able to mount your Transformer under Linux and be able to read/write the files stored on the Transformer's internal storage. Not to actually install a full blown Linux Distro on your Transformer.
Wow, talk about reading before posting.
Sent from my Transformer TF101 using XDA Premium App
only on linux mint--
does it work on ubuntu?
Yes, this works perfectly on ubuntu
I have a problem extracting the zip file with Ubuntu 10.10
Do I need an alternate unzip program? If so please specify. I do not run MS products.
Error:
7-Zip 9.04 beta Copyright (c) 1999-2009 Igor Pavlov 2009-05-30
p7zip Version 9.04 (locale=en_CA.UTF-8,Utf16=on,HugeFiles=on,4 CPUs)
Processing archive: /tmp/TransformerMount.zip
Extracting TransformerMount.bash Unsupported Method
Sub items Errors: 1
I can extract it with 7zip on Windows on the work computer, and with both Explorer and AndroZip on the TF without issue.
Sent from my Milestone using XDA App
Acer Mod of the script
I'm trying to edit the file for use with an Acer Iconia. So far everything works but the modifying of the android.rules file. You see, it doesn't exist on my laptop (mint 11) in the directory the script looks at nor is there an android.rules file in lib/udev/rules.d. While I could probably write a rules file and make it work, I'd like to know where it comes from and maybe discover why it does not exist on my system. Anyone have any ideas? Also - rootblock - if I can get this to work would you object to my posting it in the Iconia forum? Thanks!
UPDATE:
Creating the file worked fine. Any reason to edit the script to check if the file exists and create it if it doe not or am I the exception to the rule? i.e. Would most users have it there in the first place?
3DSammy said:
I have a problem extracting the zip file with Ubuntu 10.10
Do I need an alternate unzip program? If so please specify. I do not run MS products.
Error:
7-Zip 9.04 beta Copyright (c) 1999-2009 Igor Pavlov 2009-05-30
p7zip Version 9.04 (locale=en_CA.UTF-8,Utf16=on,HugeFiles=on,4 CPUs)
Processing archive: /tmp/TransformerMount.zip
Extracting TransformerMount.bash Unsupported Method
Sub items Errors: 1
Click to expand...
Click to collapse
Probably a bad download. And you could also try file-roller to open it (I think its installed by default, it is on Debian/Gentoo)
Tortel1210 said:
Probably a bad download
Click to expand...
Click to collapse
I installed the "p7zip" deb, re-downloaded a few times with Firefox and even tried wget. Each time I get the same error result. I was more interested in examining the bash file as I do not have a TF yet. Oh well not a big deal.
3DSammy said:
I have a problem extracting the zip file with Ubuntu 10.10
Do I need an alternate unzip program? If so please specify. I do not run MS products.
Error:
7-Zip 9.04 beta Copyright (c) 1999-2009 Igor Pavlov 2009-05-30
p7zip Version 9.04 (locale=en_CA.UTF-8,Utf16=on,HugeFiles=on,4 CPUs)
Processing archive: /tmp/TransformerMount.zip
Extracting TransformerMount.bash Unsupported Method
Sub items Errors: 1
Click to expand...
Click to collapse
Had the same issue with Archive manager - Xarchiver worked, however.
ubuntu & Asus transformer
If anyone having a problem with mtpfs on ubuntu especially version 10.4 ( segfault problem which prevents from mounting the TF), use newer version of mtpfs in the link below.
http://pkgs.org/download/debian-wheezy/debian-main-i386/mtpfs_0.9-3_i386.deb.html.
1. install the package
ubuntu> sudo dpkg -i mtpfs_0.9-3_i386.deb
2. Then run rootblock script if you did not do it.
just wondering, would this have any effect for the adb connections ? My ubuntu cannot find the transformer from adb but could mount it just find
Try This....
anyone having issues try one of the following extensions.. tar.gz would be my first suggestion for those using ubuntu like myself. i also took the liberty of changing the perms to exe on the script before i compressed all these so now all you need to do is
1.download the extension pack i upped
(find the one that works for you)
2.open file
3.execute
*i also tossed the edited script in the pack for anyone who cannot get it to open.
fyi; ark also worked for me to access the file from the op, while my 7z kept erroring out.
​
ari197 said:
just wondering, would this have any effect for the adb connections ? My ubuntu cannot find the transformer from adb but could mount it just find
Click to expand...
Click to collapse
I can access the TF with adb just fine. Just cd to the android-sdk-linux_x86/platform-tools folder containing adb and run:
Code:
./adb devices
or
Code:
./adb shell
if that folder isn't already configured into your path. Works for me anyway.
I've been looking at this and trying to do it with udev instead, since I want the dynamic creation of the folder in /media. Mounting works great, but removing doesn't. So anyone with knowledge of udev rules is more than welcome to give me some hints. Here's the rules so far:
Code:
See below...
The command run when removing works if I enter it as root in a terminal, so it seems to me that it's either not run when removing or it's failing somehow when run from udev. Edit: I've figured out that it's not run at all. Looking into it...
Also, hint for those who follow the manual instructions you could also get the necessary permissions through Users and Groups instead of editing the groups file. You still have to edit /etc/fuse.conf to allow other though.
These are instructions for automatically mounting and unmounting your pad (not keyboard!). This will create (when plugged in and detected) and remove (when unplugged) the Transformer directory under /media, so that the experience is more in line with other USB devices.
For those of you who already have run the script in the first post, you need to do some cleanup. Edit /etc/fstab and /etc/udev/rules.d/51-android.rules and remove the lines which the script created. Which lines in fstab should be straight forward, and in 51-android.rules look for rows that either have no idVendor set or has it set to 0b05. If unsure, post here FIRST before making changes!
This is the content of /etc/udev/rules.d/51-android.rules:
Code:
ACTION=="add", SUBSYSTEM=="usb", ENV{ID_MODEL}=="MTP", ENV{ID_MODEL_ID}=="4e0f", MODE="0666", RUN+="/bin/bash -c 'mkdir -p /media/Transformer && mtpfs /media/Transformer -o allow_other'"
ACTION=="remove", SUBSYSTEM=="usb", ENV{ID_MODEL}=="MTP", ENV{ID_MODEL_ID}=="4e0f", RUN+="/bin/bash -c 'fusermount -u /media/Transformer && rmdir /media/Transformer'"
If you have other Android devices you may or may not have other lines here too. If so, just add these two lines to the end of the file. My Transformer is bought in Sweden so if things don't work for you, maybe there's another idProduct/ID_MODEL_ID out there? Check with lsusb when your pad is plugged in, the vendor (xxxx) and product (yyyy) ID is [xxxx:yyyy] on the line that says ASUSTek Computer Inc. For my pad, the productID/ID_MODEL_ID is 4e0f.
You need to uncomment allow_other in /etc/fuse.conf and add your user to the fuse group (preferably via Users and Groups) apart from adding the above two lines to your 51-android.rules:
Start Users and Groups, choose your user and press Advanced settings. Under the tab User Privileges you should mark Mount user-space filesystems (FUSE).
Open and edit /etc/fuse.conf (see below on how to use nano). Uncomment user_allow_other in the end (remove the # at the beginning of the line).
After this you should reboot your computer. This will have two effects: The udev rules will be reloaded so the changes apply, and your user will have the necessary privileges granted.
Now you can try to plug in your pad and see if it shows up under /media. Give it some time, it takes a while. (Approx. 30 seconds for me.)
A note on editing files from the terminal window
When editing files from the terminal I always use nano. The command is (if opening a file that requires super user rights):
sudo nano [path-to-file]
The editing is straightforward, works just like any other text editor. When you're finished, press Ctrl+X (Exit) and answer the question with Y (if your system is in english that is) if you want to overwrite the earlier file.
Problems?
If you have ADB activated you could try rmbell's udev rules. This removes the match ID_MODEL == MTP and changes the productID to 4e1f. The productID changes depending on what functions are activated, as discussed in this post by ritterkeks. If you want the pad to be mounted with and without ADB activated, you can add all four rules.
If the udev rules doesn't work, run this command in the terminal and see what happens when you plug the pad in:
udevadm monitor --property --udev
Exit with Ctrl+C. Are the values the same as in the udev rules you're using? If not, change accordingly or deactivate some function which has made the productID change.
"unable to mount location" error
I'm getting an error that reads "Unable to mount location"
Then:
fusermount: failed to open /etc/fuse.conf: Permission denied
fusermount: option allow_other only allowed if 'user_allow_other' is set in /etc/fuse.conf
I'm a monkey in a spaceship when it comes to some of this stuff Any idea what I should do (in layman's terms)?
All help appreciated!
I'm not sure if your problem is from the script in the first post or my instructions. But as the message says you need to edit fuse.conf. Also, you need to be a member of the FUSE group.
Open and edit fuse.conf with this command in a terminal:
sudo nano /etc/fuse.conf
Uncomment (remove the #) user_allow_other in the end, exit with Ctrl+X and save with Y.
Start Users and Groups, choose your user and press Advanced settings. Under the tab User Privileges you should mark Mount user-space filesystems (FUSE). I believe that you need to reboot after this change, otherwise the necessary privileges hasn't kicked in.
Try it and let me know

Transferring files

I really can't seem to copy files off my moto g and on to the computer like a regular SD card, my files that are copied aren't visible on my desktop.
Sent from my XT1032 using xda app-developers app
Which OS do you have on your computer? On Windows I have no problem using MTP out of the box. On Ubuntu 13.10 I had to do some console jacking to get the thing work, but it is working well now.
debaj said:
Which OS do you have on your computer? On Windows I have no problem using MTP out of the box. On Ubuntu 13.10 I had to do some console jacking to get the thing work, but it is working well now.
Click to expand...
Click to collapse
nvm I tried it on my desktop and files transfer easily thx though
debaj said:
Which OS do you have on your computer? On Windows I have no problem using MTP out of the box. On Ubuntu 13.10 I had to do some console jacking to get the thing work, but it is working well now.
Click to expand...
Click to collapse
You used mtpfs?
manudo said:
You used mtpfs?
Click to expand...
Click to collapse
Yes, though I did not need to install any extra software, 13.10 comes preinstalled with everything you need. I did the following steps:
1. Create a mount point in the file system for the phone (in my case /media/motog/)
2. Uncomment the user_allow_other line in /etc/fuse.conf
3. Add my user to the "disk" group (debaj is my username):
Code:
usermod -a -G disk debaj
3. Get the model id by connecting the phone to the computer and running the mtp-detect command. You need the PID from the following snippet:
Code:
Listing raw device(s)
Device 0 (VID=22b8 and PID=2e76) is UNKNOWN.
(Don't forget to press ctrl+c after you get the PID since collecting all the info can take a long time and we need nothing from there)
4. Create a file named 99-android.rules in /etc/udev/rules.d/ with the following content:
Code:
ENV{ID_MODEL}=="XT1032", ENV{ID_MODEL_ID}=="2e76", ACTION=="add", RUN+="/usr/bin/sudo -u debaj /usr/local/sbin/go-mtpfs -allow-other=true /media/motog"
ENV{ID_MODEL}=="XT1032", ENV{ID_MODEL_ID}=="2e76", ACTION=="remove", RUN+="/bin/umount /media/motog"
5. Reboot (logging in and out is not enough, maybe there is some commands which reload the fuse config and the udev rules but I did not bother to find them). I had a very good fight to get the thing working, I hope I didn't miss any steps.
debaj said:
Yes, though I did not need to install any extra software, 13.10 comes preinstalled with everything you need. I did the following steps:
1. Create a mount point in the file system for the phone (in my case /media/motog/)
2. Uncomment the user_allow_other line in /etc/fuse.conf
3. Add my user to the "disk" group (debaj is my username):
Code:
usermod -a -G disk debaj
3. Get the model id by connecting the phone to the computer and running the mtp-detect command. You need the PID from the following snippet:
Code:
Listing raw device(s)
Device 0 (VID=22b8 and PID=2e76) is UNKNOWN.
(Don't forget to press ctrl+c after you get the PID since collecting all the info can take a long time and we need nothing from there)
4. Create a file named 99-android.rules in /etc/udev/rules.d/ with the following content:
Code:
ENV{ID_MODEL}=="XT1032", ENV{ID_MODEL_ID}=="2e76", ACTION=="add", RUN+="/usr/bin/sudo -u debaj /usr/local/sbin/go-mtpfs -allow-other=true /media/motog"
ENV{ID_MODEL}=="XT1032", ENV{ID_MODEL_ID}=="2e76", ACTION=="remove", RUN+="/bin/umount /media/motog"
5. Reboot (logging in and out is not enough, maybe there is some commands which reload the fuse config and the udev rules but I did not bother to find them). I had a very good fight to get the thing working, I hope I didn't miss any steps.
Click to expand...
Click to collapse
Dude, haha. I asked if you used mtpfs not how to use it but thanks anyway.
Sent from my XT1034 using XDA Premium 4 mobile app

Categories

Resources