1

I am trying to install Cyanogenmod 13 in Oneplus 2 but I cannot get TWRP flashed in the phone because I cannot get adb work as expected with Ubuntu 16.04 in common Ubuntu, Persistent Live Ubuntu and Live Ubuntu.

  1. Common Ubuntu

    The command adb devices and fastboot devices returns nothing, although it should not, since my Android phone is in the developer mode with enabled fastboot. Work flow

    masi@masi:~/Downloads$ wget -O - https://skia.googlesource.com/skia/+archive/cd048d18e0b81338c1a04b9749a00444597df394/platform_tools/android/bin/linux.tar.gz | tar -zxvf - adb
    --2016-08-15 17:16:09--  https://skia.googlesource.com/skia/+archive/cd048d18e0b81338c1a04b9749a00444597df394/platform_tools/android/bin/linux.tar.gz
    Resolving skia.googlesource.com (skia.googlesource.com)... 74.125.136.82, 2a00:1450:4013:c01::52
    Connecting to skia.googlesource.com (skia.googlesource.com)|74.125.136.82|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: unspecified [application/x-gzip]
    Saving to: ‘STDOUT’
    
    -                   [<=>   ]       0  --.-KB/s               adb
    -                        [        <=>            ]   1.31M  70.0KB/s    in 19s     
    
    2016-08-15 17:16:29 (70.0 KB/s) - written to stdout [1374340]
    
    masi@masi:~/Downloads$ sudo mv adb /usr/bin/adb
    masi@masi:~/Downloads$ sudo chmod +x /usr/bin/adb
    masi@masi:~/Downloads$ adb version
    Android Debug Bridge version 1.0.32
    masi@masi:~/Downloads$ adb devices
    List of devices attached 
    
    masi@masi:~/Downloads$ sudo adb devices
    List of devices attached
    

    I think the adb version works at least in 14.04 but not now with 16.04.

    Inspecting with lsusb shows that the device is detected in Ubuntu as Bus 001 Device 050: ID 2a70:f003.

    Settings where I already authorized USB debugging

    enter image description here

    I do when masi is in the group plugdev but still unsuccessful result

    # OrganicMarble
    sudo touch /etc/udev/rules.d/51-android.rules
    
    masi@masi:/$ sudo vim /etc/udev/rules.d/51-android.rules 
    
    masi@masi:~$ groups masi
    masi : masi adm cdrom sudo dip plugdev staff lpadmin sambashare
    
    masi@masi:/$ cat /etc/udev/rules.d/51-android.rules
    SUBSYSTEM=="usb", ATTR{idVendor}=="2a70", MODE="0666", GROUP="plugdev"
    
    masi@masi:/$ sudo chmod a+r /etc/udev/rules.d/51-android.rules
    
    masi@masi:/$ sudo adb devices
    * daemon not running. starting it now on port 5037 *
    * daemon started successfully *
    
    List of devices attached 
    
    masi@masi:/$ adb devices
    List of devices attached 
    
  2. Persistent Live Ubuntu

    Fails with bugs in /etc/hostname and /etc/hosts, not related to this case but reported here

  3. Live Ubuntu 16.04

    This attempt fails in trying to get adb to work

    ubuntu@ubuntu:~$ wget -O - https://skia.googlesource.com/skia/+archive/cd048d18e0b81338c1a04b9749a00444597df394/platform_tools/android/bin/linux.tar.gz | tar -zxvf - adb
    --2016-08-15 17:16:09--  https://skia.googlesource.com/skia/+archive/cd048d18e0b81338c1a04b9749a00444597df394/platform_tools/android/bin/linux.tar.gz
    Resolving skia.googlesource.com (skia.googlesource.com)... 74.125.136.82, 2a00:1450:4013:c01::52
    Connecting to skia.googlesource.com (skia.googlesource.com)|74.125.136.82|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: unspecified [application/x-gzip]
    Saving to: ‘STDOUT’
    
    -                   [<=>   ]       0  --.-KB/s               adb
    -                        [        <=>            ]   1.31M  70.0KB/s    in 19s     
    
    2016-08-15 17:16:29 (70.0 KB/s) - written to stdout [1374340]
    
    ubuntu@ubuntu:~$ sudo mv adb /usr/bin/adb
    ubuntu@ubuntu:~$ sudo chmod +x /usr/bin/adb
    ubuntu@ubuntu:~/Downloads$ adb version
    bash: /usr/bin/adb: No such file or directory
    

Ubuntu: 16.04
Linux kernel 4.6
Phone: Oneplus 2
Phone settings: Oxygen OS 3.20, Developer mode, fastboot on

2 Answers2

2

The reason you do not get anything from adb devices is that your phone is not in the fastboot mode. So put your phone there and try again.

Shortly, here the work flow without rooting your phone. Do where recovery.img is the renamed TWRP image but has to be renamed like that

  1. Enable Developer mode in your phone; enable smart bootloader and the other setting in Developer settings
  2. Start your phone in fastboot; power + volume up; press so long as your phone vibrates
  3. fastboot devices should return the device id; fastboot oem unlock and phone phone reboots
  4. Again to fastboot and run fastboot flash recovery recovery.img
  5. Go now to the recovery mode by Power + volume down
  6. Wipe everything else except internal data
  7. Install and flash with Switch_to_OOS3_H2OSMM.zip such that you can flash your OO Rom
  8. Flash now with Cyanogenmod Rom and Pico Gapps (Arm64) - only for Google Play Store
  9. Wipe Cache/dalvik

Sources

  1. https://forums.oneplus.net/threads/24-06-2016-oneplus-2-how-to-unlock-bootloader-flash-twrp-root-nandroid-efs-backup-and-more.345478/
  2. http://forum.xda-developers.com/oneplus-2/development/6-0-x-cyanogenmod-13-oneplus-2-t3292436/page769

Systems: Ubuntu 16.04, Windows 10

hhh
  • 739
  • 2
  • 7
  • 25
1

You didn't mention it, so it's possible that you didn't update /etc/udev/rules.d/51‌​-android.rules to include your device.

If this file doesn't exist, create it, and add a line for each device using this format.

SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"

(all entries are just as written except for idVendor. Look that up in this table.)

Once your file is complete, then execute

sudo chmod a+r /etc/udev/rules.d/51-android.rules

If all else is well, you should be able to connect using adb.

Organic Marble
  • 23,641
  • 15
  • 70
  • 122
  • 1
    If your device manufacturer isn't in the table (mine wasn't) try using the string found after ID in the output from lsusb - in your case 2a70 – Organic Marble Aug 15 '16 at 17:04
  • 1
    You should be a member of group plugdev, but check and make sure by typing in a terminal groups your-userid. – Organic Marble Aug 15 '16 at 17:54
  • 1
    You have performed all the steps that I did to get mine working, so something else must be going on :( – Organic Marble Aug 15 '16 at 18:35
  • 1
    I have it working both on 14.04 and 16.04 machines. It's been a while, but I think on 16.04 I installed from the repo. You have to have 1.0.32 for it to work, but I saw in your question that you do have that. – Organic Marble Aug 15 '16 at 20:24