[SOLVED] - Manually enable adb debugging from recovery

Search This thread

workdowg

Senior Member
Apr 17, 2011
1,556
691
Seneca Falls
First off, this may seem a noob question, but I am definitely not. :)

I have an Iconia A200 that now has a broken lcd screen. No display, no touch. I am able to get into the tablet from TWRP via adb, but not from Android (Jelly Bean). It seems I never enabled usb debugging when I installed the custom rooted rom.... I can access the file system and modify anything... Which files need to be modified to enable debugging in Android? Here is what I tried:

Added to default.prop and /system/build.prop
Code:
persist.service.adb.enable=1                                                    
persist.service.debuggable=1
persist.sys.usb.config=mtp,adb

Edit: Must have had typos... It now works.
 
Last edited:

gyanendra07

New member
May 1, 2015
1
0
Lucknow
same problem

hello there, how do you connect your android devices if the adb debugging is not enable? when i open cmd and type adb devices, it says no devices/emulators found even though i connect my phone via usb cable and in recovery mode. please help me with this problem. my phone is lenovo a369i.
same problem with me
i have samsung galaxy grand max SM-G7202
i installed all drivers adb present on the web but my device was not detected please help me i have very important documents on my phone
 

Droidriven

Senior Member
Jan 27, 2014
15,410
9
5,353
NC
Verizon Samsung Galaxy S III
HTC Thunderbolt
same problem with me

i have samsung galaxy grand max SM-G7202

i installed all drivers adb present on the web but my device was not detected please help me i have very important documents on my phone
If your device can not boot into system, ADB will not work on your Samsung device unless your device device is rooted and/or has TWRP recovery installed on the device.

Sent from my SM-S767VL using Tapatalk
 

Cepasaccus

Member
Jan 23, 2019
10
1
I try to find a solution for my boot problem without a full wipe and I would like to look at the logs to get information why it is stuck. The behavior is that it is doing endlessly the arc animation with a little pause every sixth arc and I can't turn off with the power button. I did what is written in the fifth posting here to turn on adb. Unfortunately I have adb only in TWRP and not in the Android booting process.

Is there something wrong with what I did to enable adb? Or is adb not starting that early in the boot process and it can't work?

Samsung S5 with Lineage 16
 

Droidriven

Senior Member
Jan 27, 2014
15,410
9
5,353
NC
Verizon Samsung Galaxy S III
HTC Thunderbolt
I try to find a solution for my boot problem without a full wipe and I would like to look at the logs to get information why it is stuck. The behavior is that it is doing endlessly the arc animation with a little pause every sixth arc and I can't turn off with the power button. I did what is written in the fifth posting here to turn on adb. Unfortunately I have adb only in TWRP and not in the Android booting process.

Is there something wrong with what I did to enable adb? Or is adb not starting that early in the boot process and it can't work?

Samsung S5 with Lineage 16
What did you do to cause the bootloop? If you were on stock then flashed a custom ROM but did not factory reset, wipe cache and wipe dalvik cache when you flashed the ROM, that is why you are getting a bootloop. You can't flash a custom ROM over stock without wiping. If this is what you did, boot into TWRP and factory reset, wipe cache and wipe dalvik cache then see if it reboots correctly.

If this is not what caused your bootloop, try booting into TWRP, select the Wipe option then select the "advanced wipe" option, then select only the cache partition and dalvik cache, then wipe them and try rebooting.


Sent from my SM-S767VL using Tapatalk
 

Cepasaccus

Member
Jan 23, 2019
10
1
The last thing I did before the boot loop was to install Yalp as system service. I did already wipe cache and dalvik, up- and downgrade, remove all traces of yalp by deleting packages and editing text files, wipe system partition and reinstall. I did not yet do a fresh install. I would like to avoid that if possible and thought that I could get logging information via adb.
 

lucfig

Senior Member
Feb 19, 2008
895
261
Rio das Ostras
Hi,

I have a galaxy A20 with a broken screen.

Imanaged to boot into recovery and adb detects the device which is rooted with magisk.

But when i try the "su" command after "adb shell", it returns:
Code:
/sbin/sh: su: not found

