How to use full adb command set in TWRP recovery mode? - General Questions and Answers

My screen broke and I can't access the regular menus to enable adb debug mode. I can get into TWRP recovery or fastboot/odin mode which does enable MTP, so I've been able to access files on the data partition. I want to be able to access my app data though. If I can use adb backup I can make a backup and mount it offline or restore to an identical model and get access to my app data that way, but adb seems to not be enabled in TWRP. TWRP has a pretty simple menu so I could maybe fudge my way through by blind clicking, but even looking at a working model I can't find any menu option to enable adb in TWRP 3.1.1-0. Do I need a different version? The closest I can find is to enable adb sideload, but that's limited to only sideload and it doesn't work anyway. The device always shows as "offline". Seems my PC needs to be included in a trusted devices file. I've seen some clever instructions on overwriting the file containing trusted devices, but it requires the system partition is mounted, which if I could do that I'd have access to the app data anyways.
Is there some way to get access to this data? I looked at apps like vysor which work as an external display for the device which could allow me to work around the broken screen, but that seems to require adb debug is enabled, which it isn't.

Only if ADB got successfully enabled on a phone you can run Android shell-commands via ADB when phone is booted into recovery mode.

Related

Galaxy S5 with broken screen, need help controlling it from PC

Hi, I've got an old S5 with a broken screen. There's no image going on and there's no indication that the touchscreen is working.
I'm not looking to recover data, I'm looking to play around with it by controlling it from my PC. Last I remember, the phone is running a Cyanogenmod OS (I don't think LineageOS was around at that time) with either TWRP or CWM recovery, but I'd bet on TWRP.
Now: the device reaches the OS properly, I can tell because if I try to turn the ringing sound up it gives me an audio feedback.
If I connect it to a PC from the OS:
- the phone shows up in Windows Explorer as "SM-G900F"
- Device Manager shows me a "SAMSUNG Mobile USB Composite Device" under Universal Serial Bus controllers
However I cannot access any files (Windows Explorer shows the device as empty), and if I attempt to 'adb devices' in the console it shows me an empty devices list.
Now, I suspect that USB debugging might be off. So I also tried connecting it to a PC from recovery and the exact same thing as above can be observed, PLUS:
- Device manager also shows me a "SAMSUNG Android Phone" list which can be expanded to show me one entry called "SAMSUNG Android ADB Interface"
However it's the same as before, no files available and 'adb devices' shows an empty list.
Now I heard that I can theoretically enable USB debugging through ADB, by writing to a config file. That would allow me to enable USB debugging and try something like Vysor in order to control the phone from my PC.
However that's a moot point until I can figure out why the ADB service on my PC isn't seeing the device. Any help would be greatly appreciated, and if you need more info I can provide it.
Extra info:
- I installed Samsung USB drivers at some point while trying to make it work
- Windows Explorer shows a phone icon for this device, and if I recall correctly that's what happens when it's connected through MTP (Mass Storage should show it like a memory card)
_sepiroth said:
Hi, I've got an old S5 with a broken screen..........
Click to expand...
Click to collapse
I've never experienced this situation myself but, I've seen that the following thread has worked for many individuals.
https://forum.xda-developers.com/showthread.php?t=2786395
Good Luck!
~~~~~~~~~~~~~~~
Unless asked to do so, PLEASE don't PM me regarding support. Sent using The ClaRetoX Forum App on my Apple Macintosh.
Ibuprophen said:
I've never experienced this situation myself but, I've seen that the following thread has worked for many individuals.
https://forum.xda-developers.com/showthread.php?t=2786395
Good Luck!
~~~~~~~~~~~~~~~
Unless asked to do so, PLEASE don't PM me regarding support. Sent using The ClaRetoX Forum App on my Apple Macintosh.
Click to expand...
Click to collapse
Thanks a bunch, that pointed me in the right direction with my research! I solved my issue, I can now control my phone from my PC.
By doing this I ran into a couple of problems, I'm going to describe them and their solutions:
Problem 1: couldn't ADB into the device when in Recovery Mode. That is because after a long head scratching session I came to the conclusion that I didn't have TWRP Recovery installed (I had Philz Touch CWM Recovery and LineageOS 14.1 instead).
Solution 1: ADB mode is enabled in TWRP by default. So I flashed the latest TWRP through Odin, ADB instantly started working afterwards in Recovery Mode.
Problem 2: USB Debugging was disabled inside the OS.
Solution 2: from the thread that Ibuprophen posted, you can enable USB debugging in your OS by opening an ADB shell into your device and modify the build.prop like so
Code:
Adb shell
echo "persist.service.adb.enable=1" >>/system/build.prop
echo "persist.service.debuggable=1" >>/system/build.prop
echo "persist.sys.usb.config=mass_storage,adb" >>/system/build.prop
reboot
Problem 3: /system was empty so there was no build.prop. If I attempted to create a build.prop file it wouldn't be saved after a device reboot, so USB debugging still didn't work.
Solution 3: it seems like TWRP doesn't mount /system by default, only /data. You can mount it manually through ADB like this:
Code:
mount -o rw /dev/block/bootdevice/by-name/system /system
I found this out from this stackexchange question: https://android.stackexchange.com/q...data-partitions-in-recovery-mode-in-adb-shell
Problem 4: When an app tries to use USB Debugging you need to allow it to do so from the phone. Since the screen was broken, I couldn't do this.
Solution 4: You'll need to push a public key to your device with ADB. Boot into Recovery Mode and make sure your device is recognized by your PC and type
Code:
adb push <path to adbkey.pub on your PC> /data/misc/adb/adb_keys
This solution is from: https://stackoverflow.com/questions...b-rsa-key-with-broken-touch-screen-on-android
This will make sure that you won't need to confirm debugging permissions for apps coming from your machine.
So for anyone who has a broken phone screen (my screen is dead and touchscreen/touch buttons are kaput too) and wishes to control their phone from their PC but USB debugging is disabled:
1. Boot device in TWRP Recovery (flash it if you don't have it)
2. ADB into the device
3. Make sure /system is mounted (if it's empty it means it's not mounted), else mount it manually like in Solution 3
4. Configure build.prop to have USB Debugging enabled like in Solution 2
5. Push your public key to the device like in Solution 4
6. Restart the phone (into its OS)
7. Download the Chrome extension called Vysor and launch it
8. Connect your phone through a USB cable
9. The device should appear in Vysor, connect to it and have fun controlling it
Note that if you just want to backup your files, steps 1 + 2 are sufficient. After making sure ADB works you can just 'adb pull' all your files which should be located in /sdcard. Google it, it's easy to find.
The same goes for backups, you can do them directly through ADB.
Again, thanks Ibuprophen!
Vysor does not work on all graphic cards. a good free alternative is scrcpy
btw instead of flashing twrp, you can flash a modified system partition with proper entries in build.prop (for those with no custom recovery available)
aIecxs said:
Vysor does not work on all graphic cards. a good free alternative is scrcpy
btw instead of flashing twrp, you can flash a modified system partition with proper entries in build.prop (for those with no custom recovery available)
Click to expand...
Click to collapse
Very well pointed out, thanks for this.

Pixel 4 stuck on boot -- What options do I have for data recovery?

I have a stock (not modded, rooted, etc in any way) Google Pixel 4 that is stuck on the 'G' logo. I have rebooted, powered down, plugged in, attempted safe mode (never showed up), and noodled around in the fastboot menu. I seem to be stuck, with my next possible option being a full device reset.
Before I do that, is there any way to access the file system of the user? I'd really like to try to rescue my images (which are backed up to Google Photos, but not at original resolution). Or, are there any other tricks folks would recommend to get this device to boot?
Thanks for any suggestions you've got.
In case ADB ( read: USB debugging ) got enabled then there might be the chance to pull out the data of interest.
USB debugging had been enabled, but I still can't do much with ADB tools. I can sideload an OTA, but I can't get to ADB shell.
ADB hasn't / isn't a shell.
Check whether you can access device's Android by means of ADB or not:
Code:
adb devices
Yup, my device is listed, with a 'sideload' after it. From what I can tell, it seems I can only push OTA updates to it.
To exit sideload mode you run
Code:
adb reboot

How do you backup data in a rooted phone using adb twrp?

I have a Galaxy Note 5 and I have important data in it. The screen is broken so I can't do anything, but I see recovery listed with a bunch of characters when I do
Code:
adb devices
. I can run some adb commands, adb root tells me I have root, I can do "id" inside of adb shell. Though, whenever I try running any twrp commands inside adb shell, it says "TWRP does not appear to be running. Waiting for TWRP to start."
What can I do here? I also see SAMSUNG Android under devices on this linux distro I'm running but I am getting an mtp error whenever I try connecting to it.
Sorry to hear that. If your Samsung Galaxy Note 5 can be detected by the computer via USB cable connecting, and the USB debugging on it is enabled, try Coolmuster Android Backup Manager. Its free backup function can help transfer data to the computer for backup directly. It's easy and safe. Good luck to you.
nazhai said:
Sorry to hear that. If your Samsung Galaxy Note 5 can be detected by the computer via USB cable connecting, and the USB debugging on it is enabled, try Coolmuster Android Backup Manager. Its free backup function can help transfer data to the computer for backup directly. It's easy and safe. Good luck to you.
Click to expand...
Click to collapse
It doesn't seem to be working, well at least not when the phone's in recovery. I'm not sure if I can boot it up normally.
tesiz22 said:
I have a Galaxy Note 5 and I have important data in it. The screen is broken so I can't do anything, but I see recovery listed with a bunch of characters when I do
Code:
adb devices
.
Click to expand...
Click to collapse
Indicates your phone boots into Recovery mode and not into Normal ( ADB ) mode.
To get rid off of booting into Recovery mode you run
Code:
adb devices
adb reboot
Once your phone boots into Normal mode you can pull out the data of interest: take note that adb pull has a size limit, hence probably
Code:
adb pull /sdcard C:\PULLED-DATA
doesn't work as expected if amount of data to pull is >= 2GB in total ( e.g. a stored movie file may have up to 8GB ). That means, to be on safe side, you have to pull the files of interest one-by-one.

Backup with Smart Switch a black screen Galaxy S5 (Unauthorised device in adb - Root - Usb debugging ON - Unlock patern OK - Recovery accessible)

Hi,
I think I've already explain everything in title.
My Galaxy S5 on Android 8 (I think) as her screen broken (black)
Before that it already wokr badly and slowly. I bought a new phone but this one break just before I can transfer data.
I can unlock the patern (I know that because the volume + buton react)
Smart switch say that the phone is locked (even it's not true). Tested on 2 PC
The phone appear in Windows but no file or folder appear.
In adb the device is shown unauthorised and even if I click where the message to unlock should be, notihng append.
The phone is connected on Wifi, apparear in Google Find it but not Samsung find it...
I think that it's already to much information...
My question : how can I do the unlock the phone and do a smart switch backup ? or an other way to transfer data.
Regards
James
The Samsung Galaxy S10 comes with a USB OTG adapter. OTG stands for "On the Go" and is used for the connection between smartphone and USB stick / cable. Connect this USB OTG adapter to the USB Type C port of your Samsung, then connect the USB OTG adapter with USB Type C port of your computer.
You should see the data stored on your Samsung.
jwoegerbauer said:
The Samsung Galaxy S10 comes with a USB OTG adapter. OTG stands for "On the Go" and is used for the connection between smartphone and USB stick / cable. Connect this USB OTG adapter to the USB Type C port of your Samsung, then connect the USB OTG adapter with USB Type C port of your computer.
You should see the data stored on your Samsung.
Click to expand...
Click to collapse
It's an S5. But I have a OTG adaptor for it but my new phone A52s doesn't connect to the S5.
I try with a S7 but I can see that there is a lot autorisation to give on the old phone which will be very hard to do with a black screen.
If ADB is unauthorized, the only way to back up any data would be via a custom recovery. That would require that the device have an unlocked bootloader though
iBowToAndroid said:
If ADB is unauthorized, the only way to back up any data would be via a custom recovery. That would require that the device have an unlocked bootloader though
Click to expand...
Click to collapse
ADB authorised is not require for Smart Switch... I think
And my device have access to recovery and it's root so the bootloader is unlocked.
jameslevalaisan said:
ADB authorised is not require for Smart Switch... I think
And my device have access to recovery and it's root so the bootloader is unlocked.
Click to expand...
Click to collapse
So then flash a custom recovery, and then enter it. That will either give you MTP access to the files and folders, or ADB should also be enabled - and does not require authorization
iBowToAndroid said:
So then flash a custom recovery, and then enter it. That will either give you MTP access to the files and folders, or ADB should also be enabled - and does not require authorization
Click to expand...
Click to collapse
purehaps you have forget that the screen is broken. I can't access the phone for complicated manipulation. I'have already have TWRP installed on it but without a view it's impossible to manipulate it. Also, it's not normal that the phone are not viewed on windows or is shown locked on smart switch.
In recovery mode, the phone isn't show on windows also. Find the MTP option in TWRP without a screen view is very diffucult and dangerous, (the wipe option are near)
If I can access file on phone I will be able to view screenshot and configure it.
jameslevalaisan said:
purehaps you have forget that the screen is broken. I can't access the phone for complicated manipulation. I'have already have TWRP installed on it but without a view it's impossible to manipulate it. Also, it's not normal that the phone are not viewed on windows or is shown locked on smart switch.
In recovery mode, the phone isn't show on windows also. Find the MTP option in TWRP without a screen view is very diffucult and dangerous, (the wipe option are near)
If I can access file on phone I will be able to view screenshot and configure it.
Click to expand...
Click to collapse
1. No, I didn't forget that the screen is broken
2. I wasn't telling you to press anything in TWRP. When it's in TWRP and you plug it in, you will either get MTP and/or ADB access automatically
3. Yes, it is perfectly normal to not have access to the files and folders in Windows, when it's powered on normally. There's a popup on the phone that you have to tap in order to grant permission to the folders and files. That's why it shows up as an empty device when you plug it in while in normal mode
iBowToAndroid said:
1. No, I didn't forget that the screen is broken
2. I wasn't telling you to press anything in TWRP. When it's in TWRP and you plug it in, you will either get MTP and/or ADB access automatically
3. Yes, it is perfectly normal to not have access to the files and folders in Windows, when it's powered on normally. There's a popup on the phone that you have to tap in order to grant permission to the folders and files. That's why it shows up as an empty device when you plug it in while in normal mode
Click to expand...
Click to collapse
Ok excuse me.
Hum when I'm in recovery mode, my phone doesn't appear in Widows. And in adb, I haven't access to all folder. Data is empty for exemple.
For 3. Ok, I don't remember this notification. But I'm shure that I'have already use this phone with my PC. If I wasn't able to ring it on Whastapp, I will think that the phone doesn't works anymore at all. But it's not the case.
jameslevalaisan said:
purehaps you have forget that the screen is broken. I can't access the phone for complicated manipulation. I'have already have TWRP installed on it but without a view it's impossible to manipulate it. Also, it's not normal that the phone are not viewed on windows or is shown locked on smart switch.
In recovery mode, the phone isn't show on windows also. Find the MTP option in TWRP without a screen view is very diffucult and dangerous, (the wipe option are near)
If I can access file on phone I will be able to view screenshot and configure it.
Click to expand...
Click to collapse
ADB commands work by default while in TWRP, you can back up almost anything that your TWRP version allows through your PC using ADB commands, TWRP will serve as intermediary, but you will not go to operate over your broken screen device but through your ADB/fastboot CMD.
In normal mode I can unlock the phone but after that even if I click where the message should appear it doesn't do anything.
In adb I can't access a backup command (and if I can do this, It will not the easyer way to transfer my sms.)
I have some old other phones to see some message exemple and know where to clic but it doesn't works. I have install Vyzor, It asks me a permission but even if I tap in the right of the screen the permission doesn't works.
I also try to transfert a new adb key but I think it doesn't work because Wyzor still ask permission.
jameslevalaisan said:
In normal mode I can unlock the phone but after that even if I click where the message should appear it doesn't do anything.
In adb I can't access a backup command (and if I can do this, It will not the easyer way to transfer my sms.)
Click to expand...
Click to collapse
There is no backup command in ADB that you can use. And the reason that you can't access /data is because that requires going into TWRP settings and mounting the system partition.
What you can do in TWRP is to adb pull all of the files and folders off of the internal storage
Other thing, I can phone my phone with Whatsapp but I can't click to hang off.
iBowToAndroid said:
There is no backup command in ADB that you can use. And the reason that you can't access /data is because that requires going into TWRP settings and mounting the system partition.
What you can do in TWRP is to adb pull all of the files and folders off of the internal storage
Click to expand...
Click to collapse
ok to do have a exemple of command to tap ?
And there no way to just be able to connect my phone with smart switch on windows ?
jameslevalaisan said:
I have some old other phones to see some message exemple and know where to clic but it doesn't works. I have install Vyzor, It asks me a permission but even if I tap in the right of the screen the permission doesn't works.
I also try to transfert a new adb key but I think it doesn't work because Wyzor still ask permission.
Click to expand...
Click to collapse
ADB backup is not to operate while your device is on, but it is to operate while your device is in TWRP mode.
TWRP has integrated by default the ADB options not need to authorize through your broken screen because it is already authorized.
Messages as an app user (the same with root or system user) is part of userdata, you want to back up userdata to restore it after in other device or a scenery where your device get repaired, no?
I'll give you an example, you have to use this command, create a folder on a convenient place onto your PC directory, something like "BACKUP", assuming that you set it up correctly the environment for ADB/fastboot to use it along all of your system, you should open from this newly created folder an CMD (I use the new Windows terminal for easy/comfortable results) then type from the terminal adb shell twrp backup userdata , you'll have the userdata backed up in your PC in less of 2 minutes depending on the size of the partition, and so on successively.
What you can back up from TWRP depends on the restrictions from your TWRP version, you should back up the normal that you can see from the TWRP screen and even more but for example if your TWRP have some issues mounting vendor partition of course the ADB commands can't do the job for this specific partition, but anyway you have a lot you can do through it.
jameslevalaisan said:
ok to do have a exemple of command to tap ?
And there no way to just be able to connect my phone with smart switch on windows ?
Click to expand...
Click to collapse
1. The command depends on what the mount point for your internal storage is. The command would be "adb pull /(mount point)" , so it could be:
adb pull /sdcard
adb pull /storage0/sdcard
Or several others
2. No, you can't connect with Smart Switch without allowing permission on the popup box on the phone screen
Hi guys,
I'm very happy to find here some people to help me. thank you a lot. I just now in recovery mode.
here is some result of command
Code:
adb devices
List of devices attached
487e969e recovery
adb root
adbd is already running as root
adb shell
~ # ls
cache init.recovery.qcom.rc selinux_version
charger init.recovery.service.rc sepolicy
data init.recovery.usb.rc service_contexts
default.prop license sideload
dev oem sys
etc prebuilt_file_contexts system
file_contexts proc tmp
fstab.qcom property_contexts twres
init res ueventd.qcom.rc
init.rc root ueventd.rc
init.recovery.hlthchrg.rc sbin vendor
init.recovery.nano.rc seapp_contexts
~ #
as you can see there is not storage in the ls result
Code:
~ # ls /res
images keys
~ # ls /data
~ # ls /data
Code:
adb pull /data/data/com.android.providers.telephony/databases/mmssms.db ./
adb: error: remote object '/data/data/com.android.providers.telephony/databases/mmssms.db' does not exist
Is there something inspired you ?
iBowToAndroid said:
1. The command depends on what the mount point for your internal storage is. The command would be "adb pull /(mount point)" , so it could be:
adb pull /sdcard
adb pull /storage0/sdcard
Or several others
2. No, you can't connect with Smart Switch without allowing permission on the popup box on the phone screen
Click to expand...
Click to collapse
1. the ls command doesn't show any sdcard or storage
2. Ok bit wyh I can't click on the permission popup ?
SubwayChamp said:
ADB backup is not to operate while your device is on, but it is to operate while your device is in TWRP mode.
TWRP has integrated by default the ADB options not need to authorize through your broken screen because it is already authorized.
Messages as an app user (the same with root or system user) is part of userdata, you want to back up userdata to restore it after in other device or a scenery where your device get repaired, no?
I'll give you an example, you have to use this command, create a folder on a convenient place onto your PC directory, something like "BACKUP", assuming that you set it up correctly the environment for ADB/fastboot to use it along all of your system, you should open from this newly created folder an CMD (I use the new Windows terminal for easy/comfortable results) then type from the terminal adb shell twrp backup userdata , you'll have the userdata backed up in your PC in less of 2 minutes depending on the size of the partition, and so on successively.
What you can back up from TWRP depends on the restrictions from your TWRP version, you should back up the normal that you can see from the TWRP screen and even more but for example if your TWRP have some issues mounting vendor partition of course the ADB commands can't do the job for this specific partition, but anyway you have a lot you can do through it.
Click to expand...
Click to collapse
I try this...
C:\Users\James-23\AppData\Local\Android\Sdk\platform-tools>adb shell twrp backup userdata
TWRP does not appear to be running. Waiting for TWRP to start . . .
Press CTRL + C to quit.
^C
C:\Users\James-23\AppData\Local\Android\Sdk\platform-tools>adb shell twrp plat-form-tools userdata
TWRP does not appear to be running. Waiting for TWRP to start . . .
Press CTRL + C to quit.
^C
I'm not sure I understand your command. But it return a result. "Backup" is the name of a folder ? or it's a commande for twrp ?
Is there a way to be sure that twrp is installed (with all my phone, sometime, I don't remember what is on it. The thing it's sure it that this phone is root because I use root function with some app but perhaps just with magisk or Super SU.

Pixel 6 Pro full backup to different phone

So I had a pixel 6 pro and unfortunately my wife got mad and threw it against the wall a few times, causing the frame to bend and entire back glass to shatter. The front LCD didn't break, but glue came apart and it separated from the frame.
I had all my 2fa accounts on there, as well as very valuable data that I need to recover.
The phone still powers on, but there's nothing visible on the screen. A local repair shop advised we start by replacing the screen and then work on transferring everything out.
I have a replacement pixel 4a and want to be prepared for when my phone comes back online.
What's the best way to backup my 6 pro and restore on the 4a?
I need everything copied as a whole image, and restored on the 4a. I want to be able to boot up my 4a, open my authenticator app, and have all my accounts listed there.
Someone please tell me this is possible, and if so, please post instructions.
Thank you in advance.
I doubt 1:1 image cloning is possible because encryption is hardware-backed and therefore device-unique. it's not even possible to restore backup on origin device after factory reset since android apps can use keystore in TEE.
side note: you could connect HDMI multiport usb-c otg adapter to TV and mouse so you have access to phone at least
aIecxs said:
I doubt 1:1 image cloning is possible because encryption is hardware-backed and therefore device-unique. it's not even possible to restore backup on origin device after factory reset since android apps can use keystore in TEE.
side note: you could connect HDMI multiport usb-c otg adapter to TV and mouse so you have access to phone at least
Click to expand...
Click to collapse
The HDMI multiport didn't work. Nothing was displayed. I don't know if it's because my phone is badly damaged, or if the pixel 6 doesn't support HDMI out over USB C
I tried this one https://www.amazon.com/dp/B081VBSNRZ/ref=cm_sw_r_apan_i_5NF5RPBKZ97YW4KFW9AX
What are my other options?
the best option would be previously unlocked bootloader, so you can have full access. but you did not unlock bootloader so this is no option for you, because unlocking will factory reset device.
HDMI might require some setting or app installed on device. apps can installed remotely from PC google play with proper google play account. not sure how to start an app though, but guess app can autostart.
at least usb keyboard is working, you could try to navigate blind and enable usb-debugging, this would allow you to use scrcpy. maybe connect headphones or use talkback to get some kind of audio feedback.
of course both methods requires some information from another identical device and need to tested on fully functional pixel 6 pro before..
some (not) useful apps
https://forum.xda-developers.com/t/i-broke-my-screen-and-digitizer.4436261/#post-86791963
https://forum.xda-developers.com/t/broke-the-display-of-my-phone.4424413/#post-86676229
https://forum.xda-developers.com/t/...asily-manage-multiple-android-devices.2707556
Anyone else have suggestions?
AcuraKidd said:
Anyone else have suggestions?
Click to expand...
Click to collapse
This is not a full backup, but it might help you interactively recover some items without replacing the broken screen. Also, assuming this is something you're still looking to solve...
If you have adb debugging enabled, you can try to use https://github.com/Genymobile/scrcpy to interact with your phone over USB from a computer.
If you do not have adb debugging enabled, you can try to enable it via Recovery Mode. The steps to enable Recovery Mode below are from https://www.tenorshare.com/android/how-to-enable-usb-debugging-on-android-with-black-screen.html (I have not tried these steps).
Less:
To enable ADB without a screen:
1. Download the ADB toolkit for your computer and extract its contents to a folder.
ADB toolkit can be found at https://developer.android.com/studio/releases/platform-tools
ADB requires you have USB debugging enabled on your phone.
Since your phone has a black screen, reboot your phone into recovery mode to accomplish this.
Press the Volume Down and Power buttons at the same time to enter recovery mode.
2. Connect your phone to your computer, open a Command Prompt window in the ADB folder, and type the following command.
adb devices
3. You should see your device listed there.
Run the following commands one by one.
adb shell
mount data
mount system
4. Use the following command to pull the persist.sys.usb.config file from your phone to the PC.
adb pull /data/property/persist.sys.usb.config C:\Users\[your-username]\Desktop\
5. Access the persist.sys.usb.config file on your computer with a text editor and edit it to mtp,adb.
6. Run the following command to send the file back to your device.
adb push "C:\Users\[your-username]\Desktop/persist.sys.usb.config" /data/property
7. Download the build.prop file from your phone by using this command.
adb pull /system/build.prop C:\Users\[your-username]\Desktop\
8. Launch the build.prop file in a text editor like NotePad++ on your computer, and add the following code to it.
persist.service.adb.enable=1
persist.service.debuggable=1
persist.sys.usb.config=mtp,adb
9. Save the file and transfer the file back to your device using this command.
adb push "C:\Users\[your-username]\Desktop/build.prop" /system/
10. Reboot your device using the following command.
adb reboot
11. You are all set. Your phone will boot up with USB debugging enabled.

Categories

Resources