How to make then USB menu option - connect_to_pc value=true on bootup - General Questions and Answers

My TV box is 100% rooted, but does not have a Developer Option, seems this was disable or removed by the vendor!
But it does have a USB Menu Section that has the option = "connect_to_pc" that has to be turn on manually, and then I am able to see it when i connect it via a OTG Cable > USB to a PC using ADB,
but the issue is: If the box is rebooted then the USB option "connect_to_pc" is then return to the default state = false and I would like to know when i can find and edit the boot up settings config file
to make it = true on boot up, so when I do any ADB commands that might and/or will make it reboot that it will pick up the "connect_to_pc" and still be able to connect to the box while it is still
connect and using the OTG USB cable after any reboot.
If any one know where the boot up setting config file is located so i can then review and/or edit the setting value=true?.
2nd option: is there a way to run a .sh script while it booting up to be able to make the USB turn on in the connect_to_pc mode?
Thanks in advance to all the forum moderators and members!
AVBestDeals

Related

[SOLUTION] HTC Explorer USB Connection Problem

DISCLAIMER: Iam NOT responsible if something happens to your phone.
Problem Description:
When I connect my HTC Explorer to PC using Data Cable NOTHING HAPPENS ,It Just CHARGES and the Menu doesn't open up.
Even When I tried USB Tethering by going into setings Manually .It says "Unable to Turn On" .I can no longer transfer files from phone to PC .
Have you tried
1. Reinstalling HTC Sync and Drivers
2. Rebooting and Hard Reset
3. Flashing Custom ROM's
4. Using Different Data Cables
But still NO LUCK !!!
First Let's Check Whether it's a Hardware Problem (NOT NECESSARY)
1. Go into Bootloader and then to Fastboot Menu
2. Connect your Phone to PC
3. Now the Phone should Read as "Fastboot USB"
4. Try this Fastboot Command "FASTBOOT DEVICES"
5. If your Phone is Shown in the list ,It's Just a Software Problem and Continue Reading this thread
.If not ,then it's mostly a Hardware Issue
Solution:
1. Download PDANet on your phone (NOT THE APK) (This is for USB Tethering)
2. Connect your Phone using Data cable with Windows Logged On (Nothing will happen)
3. Restart your PC (DONT remove your Phone)
4. As soon as PC starts up ,you'll see the Menu on your Phone that used to appear (You'll see Disk Drive,USB Tetheing....)
5. Make Sure USB Debugging is ON
6. When you're logged into Windows, Select Disk Drive from the Menu on your phone
7. Wait and you're Memory Card will be recoginsed on PC
8. Open PDAnet.exe from Memory Card and Install
USB Tethering will now work (If still not working ,go into settings->wireless and networks->mobile networks->access point names and try changing access point ,then try PDANet again)
This WORKED for me ,:good:
So Next time ,Follow Step 2,3,4 and 5
Then After you log on, Choose Anything you want from Menu on Phone.
I doubt USB Tethering will work directly .But you can use it from PDANet.:good:

How to enable USB debuggin with broken touchscreen?