The mount command returns:
Code:
rootfs on / type rootfs (rw,seclabel)
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,size=1392352k,nr_inodes=348088,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,seclabel,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,seclabel,relatime,size=1392352k,nr_inodes=348088)
none on /sys/kernel/config type configfs (rw,relatime)
pstore on /sys/fs/pstore type pstore (rw,seclabel,relatime)
/dev/block/mmcblk0p28 on /cache type ext4 (rw,seclabel,relatime,i_version)
/dev/block/mmcblk0p32 on /data type ext4 (rw,seclabel,relatime,resgid=5678,i_version,data=ordered)
/dev/block/mmcblk0p32 on /sdcard type ext4 (rw,seclabel,relatime,resgid=5678,i_version,data=ordered)

Can anyone give me a direction?

Thanks
 

Droidriven

Senior Member
Jan 27, 2014
15,410
9
5,353
NC
Verizon Samsung Galaxy S III
HTC Thunderbolt
So I should add su to the recovery? Is that it?

If it is the case, do you have any suggestion on how to do that?



Thanks,
No, you won't be able to get stock recovery to work with su. If your recovery/system has the option to mount system in stock recovery, this "might" enable the use of certain adb functions to modify system.

Other than that, you'll need a custom recovery such as TWRP to achieve what you are looking for.

Sent from my SM-S767VL using Tapatalk
 

lucfig

Senior Member
Feb 19, 2008
895
261
Rio das Ostras
No, you won't be able to get stock recovery to work with su. If your recovery/system has the option to mount system in stock recovery, this "might" enable the use of certain adb functions to modify system.

Other than that, you'll need a custom recovery such as TWRP to achieve what you are looking for.

Sent from my SM-S767VL using Tapatalk

I'm almost sure that I have TWRP installed. But I cannot see my screen.
A long time I do not boot in recovery, but I think I flashed TWRP when I rooted the device.
And from the mount command, I dont know which is the system partition. If adb do not have root access does it become hidden?
 

Droidriven

Senior Member
Jan 27, 2014
15,410
9
5,353
NC
Verizon Samsung Galaxy S III
HTC Thunderbolt
I'm almost sure that I have TWRP installed. But I cannot see my screen.

A long time I do not boot in recovery, but I think I flashed TWRP when I rooted the device.

And from the mount command, I dont know which is the system partition. If adb do not have root access does it become hidden?
If you can't see the TWRP screen when you boot into recovery, that means TWRP probably didn't flash correctly.

Sent from my SM-S767VL using Tapatalk
 

NFSP G35

Senior Member
Feb 28, 2012
362
201
If you can't see the TWRP screen when you boot into recovery, that means TWRP probably didn't flash correctly.

Sent from my SM-S767VL using Tapatalk

He can't see the screen because it's broken

---------- Post added at 12:13 AM ---------- Previous post was at 12:11 AM ----------

I'm almost sure that I have TWRP installed. But I cannot see my screen.
A long time I do not boot in recovery, but I think I flashed TWRP when I rooted the device.
And from the mount command, I dont know which is the system partition. If adb do not have root access does it become hidden?

In adb, try just running the command:
twrp

That will tell you if your recovery is TWRP or stock. If it's TWRP, you can use that command to back up stuff
 
  • Like
Reactions: lucfig

lucfig

Senior Member
Feb 19, 2008
895
261
Rio das Ostras
He can't see the screen because it's broken

---------- Post added at 12:13 AM ---------- Previous post was at 12:11 AM ----------



In adb, try just running the command:
twrp

That will tell you if your recovery is TWRP or stock. If it's TWRP, you can use that command to back up stuff

Thanks. Tried and it TWRP is indeed installed. So I am bacck to the main issue. Any idea why I cannot do any of these ?
  • see the system partition with the mount command
  • su command returns there is no su in sbin
  • cannot see or moodify the build.prop
see the system partition with the mount command
 

NFSP G35

Senior Member
Feb 28, 2012
362
201
Thanks. Tried and it TWRP is indeed installed. So I am bacck to the main issue. Any idea why I cannot do any of these ?
  • see the system partition with the mount command
  • su command returns there is no su in sbin
  • cannot see or moodify the build.prop
see the system partition with the mount command

Magisk is a systemless root, meaning it doesn't modify your system partition. On some devices, modifying the system partition can result in boot loops or even a brick.
You mentioned you have a broken screen, what is your goal with this device? IOW, why are you trying to enable ADB? If it is for the purpose of backing up things that you have on the phone, then you can do that with the TWRP adb
 
  • Like
Reactions: lucfig

