How do you connect a OnePlus Two Device to Ubuntu through MTP?
Asked Answered
T

6

10

When I connect it to my ubuntu 14.04, I am only able to see the USB drivers for installing ADB.

There are a few solutions available for OnePlus One (See here) but I was not able to find one for OnePlus two.

Toilsome answered 15/10, 2015 at 8:49 Comment(0)
T
25

After much tinkering, I found the solution -

You need the latest mtp drivers for OP2 -

$ sudo apt-get install libmtp-dev mtpfs

Now edit the following file -

$ sudo gedit /lib/udev/rules.d/69-libmtp.rules

adding this line

ATTR{idVendor}=="2a70", ATTR{idProduct}=="f003", SYMLINK+="libmtp-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1", TAG+="uaccess"

(The vendor id and product id can be got by using the "sudo mtp-detect" command)

now restart the service

sudo service udev restart

Your OP2 should be able to transfer files to your ubuntu PC now!

P.S - You will need to change the {idProduct} to whatever is specified by mtp-detect if you are not on the stock ROM/Kernel!

Toilsome answered 15/10, 2015 at 12:17 Comment(2)
It was my own answer so I didn't feel like accepting. But what the hell, it works :DToilsome
What does , TAG+="uaccess" do?Debut
Q
9

OnePlus X connected to Ubuntu 15.04 via USB

Alex Joseph's answer above worked for me BUT I had to also install mtp-tools in order to have the mtp-detect command (otherwise I only got "command not found").

$ sudo apt-get install mtp-tools

After that I could see my OnePlus X, verify the vendor id and product id, and follow the rest of the steps. My Ubuntu system now sees both internal storage and SD card.

Quoth answered 22/3, 2016 at 14:17 Comment(0)
B
7

I made the following changes and One Plus two starts showing up in my adb devices list:

  1. Go to your home directory and using any editor open the adb_usb.ini file. it is present under .android folder I used vim editor:

    vim .android/adb_usb.ini

  2. Add 0x2A70 text without any trailing spacees to the file as below:

**

# ANDROID 3RD PARTY USB VENDOR ID LIST -- DO NOT EDIT.
# USE 'android update adb' TO GENERATE.
# 1 USB VENDOR ID PER LINE. 
0x2A70

**

  1. Stop and start the server:

    adb kill-server

    adb start-server

  2. Now check, device should show up: adb devices

Buy answered 2/11, 2015 at 12:16 Comment(0)
S
2

After install android adb, I can open OnePlus 3 folder on Ubuntu 16.04

sudo apt-get update
sudo apt-get install adb
Swahili answered 6/2, 2017 at 18:25 Comment(0)
P
2

I would suggest just enable developers tool in your settings,

I did the same thing. now I can transfer files easily.

If you can not find developer tools option in settings, just go to about phone and tap on build number 7 to 8 times continuously.

that's it your done.

Penholder answered 23/5, 2017 at 14:57 Comment(0)
G
1
  1. Install Android Debug Bridge and Media Transfer Protocol (MTP) library tools by.

    sudo apt-get install adb install mtp-tools
    
  2. Connect your OnePlus device, you should see a new volume with drivers. Run adb script from there:

    $ cd /media/$USER/20160907_1106261
    $ bash adb_config_Linux_OSX.sh
    android home is exist!
    0x2a70
    VID 0x2a70 is already configured..
    adb should be OK!
    
  3. Install android-file-transfer package:

    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0BB4A1B2FA1A38EB
    sudo add-apt-repository "deb http://ppa.launchpad.net/samoilov-lex/aftl-stable/ubuntu artful main"
    sudo apt install android-file-transfer
    
  4. Check your device connectivity by running mtp-detect.

  5. Run android-file-transfer.

See also: Device is already used by another process.


Troubleshooting

error returned by libusb_claim_interface() = -6LIBMTP PANIC: Unable to initialize device

  1. Activate Developer Settings by tapping 7 times Build number in About phone.
  2. Enable File transfer in USB configuration found in Developer options.

See: How can I access media on my OnePlus 5 with a Ubuntu OS?

Gail answered 18/5, 2019 at 14:3 Comment(1)
Thanks this worked for me, in step number 3 please mention sudo apt update as well else you will get E: Unable to locate package android-file-transferMary

© 2022 - 2024 — McMap. All rights reserved.