
If you plug your OnePlus Two or OnePlus X on a Ubuntu 14.04 LTS workstation while in MTP mode, you'll notice that you won't be able to access your phone filesystem. You'll only get a read-only cd-rom emulation drive holding some windows and OSX drivers. But if you connect in PTP mode, no problem, everything works fine.
This comes from the fact that OnePlus Two and OnePlus X are not known as a MTP device under Ubuntu 14.04 LTS.
You'll also realize that your OnePlus Two / OnpePlus X won't be recognized as an ADB device, even if ADB has been enabled on the phone. Thats again because vendor ID is not included in the default list.
This short article explains how to declare your OnePlus Two / OnePlus X as an ADB and a MTP device on your Ubuntu 14.04 LTS workstation to get a fully functional access to your device.
1. Main principle
When connected thru USB your OnePlus Two or OnePlus X are detected as an unknown manufacturer product :
Terminal...
Bus 003 Device 075: ID 2a70:9011
...
It has following caracteristics :
- Vendor ID : 2a70
- Product ID : 9011 / f003 (MTP mode) & 904d / 904e (PTP mode)
This unknown vendor ID has two side effects :
- it is not detected as an ADB device, even if you've enabled USB debugging on the phone
- is is not detected as a MTP device, even if MTP mode is enabled on the phone
When you plug your OnePlus Two / OnePlus X in ADB mode, it is not detected.
TerminalList of devices attached
In Nautilus you only only see an emulated CD-ROM drive with some OSX and WIndows drivers.

To be fully accessible, any MTP device should have 2 rules declared to udev :
- First rule should allow Read/Write access to the device to any user belonging to plugdev group
- Second rule should force device handling thru libmtp
Once these 2 rules are properly declared, your OnePlus Two or OnePlus X will be detected as a standard MTP device.
2. Declare Vendor ID for ADB
To be detected as an ADB device, your OnePlus Two / OnePlus X vendor ID should be declared in ~/.android/adb_usb.ini
~/.android/adb_usb.iniYou just need to create or modify this file with OnePlus vendor ID declaration.
Terminal# echo "0x2a70" >> ~/.android/adb_usb.ini
3. Declare Vendor ID for MTP
To allow Read/Write access to the device to any user belonging to plugdev group, new USB Vendor ID 2a70 should be declared under /etc/udev/rules.d/51-android.rules.
This is done by adding the following lines :
/etc/udev/rules.d/51-android.rules# OnePlus Two (unknown vendor's name)
SUBSYSTEM=="usb", ATTR{idVendor}=="2a70", MODE="0666", GROUP="plugdev"
...
Easiest way to do it is to retrieve a complete declaration file from my GitHub account. This file includes declaration for both OnePlus Two and OnePlus X.
Terminal# sudo chmod a+r /etc/udev/rules.d/51-android.rules
4. Declare the phone as a MTP device
As we've seen previously, when you connect your OnePlus Two or your OnePlus X to your computer USB port, it is not detected as a MTP device.
To force detection, we need to add the following lines to /etc/udev/rules.d/69-mtp.rules. If this file doesn't exist, it should be created.
/etc/udev/rules.d/69-mtp.rules# OnePlus Two (normal & ADB mode)
ATTR{idVendor}=="2a70", ATTR{idProduct}=="9011|f003", SYMLINK+="libmtp-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"
...
Easiest way to declare this file is to retrieve it from my GitHub account. It includes OnePlus Two / OnePlus X and some other devices declaration.
Terminal# sudo chmod a+r /etc/udev/rules.d/69-mtp.rules
5. Test ADB & MTP connexion
Last step is to restart udev daemon and adb server for the new rules to become operational.
Terminaludev stop/waiting
udev start/running, process 18281
# adb kill-server
# adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
You can now connect your OnePlus Two or OnePlus X with ADB debug on and in MTP mode.
Your phone should be detected as an ADB device when ADB debugging is enabled.
TerminalList of devices attached
b0d361fe device
In Nautilus, you should get a new Android device with your phone files :

Hope it helps !