lucfig

Senior Member
Feb 19, 2008
895
261
Rio das Ostras
Magisk is a systemless root, meaning it doesn't modify your system partition. On some devices, modifying the system partition can result in boot loops or even a brick.

You mentioned you have a broken screen, what is your goal with this device? IOW, why are you trying to enable ADB? If it is for the purpose of backing up things that you have on the phone, then you can do that with the TWRP adb
I wanted to remove the lockscreen password and backup with titanium backup.
But you are right, will learn how to use the twrp command. After backing up, do you suggest any app for Android or windows to explore the backup and restore in a different device (also different model)?

Enviado de meu HD1903 usando o Tapatalk
 

NFSP G35

Senior Member
Feb 28, 2012
362
201
I wanted to remove the lockscreen password and backup with titanium backup.
But you are right, will learn how to use the twrp command. After backing up, do you suggest any app for Android or windows to explore the backup and restore in a different device (also different model)?

Enviado de meu HD1903 usando o Tapatalk

The donate version of Titanium has "extract from ADB backup" and "extract from Nandroid backup" options. I've never tried it, but it sounds like a potential solution in your case.
 
  • Like
Reactions: lucfig

Curt5654

New member
Feb 13, 2015
2
0
You should've stopped at " 'adb' is not..."



You need to first install ADB, the installer can be found via Google.
Once installed (Press 'Y' > 'ENTER' for each option during install, this should install it to the default location, i.e. "C:").
Run "cmd" and enter the command "dir" . . . you should see "adb" as the first or second <DIR> listed; if you do not, find where 'adb' is installed and navigate to its folder via the commands 'cd' and 'dir'. Once in the 'adb' dir...
Begin typing "adb shell" and you'll see something other than..
 

