Linux android phone usb

Mounting Android phone over USB on Debian

Using the following steps an Android phone can be mounted over USB by a Debian Linux system.

  • apt-get install jmtpfs
  • connect phone and select data transfer over USB
  • jmtpfs /mnt/phone

At this point, my phone prompts me whether or not to allow this connection. I select allow, but it is too late for the computer and any attempts to browse the directory /mnt/phone result in i/o errors. Unmounting and remounting without changing anything on the phone and leaving it connected, is a work-around for this issue.

Categories

  • IPv6 (7)
  • Linux General (32)
  • Linux System Administration (20)
  • Miscellaneous (2)
  • Networking (22)
  • OSS Software (1)
  • Raspberry Pi (1)
  • Useful Utilities (5)
  • Wireless (5)

Recent entries

  • Debian 11 (Bullseye): vim leaves insert mode when losing focus
  • Speeding up and reducing resolution of videos
  • Throttling Ethernet connection on Linux
  • ISC-DHCP-Server – disable dhcpv6 (Debian 9)
  • GDB – Coredump backtrace for cross-platform debugging
  • Mounting Android phone over USB on Debian
  • Vim – disable mouse mode
  • Iperf – multicast IPv4
  • Bash – Internal Field Separator (IFS)
  • Debian 9 (Stretch) – Systemd network interface names
  • ISC DHCP Server – Option 43 (Vendor specific attribute)
  • Restarting Enlightenment (e17) from the command line
  • Manually Adjusting Fan Speed on Lenovo L420
  • Quick and dirty introduction to GnuPG (GPG) on Linux
  • Implementing IPv6 Privacy Extensions (RFC4941)
  • Data download and Nagios Plugin for MyBasis
  • Generate White Noise using Raspberry Pi
  • Backport of Aircrack-ng for Debian Wheezy
  • ipt_ROUTE Netfilter module ported to Linux 2.6.31
  • OpenVPN – IPv6 with tun device

We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it. Ok

Источник

How to connect Android 7.1 to Ubuntu Linux with USB?

I’m trying to connect a Google Pixel phone, with android 7.1, to a Ubuntu 16.04 laptop with a USB cable using mtp-tools. But the mtp doesn’t see the phone file system and gives the error message «Get Storage information failed». Then trying the mtp tools .

# mtp-detect libmtp version: 1.1.10 Listing raw device(s) Device 0 (VID=18d1 and PID=4ee1) is a Google Inc (for LG Electronics/Samsung) Nexus 4/5/7/10 (MTP). Found 1 device(s): Google Inc (for LG Electronics/Samsung): Nexus 4/5/7/10 (MTP) (18d1:4ee1) @ bus 2, dev 17 Attempting to connect device(s) Android device detected, assigning default bug flags Error 1: Get Storage information failed. ***** . USB low-level info: bcdUSB: 512 bDeviceClass: 0 bDeviceSubClass: 0 bDeviceProtocol: 0 idVendor: 18d1 idProduct: 4ee1 IN endpoint maxpacket: 512 bytes OUT endpoint maxpacket: 512 bytes . many lines omitted . # mtp-connect libmtp version: 1.1.10 Device 0 (VID=18d1 and PID=4ee1) is a Google Inc (for LG Electronics/Samsung) Nexus 4/5/7/10 (MTP). Android device detected, assigning default bug flags Usage: connect  Commands: --delete [filename] --sendfile [source] [destination] --sendtrack [source] [destination] --getfile [source] [destination] --newfolder [foldername] # mtp-filetree Device 0 (VID=18d1 and PID=4ee1) is a Google Inc (for LG Electronics/Samsung) Nexus 4/5/7/10 (MTP). Attempting to connect device(s) Android device detected, assigning default bug flags Error 1: Get Storage information failed. Device: (NULL) LIBMTP_Get_Storage(): Resource temporarily unavailable OK. 
cat /etc/udev/rules.d/51-android.rules SUBSYSTEM=="usb", ATTR=="18d1", ATTR=="4ee1", MODE="0666", OWNER="sullivan" 

Источник

Читайте также:  How to get linux mint

How do I mount my Android phone?

I’m puzzled because my phone used to just appear when I plugged it in. It doesn’t anymore and The development options are definitely set to allow USB debugging. The phone is charging via USB but doesn’t appear in lsusb

[0 amanda@luna android-sdk-linux_86]$ lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 001 Device 004: ID 17ef:4807 Lenovo UVC Camera Bus 003 Device 012: ID 413c:1003 Dell Computer Corp. Keyboard Hub Bus 003 Device 003: ID 08ff:2810 AuthenTec, Inc. AES2810 Bus 003 Device 013: ID 413c:2010 Dell Computer Corp. Keyboard Bus 003 Device 014: ID 046d:c001 Logitech, Inc. N48/M-BB48 [FirstMouse Plus] 

adb devices -l shows nothing. In my Wireless and Network settings I changed the USB connection settings to «Mass storage» — they were set to «Ask on connection» though I definitely wasn’t getting asked. I don’t get any Click here to connect via USB alert either. I’m not even sure whether the issue is my phone or my computer. It seems odd that it isn’t even appearing in lsusb Not for nothing, the thumb drive on my keyring also does not appear in lsusb — I’ve tried both in a bunch of different ports. I kind of assume the thumb drive is just borked, but it could be my OS.