Hi
I have a old nexus with broken touchscreen . I want to use it via mirror on pc.
unfortunatly USB debuggin wasn't enable so i can't install any app.
any tips?
thanks
PS: i saw many use usb adapter to connect a mouse but i don't have it
EDIT: right now i just need a rom/kernel with USB debugging mode enabled by default
the screen still works , only the touch screen is broken
power , and volume bottons still work
the device is rooted
If it's only installing apps you could install them via recovery. (as zip)
Or you could check for a cheap replacement touchscreen.
nonameleft4me said:
If it's only installing apps you could install them via recovery. (as zip)
Or you could check for a cheap replacement touchscreen.
Click to expand...
Click to collapse
thanks for the answer!
sorry i forgot to mention that i need USB debuggin for make the app works correctly.
I'm trying now to find out what rom i have installed and maybe then find a kernel with OTG support . (yes i found a otg cable )
i'm not a expert of rooting
I think google has an app called voice control. Not sure how operational it is though. Supposedly you can control the entire system via voice.
nonameleft4me said:
I think google has an app called voice control. Not sure how operational it is though. Supposedly you can control the entire system via voice.
Click to expand...
Click to collapse
i need to unlock the phone and tap on the widget "search" to start voice command .
I think the best way is to find a way to enable OTG and then use a usb mouse
Boot into Recovery and mount*Data*partition.
Open a shell on PC and type:
adb pull /data/property/persist.sys.usb.config ~/
Repace*~/*with home directory of your OS.
Open that file in a text editor and you would possibly see*mtp*written there. Change it to*mtp,adb.
Note that sometimes Android doesn't understand the text file changes if the line terminator is "DOS Terminators" which Notepad would probably do on Windows (mine is Linux so no issue here).
In that case, I would suggest not using*adb pullbut doing:
adb shell echo 'mtp,adb' > /data/property/persist.sys.usb.config
You may verify that the*echo*command overwrote the file by using:
adb pull /data/property/persist.sys.usb.config ~/
and seeing the file's content in some text editor.
Unmount*Data*and reboot into Android OS. USB Debugging would probably be enabled.
Sent from my Aqua Trend using Tapatalk
Itzabhaysingj said:
Boot into Recovery and mount*Data*partition.
Open a shell on PC and type:
adb pull /data/property/persist.sys.usb.config ~/
Repace*~/*with home directory of your OS.
Open that file in a text editor and you would possibly see*mtp*written there. Change it to*mtp,adb.
Note that sometimes Android doesn't understand the text file changes if the line terminator is "DOS Terminators" which Notepad would probably do on Windows (mine is Linux so no issue here).
In that case, I would suggest not using*adb pullbut doing:
adb shell echo 'mtp,adb' > /data/property/persist.sys.usb.config
You may verify that the*echo*command overwrote the file by using:
adb pull /data/property/persist.sys.usb.config ~/
and seeing the file's content in some text editor.
Unmount*Data*and reboot into Android OS. USB Debugging would probably be enabled.
Sent from my Aqua Trend using Tapatalk
Click to expand...
Click to collapse
thanks!
i tryed
1) i went in recovery mode
2) i connect via usb the nexus4 to my pc
3)went in "mounts and storage"
4)then "mount /data"
5)in cmd i tryed your command "adb pull /data/property/persist.sys.usb.config" but i says i'm unauthorized
i checked via command "adb devices" and it return a alphanumerica string plus "unauthorized"
i tryed then to
Reboot your phone into recovery mode.
Connect it to your computer.
Open the terminal and type:
cd ~/.android
adb push adbkey.pub /data/misc/adb/adb_keys
adb shell reboot
but it still says error : device unauthorizated . please check the confirmation dialog on your device
i tryed also with a different version of adb and now gives me after "adb devices" an "offline" response
NB: if i connect the phone (not in recovery mode) via usb i can copy files in and out (i can explore onlyfew folders) , maybe this could help.
hartman11 said:
i tryed also with a different version of adb and now gives me after "adb devices" an "offline" response
NB: if i connect the phone (not in recovery mode) via usb i can copy files in and out (i can explore onlyfew folders) , maybe this could help.
Click to expand...
Click to collapse
Sorry but this could not help... Now only thing you can do is connect any USB mouse to your phone via otg cable (as it is not costly also), and you can also try USB gamepad. I also have used USB gamepad before when my touchscreen was not working.
Second thing you can do is download any android device manager for your PC like mobogenie or mobilego they directly install any app from play store to you android device, through USB.And I don't think they need USB debugging option to be enabled.
Sent from my Aqua Trend using Tapatalk
my problem is not installing an app (i could do it in recovery mode with a .zip) but enabling the USB debuggin
I have a otg cable but not the "Y" type ( the one with power source ) , also i don't know if OTG is supported by my kernel . I would like to install maybe another kernel which has OTG support and usb debuggin mode enable by default but i don't know what kind of rom i have D:
right now i just need a rom/kernel with USB debugging mode enabled by default
up

[Guide] Recover MTP setting when connect via usb cable

In this post I will describe a simple method that I followed to recover the option of choose MTP connection when using a usb cable to the PC.
After root with SuperSU I noticed that when I plugged my phone to the PC using the usb cable, I did not have the option to "mount" as MTP anymore.
Therefore I could not transfer files from my PC to the phone in a easy way. If you want to continue with latest SuperSU you have to do that:
1. Edit your build.prop file adding those 2 lines at the end:
persist.service.adb.enable=1
persist.sys.usb.config=mtp,adb
Click to expand...
Click to collapse
2. Close and save it
3. Enable USB debugging in developer options
4. Select MTP in USB Configuration
5. Profit
All the information got from the MIUI Official Forum

Pixel 2 broken screen, Need to recover a file

Hi,
I tried lots of things! Can't do anything yet... I really need that file.
My USB debugging is not turned on, if it was I'll be ok. I found that if you copy the adbkey.pub from your users directory to the phone it
will bypass the USB debugging function, but can't push it with adb.
I can only boot in recovery and use fastboot or adb but with no access to the phone... I don't have TWRP installed.
I tried to flash TWRP with: fastboot flash recovery twrp.img
and I got an error telling me: FAILED (remote: 'No such partition.')
Probably because USB debug is not enabled... again...?
EDIT: tried to make me a walkthrough for the keyboard using a working phone, I can get up to the settings app, there's no focus on the settings items so I can't select them...
- I have access to the fingerprint sensor, but not gonna do much since I rebooted the phone i'll need to enter the unlock code.
- I can plug in a keyboard/mouse combo in my phone, for this to work i'll need a walkthough for arrows key/enter key to press to I can enable USB debugging.
- The screen is broken(black) touch sensor also broken.
- The phone is not rooted but is OEM unlocked
- I tried several software to mirror screen, they all require USB debugging enable or accept something on the phone or both.
- I know where the file is located on the phone but I don't know it's exact name (it's a .mp3 file, not a song ) it's in /storage/emulated/0/Recorders
Any help is greatly appreciated.
Thank you

Phone's screen partially working, need to activate USB Debug

Hello everyone,
my phone (Xiaomi MI 9T) has fallen in the water and now it's partially working.
I really need to recover some data from it, but any method I've found on the internet requires USB Debug active. The phone turns on but it works only as long as it stays on the lock screen or if I go to settings from the notification bar. If I unlock it, the launcher doesn't work (but I can still drag down the notification's bar) and after few seconds the phone reboots I'm also able to activate the toggle of the USB Debug but it looks like it doesn't stay active because if I go back and re-enter developer's section, USB Debug is OFF.
At this point I don't really know what to do. The phone enters fastboot and recovery mode, unfortunately everything is stock, so my possibilities are limited.
I haven't tried to change the screen, but I doubt that would solve the problem, since if I stay in those specific areas, it works fine.
Android version: 10
MIUI 12
Thank you
Dona2592 said:
Hello everyone,
my phone (Xiaomi MI 9T) has fallen in the water and now it's partially working.
I really need to recover some data from it, but any method I've found on the internet requires USB Debug active. The phone turns on but it works only as long as it stays on the lock screen or if I go to settings from the notification bar. If I unlock it, the launcher doesn't work (but I can still drag down the notification's bar) and after few seconds the phone reboots I'm also able to activate the toggle of the USB Debug but it looks like it doesn't stay active because if I go back and re-enter developer's section, USB Debug is OFF.
At this point I don't really know what to do. The phone enters fastboot and recovery mode, unfortunately everything is stock, so my possibilities are limited.
I haven't tried to change the screen, but I doubt that would solve the problem, since if I stay in those specific areas, it works fine.
Android version: 10
MIUI 12
Thank you
Click to expand...
Click to collapse
Due to the security implications of remotely enabling USB Debugging, the only way to enable it is through Developer Options. You can try rebooting to recovery and clearing cache although I am doubtful as to how much that might help you. If your device took a swim, you're going to be looking at repair, which will most likely result in wiping your data.
V0latyle said:
Due to the security implications of remotely enabling USB Debugging, the only way to enable it is through Developer Options. You can try rebooting to recovery and clearing cache although I am doubtful as to how much that might help you. If your device took a swim, you're going to be looking at repair, which will most likely result in wiping your data.
Click to expand...
Click to collapse
Do you know if changing the screen could solve the problem? Or do you think there's a way to copy data 1:1 on another device (such as a used mi 9t I could buy)?
Dona2592 said:
Hello everyone,
my phone (Xiaomi MI 9T) has fallen in the water and now it's partially working.
I really need to recover some data from it, but any method I've found on the internet requires USB Debug active. The phone turns on but it works only as long as it stays on the lock screen or if I go to settings from the notification bar. If I unlock it, the launcher doesn't work (but I can still drag down the notification's bar) and after few seconds the phone reboots I'm also able to activate the toggle of the USB Debug but it looks like it doesn't stay active because if I go back and re-enter developer's section, USB Debug is OFF.
At this point I don't really know what to do. The phone enters fastboot and recovery mode, unfortunately everything is stock, so my possibilities are limited.
I haven't tried to change the screen, but I doubt that would solve the problem, since if I stay in those specific areas, it works fine.
Android version: 10
MIUI 12
Thank you
Click to expand...
Click to collapse
How long ago was it dropped in water, have you allowed it thoroughly dry out? Can you open the body of the device to allow it to dry?
Droidriven said:
How long ago was it dropped in water, have you allowed it thoroughly dry out? Can you open the body of the device to allow it to dry?
Click to expand...
Click to collapse
It stayed in the water for few seconds, the bottom half of it. I shut it down and I let it dry for 2 days, after removing the battery. Anyway I brought it to a center that made a treatment for electronic contacts, an they said that it's needed to change the display first, then run some tests to see what else is wrong. The problem is that changing the screen costs 130€ and, in my opinion, won't solve the issue.
Dona2592 said:
It stayed in the water for few seconds, the bottom half of it. I shut it down and I let it dry for 2 days, after removing the battery. Anyway I brought it to a center that made a treatment for electronic contacts, an they said that it's needed to change the display first, then run some tests to see what else is wrong. The problem is that changing the screen costs 130€ and, in my opinion, won't solve the issue.
Click to expand...
Click to collapse
Can you find a stock update for your specific model number in the form ol stock update.zip that can be flashed in your stock recovery like a OTA update? If so, you might be able to extract the build.prop file from the update then open the build.prop file in a note editor and edit the file by adding or editing lines that enable USB debugging. Then save the file. Then remove everything from the update.zip except for the Meta-inf or "updater script" file/folder then place your modified build.prop file in the update.zip so that it is the only thing in the zip other than the Meta-inf/updater script. Then put it on external sdcard, insert it into your device and boot into stock recovery then choose the option that lets you install updates from sdcard and try flashing your modified update.zip file and reboot the device, if it works, it will enable USB debugging. The next obstacle is getting past your lock screen, which is pointless if the device reboots in seconds. If you can get it to stop rebooting, you might be able to use adb to unlock the lock screen by using adb commands that simulate the touch input required to unlock the screen. You'll have to do some searching to find out the "address" and order of each part of the screen that you need to simulate the touch input on the screen in the right order. It's a bit complicated for those that aren't familiar but it can be done if you do the research.
Or,you can try connecting a USB mouse to the device and see if it will let you open the lock screen.
Droidriven said:
Can you find a stock update for your specific model number in the form ol stock update.zip that can be flashed in your stock recovery like a OTA update? If so, you might be able to extract the build.prop file from the update then open the build.prop file in a note editor and edit the file by adding or editing lines that enable USB debugging. Then save the file. Then remove everything from the update.zip except for the Meta-inf or "updater script" file/folder then place your modified build.prop file in the update.zip so that it is the only thing in the zip other than the Meta-inf/updater script. Then put it on external sdcard, insert it into your device and boot into stock recovery then choose the option that lets you install updates from sdcard and try flashing your modified update.zip file and reboot the device, if it works, it will enable USB debugging. The next obstacle is getting past your lock screen, which is pointless if the device reboots in seconds. If you can get it to stop rebooting, you might be able to use adb to unlock the lock screen by using adb commands that simulate the touch input required to unlock the screen. You'll have to do some searching to find out the "address" and order of each part of the screen that you need to simulate the touch input on the screen in the right order. It's a bit complicated for those that aren't familiar but it can be done if you do the research.
Or,you can try connecting a USB mouse to the device and see if it will let you open the lock screen.
Click to expand...
Click to collapse
Droidriven said:
Can you find a stock update for your specific model number in the form ol stock update.zip that can be flashed in your stock recovery like a OTA update? If so, you might be able to extract the build.prop file from the update then open the build.prop file in a note editor and edit the file by adding or editing lines that enable USB debugging. Then save the file. Then remove everything from the update.zip except for the Meta-inf or "updater script" file/folder then place your modified build.prop file in the update.zip so that it is the only thing in the zip other than the Meta-inf/updater script. Then put it on external sdcard, insert it into your device and boot into stock recovery then choose the option that lets you install updates from sdcard and try flashing your modified update.zip file and reboot the device, if it works, it will enable USB debugging. The next obstacle is getting past your lock screen, which is pointless if the device reboots in seconds. If you can get it to stop rebooting, you might be able to use adb to unlock the lock screen by using adb commands that simulate the touch input required to unlock the screen. You'll have to do some searching to find out the "address" and order of each part of the screen that you need to simulate the touch input on the screen in the right order. It's a bit complicated for those that aren't familiar but it can be done if you do the research.
Or,you can try connecting a USB mouse to the device and see if it will let you open the lock screen.
Click to expand...
Click to collapse
The procedure looks good, I'd give it a try but is there any alternative to the SD card? Cause my phone has no SD slot available. Maybe an external usb card reader to plug into the phone?
Droidriven said:
Can you find a stock update for your specific model number in the form ol stock update.zip that can be flashed in your stock recovery like a OTA update? If so, you might be able to extract the build.prop file from the update then open the build.prop file in a note editor and edit the file by adding or editing lines that enable USB debugging. Then save the file. Then remove everything from the update.zip except for the Meta-inf or "updater script" file/folder then place your modified build.prop file in the update.zip so that it is the only thing in the zip other than the Meta-inf/updater script. Then put it on external sdcard, insert it into your device and boot into stock recovery then choose the option that lets you install updates from sdcard and try flashing your modified update.zip file and reboot the device, if it works, it will enable USB debugging. The next obstacle is getting past your lock screen, which is pointless if the device reboots in seconds. If you can get it to stop rebooting, you might be able to use adb to unlock the lock screen by using adb commands that simulate the touch input required to unlock the screen. You'll have to do some searching to find out the "address" and order of each part of the screen that you need to simulate the touch input on the screen in the right order. It's a bit complicated for those that aren't familiar but it can be done if you do the research.
Or,you can try connecting a USB mouse to the device and see if it will let you open the lock screen.
Click to expand...
Click to collapse
Plus, I don't really get why the system fails right after the lockscreen, I'm actually able to enter the code and the phone unlocks but the launcher seems not working, while the notifications bar works fine, and after some seconds the phone reboots. How can the system work fine in some aspects and bad in others at the same time? Can it be some flash memory issue?
Dona2592 said:
The procedure looks good, I'd give it a try but is there any alternative to the SD card? Cause my phone has no SD slot available. Maybe an external usb card reader to plug into the phone?
Click to expand...
Click to collapse
Yes USB should work in place of sdcard
Dona2592 said:
Plus, I don't really get why the system fails right after the lockscreen, I'm actually able to enter the code and the phone unlocks but the launcher seems not working, while the notifications bar works fine, and after some seconds the phone reboots. How can the system work fine in some aspects and bad in others at the same time? Can it be some flash memory issue?
Click to expand...
Click to collapse
That or kernel panic due to some other important hardware is damaged.
Maybe you can use a adb script to interrupt the running processes right after the device unlocks. Something to stop everything from loading beyond screen unlock. It might allow you to use adb to pull whatever you want from the device via adb pull commands.
Or, if there is a custom recovery for your device and if your bootloader is already unlocked(if it isn', don't unlock it, it will wipe your data), you can install the custom recovery and use it to create a backup of your data then extract your data from the backup.
Droidriven said:
That or kernel panic due to some other important hardware is damaged.
Maybe you can use a adb script to interrupt the running processes right after the device unlocks. Something to stop everything from loading beyond screen unlock. It might allow you to use adb to pull whatever you want from the device via adb pull commands.
Or, if there is a custom recovery for your device and if your bootloader is already unlocked(if it isn', don't unlock it, it will wipe your data), you can install the custom recovery and use it to create a backup of your data then extract your data from the backup.
Click to expand...
Click to collapse
Unfortunately I still have the stock recovery. Plus USB debug is deactivated. What really boggles me is the fact that I can still enter settings and get to developer options, turn ON the toggle of USB debug, but it's like the phone doesn't save the setting, cause if I go back to the main setting screen and enter again developer options, USB debug is OFF. I mean, what the hell?
Having access to device's Stock Recovery you can try as shown below to enable ADB / USB Debug ging: yes you can run Android shell commands from within Android's Stock Recovery.
Unplug device's USB-connection , boot into recovery mode. Having successfully booted into recovery mode, connect device via USB-cable with computer - what switches the USB driver to ADB mode.
Now enable USB debugging via recovery:
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=adb,mtp" >> /system/build.prop"
reboot
Dona2592 said:
Unfortunately I still have the stock recovery. Plus USB debug is deactivated. What really boggles me is the fact that I can still enter settings and get to developer options, turn ON the toggle of USB debug, but it's like the phone doesn't save the setting, cause if I go back to the main setting screen and enter again developer options, USB debug is OFF. I mean, what the hell?
Click to expand...
Click to collapse
Hardware damaged. You're going to have to repair the hardware or forget about retrieving your data, unless you can find a reputable shop that has the equipment and experience to pull your data directly from the chip itself.
xXx yYy said:
Having access to device's Stock Recovery you can try as shown below to enable ADB / USB Debug ging: yes you can run Android shell commands from within Android's Stock Recovery.
Unplug device's USB-connection , boot into recovery mode. Having successfully booted into recovery mode, connect device via USB-cable with computer - what switches the USB driver to ADB mode.
Now enable USB debugging via recovery:
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=adb,mtp" >> /system/build.prop"
reboot
Click to expand...
Click to collapse
Thanks mate, I'll give it a try for sure
Droidriven said:
Hardware damaged. You're going to have to repair the hardware or forget about retrieving your data, unless you can find a reputable shop that has the equipment and experience to pull your data directly from the chip itself.
Click to expand...
Click to collapse
Ok, but do you know what could be the damaged piece of hardware?
Dona2592 said:
Ok, but do you know what could be the damaged piece of hardware?
Click to expand...
Click to collapse
NO
xXx yYy said:
Having access to device's Stock Recovery you can try as shown below to enable ADB / USB Debug ging: yes you can run Android shell commands from within Android's Stock Recovery.
Unplug device's USB-connection , boot into recovery mode. Having successfully booted into recovery mode, connect device via USB-cable with computer - what switches the USB driver to ADB mode.
Now enable USB debugging via recovery:
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=adb,mtp" >> /system/build.prop"
reboot
Click to expand...
Click to collapse
That might work but I've never had any luck with adb in stock recovery, not on the devices that I've owned, at least.
Dona2592 said:
Hello everyone,
my phone (Xiaomi MI 9T) has fallen in the water and now it's partially working.
I really need to recover some data from it, but any method I've found on the internet requires USB Debug active. The phone turns on but it works only as long as it stays on the lock screen or if I go to settings from the notification bar. If I unlock it, the launcher doesn't work (but I can still drag down the notification's bar) and after few seconds the phone reboots I'm also able to activate the toggle of the USB Debug but it looks like it doesn't stay active because if I go back and re-enter developer's section, USB Debug is OFF.
At this point I don't really know what to do. The phone enters fastboot and recovery mode, unfortunately everything is stock, so my possibilities are limited.
I haven't tried to change the screen, but I doubt that would solve the problem, since if I stay in those specific areas, it works fine.
Android version: 10
MIUI 12
Thank you
Click to expand...
Click to collapse
Is your bootloader locked?
Droidriven said:
That might work but I've never had any luck with adb in stock recovery, not on the devices that I've owned, at least.
Click to expand...
Click to collapse
Yeah in fact when I type "adb shell" it gives me error, but I can enter fastboot mode and the phone is seen. Unfortunately I can't do much from there
Arealhooman said:
Is your bootloader locked?
Click to expand...
Click to collapse
Yeah. **** me, for once I kept everything stock and this happened . I've always rooted and customized my phones and nothing like this has ever happened.

Categories

Resources