Top Liked Posts

  • There are no posts matching your filters.
  • 19
    First off, this may seem a noob question, but I am definitely not. :)

    I have an Iconia A200 that now has a broken lcd screen. No display, no touch. I am able to get into the tablet from TWRP via adb, but not from Android (Jelly Bean). It seems I never enabled usb debugging when I installed the custom rooted rom.... I can access the file system and modify anything... Which files need to be modified to enable debugging in Android? Here is what I tried:

    Added to default.prop and /system/build.prop
    Code:
    persist.service.adb.enable=1                                                    
    persist.service.debuggable=1
    persist.sys.usb.config=mtp,adb

    Edit: Must have had typos... It now works.
    19
    How would i do this with my skyrocket? same problem, broken screen, adb disabled. Some instructions would be sweet, cause im not really clear with what you did here.

    How would i do this with my skyrocket? same problem, broken screen, adb disabled. Some instructions would be sweet, cause im not really clear with what you did here.
    I'm going to stay general and assume that a skyrochet is a phone, you have a linux or windows pc with ADB installed (and the drivers to connect to your phone) and have TWRP or CWM Recovery installed already...
    1) Start the phone in recovery mode - mine is power down and vol
    2) Connect you cable to the pc and start a console terminal or cmd prompt
    3) Run the following
    Code:
    adb shell
    su
    mount -o remount,rw /system
    cd /
    echo "persist.service.adb.enable=1" >> default.prop 
    echo "persist.service.debuggable=1" >> default.prop
    echo "persist.sys.usb.config=mtp,adb" >> default.prop
    echo "persist.service.adb.enable=1" >> /system/build.prop 
    echo "persist.service.debuggable=1" >> /system/build.prop
    echo "persist.sys.usb.config=mtp,adb" >> /system/build.prop
    Once you reboot into Android you should be able to connect via adb.
    If you google vnc over adb you can get a usable but very slow vnc connection then install Andriod VNC server for a little better performance.
    That's the best I can do from memory ...
    3
    First off, this may seem a noob question, but I am definitely not. :)

    I have an Iconia A200 that now has a broken lcd screen. No display, no touch. I am able to get into the tablet from TWRP via adb, but not from Android (Jelly Bean). It seems I never enabled usb debugging when I installed the custom rooted rom.... I can access the file system and modify anything... Which files need to be modified to enable debugging in Android? Here is what I tried:

    Added to default.prop and /system/build.prop
    Code:
    persist.service.adb.enable=1                                                    
    persist.service.debuggable=1
    persist.sys.usb.config=mtp,adb

    Edit: Must have had typos... It now works.

    Ok Sounds good for you. Can you changed the title of your thread by [SOLVED]
    Thanks in advance ;)
    3
    Hi workdowg! I appreciate your replies.

    Immediately after I boot into CWM recovery and connect via adb, I'm already root. There is no need for me to su.

    Also, there's already a directory called /system. If I "cd" to this directory and run "ls -la", I get the following:

    Code:
    # cd /system
    
    /system # ls -la
    __bionic_open_tzdata: couldn't find any tzdata when looking for localtime!
    __bionic_open_tzdata: couldn't find any tzdata when looking for GMT!
    __bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!
    drwxr-xr-x    3 root     root             0 Jan  1  1970 .
    drwxr-xr-x   22 root     root             0 Jan  1 17:07 ..
    drwxr-xr-x    2 root     root             0 Jan  1  1970 bin


    So immediately after I boot, /system is a directory which already exists, but doesn't contain a "build.prop"


    When you are in adb shell what do you get with just the mount command?

    The output of the mount command is:

    Code:
    # mount
    rootfs on / type rootfs (rw)
    tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,mode=755)
    devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600)
    proc on /proc type proc (rw,relatime)
    sysfs on /sys type sysfs (rw,seclabel,relatime)
    selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
    tmpfs on /storage type tmpfs (rw,seclabel,relatime,mode=050,gid=1028)
    tmpfs on /mnt/secure type tmpfs (rw,seclabel,relatime,mode=700)
    tmpfs on /mnt/fuse type tmpfs (rw,seclabel,relatime,mode=775,gid=1000)
    /dev/block/mmcblk0p12 on /cache type ext4 (rw,seclabel,relatime,user_xattr,barrier=1,journal_async_commit,data=ordered)



    Try this:
    Code:
    su
    mount -o rw,remount /dev/block/by-name/system /system

    Four mount commands which I tried but didn't work:

    Code:
    # mount -o rw,remount /dev/block/by-name/system /system
    mount: mounting /dev/block/by-name/system on /system failed: Invalid argument
    
    # mount -o rw,remount /dev/block/by-name/system /system2
    mount: mounting /dev/block/by-name/system on /system2 failed: No such file or directory
    
    /dev/block # mount -o rw,remount /dev/block/mmcblk0p13 /system2
    mount: mounting /dev/block/mmcblk0p13 on /system2 failed: No such file or directory
    
    /dev/block # mount -o rw,remount /dev/block/mmcblk0p13 /system
    mount: mounting /dev/block/mmcblk0p13 on /system failed: Invalid argument


    Btw I'm guessing that mmcblk0p13 is my system partition, but I'm not 100% sure.

    *********************

    Edit:

    Oh no, I wasn't thinking straight earlier...

    Sorry, I've just realized how noob I was. Anyway, after running the following commands...

    Code:
    cd /
    mkdir /system2
    mount -o rw /dev/block/mmcblk0p13 /system2
    echo "persist.service.adb.enable=1" >> default.prop 
    echo "persist.service.debuggable=1" >> default.prop
    echo "persist.sys.usb.config=mtp,adb" >> default.prop
    echo "persist.service.adb.enable=1" >> /system2/build.prop 
    echo "persist.service.debuggable=1" >> /system2/build.prop
    echo "persist.sys.usb.config=mtp,adb" >> /system2/build.prop

    ...and then rebooting, I now have adb access to Android! (Finally!) And I've managed to run Android Screencast together with my phone, so my phone is fully functional once more.

    Thank you so much workdowg!
    3
    You should've stopped at " 'adb' is not..."

    Microsoft Windows [Version 6.3.9600]
    (c) 2013 Microsoft Corporation. All rights reserved.

    C:\Windows\system32>adb shell
    'adb' is not recognized as an internal or external command,
    operable program or batch file.
    . . .
    Getting this on S$..any1 here to help me!

    You need to first install ADB, the installer can be found via Google.
    Once installed (Press 'Y' > 'ENTER' for each option during install, this should install it to the default location, i.e. "C:").
    Run "cmd" and enter the command "dir" . . . you should see "adb" as the first or second <DIR> listed; if you do not, find where 'adb' is installed and navigate to its folder via the commands 'cd' and 'dir'. Once in the 'adb' dir...
    Begin typing "adb shell" and you'll see something other than..
    "'adb' is not recognized as an internal or external command,
    operable program or batch file."