Читайте также:  Geforce 920m driver linux

Источник

Как подключить телефон с Android к Ubuntu как MTP устройство

ubuntu android

Данное руководство проверено для телефонов Samsung Galaxy Nexus и Samsung Galaxy S 2 (в дальнейшем «телефон» или «Android«). Думаю, и для многих других будет также справедливо.

Телефон при подключении к компьютеру по USB кабелю информирует пользователя и предлагает выбрать: подключиться как MTP-устройство (это различные музыкальные плееры, хранилища музыки и просто файлов), или же подключиться как камера.

Однако, Ubuntu об этом устройстве мало что знает, поэтому не предлагает что-либо с ним делать. Что же, наша задача: объяснить как пользоваться Android’ом Ubunt’е

android ubuntu

Кстати, на месте «Ubuntu» тут можно написать «Linux Mint» — для него всё ровно то же. А при должной замене названий команд установки пакетов — это будет работать на большинстве Linux-based систем (названия самих пакетов обычно совпадают).

Итак, чтобы можно было использовать в Ubuntu телефон с Android в качестве MTP-устройства, нужно установить пакеты mtpfs — для того, чтобы можно было использовать телефон, как обычный примонтированный диск. mtp-tools также окажется полезным.

sudo apt-get install mtpfs mtp-tools

Далее вводим команду mtp-detect для выяснения подробностей о телефоне, что мы подключили:

$ mtp-detect libmtp version: 1.1.3 Listing raw device(s) Device 0 (VID=04e8 and PID=685c) is a Samsung Galaxy Nexus/Galaxy S i9000/i9250, Android 4.0 updates. Found 1 device(s): Samsung: Galaxy Nexus/Galaxy S i9000/i9250, Android 4.0 updates (04e8:685c) @ bus 1, dev 4 Attempting to connect device(s) LIBMTP PANIC: Unable to find interface & endpoints of device Unable to open raw device 0 OK.

Здесь для нас важны 2 числа: VID и PID. Это vendor id и product id — идентификатор производителя и идентификатор продукта (модели устройства).

Теперь нам нужно отредактировать конфигурационный файл:

sudo gedit /etc/udev/rules.d/51-android.rules

Тут то нам и пригодятся VID и PID! Пишем в файле:

Читайте также:  Добавить языковую панель linux

Не забыть заменить 04e8 и 685c на нужные VID и PID — соответственно!

Чтобы правило из конфигурационного файла вступило в силу — перезапускаем udev:

sudo service udev restart

Создаём папку, в которую будет монтироваться (подключаться Android). Например так:

sudo mkdir /media/Android sudo chmod a+rwx /media/Android

Теперь добавим себя в группу тех, кто может подключать устройства:

На всякий случай проверим, можно ли пользователям вообще подключать подобные устройства:

Строчка «#user_allow_other» должна быть раскоментирована (без решётки спереди), то есть «user_allow_other».

После перезагрузки можно будет подключать устройство с помощью довольно длинной команды. Однако, для удобства создадим свои команды, делающие то же самое:

echo "alias android-on=\"mtpfs -o allow_other /media/Android\"" >> ~/.bashrc echo "alias android-off=\"fusermount -u /media/Android\"" >> ~/.bashrc source ~/.bashrc

После перезагрузки можно будет выполнить команду «android-on«, чтобы подключить телефон. И команду «android-off«, чтобы отключить.

Права на файлы и папки в Linux, FreeBSD и MacOS

Запись опубликована автором Admin в рубрике Настройка с метками Android, MTP, Музыка, Устройства, Файловая система. Добавьте в закладки постоянную ссылку.

сделал всё по инструкции, как выдавал, так и продолжает выдавать следующее сообщение при подключении телефона, при этом никакое взаимодействие с телефоном, помимо рассматривания дерева папок не возможно. Может я где-то налажал?

Спасибо. Мне достаточно было установить mtpfs mtp-tools, что бы подключились внутренняя SD карта (раньше она была nand) и внешняя SD карта.

На ubuntu.ru советуют использовать прогу gMTP, у меня она просто вылетает с ошибкой, попробую сегодня приконектить свой нексус 7 по Вашему мануалу.
Спасибо.

Нет, это не вариант.
Работает плохо, очень, очень долго открываются директории, и, кроме этого, все равно все папки не показывает.

всем привет =))) подскажите пожалуйста что не так. ввожу команду android-on и система выдаёт такую ошибку: Listing raw device(s)
Device 0 (VID=1004 and PID=61f9) is a LG Electronics Inc. V909 G-Slate.
Found 1 device(s):
LG Electronics Inc.: V909 G-Slate (1004:61f9) @ bus 2, dev 4
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
Error 1: Get Storage information failed.
Error 2: PTP Layer error 02fe: get_handles_recursively(): could not get object handles.
Error 2: Error 02fe: PTP: Protocol error, data expected
Listing File Information on Device with name: (NULL)
LIBMTP_Get_Storage() failed:-1 LG Optimus L7, система Ubuntu 12.10

Источник

Оцените статью
Adblock
detector