Trying to disable guest user using adb - OnePlus 6 Questions & Answers

I'm trying to disable the guest user on my phone, running android 10 and non rooted, using adb. I have been attempting this by using the command: adb shell settings put global guest_user_enabled 0. However when I type it in nothing happens. Adb does pick up my device and once entering the command, I get no message or any sort of output.

Related

[Q] LG Thrill 4G new ROM Help

I have a LG Thrill 4G. I rooted the phone using superonelick, root checker says it is rooted. Downloaded ROM Manger and flashed clockworkmod. I cannot click boot into recovery, it just restarts the phone. I have tried to reboot into recovery by pressing 3d button, down volume, and power and it boots me into the android recovery but not clockworkmod, so I can not find anyway in to download the new rom from the zip file. Has had any other people had trouble with this? I have spent over 2 days searching the internet but I cannot find any similar problems, is there anyway to get into the recovery mode to install the new ROM without it just restarting the phone?
LG Thrill 4G ClockworkMod Installation (correct method)
1) You need to have ROOT access at the least (see link below)
It will also be good to have ADB (and hence LG Thrill drivers) installed properly
http://forum.pandaapp.com/thread/2/11/20110919/4e77f603d22632913-1.html
2) Get the recovery image from here and keep it on your PC in a folder accessible by ADB.
OR (if no ADB then) directly put it on your LG Thrill SDCard root
http://forum.xda-developers.com/showthread.php?t=1257588
4) If you have ADB then follow the instructions in the first link above to push the recovery image to your phone.
OR
if no ADB then open Terminal Emulator (install it from Market) and type su and click allow if the prompt comes up
5) Now you can follow instructions in the first link (far above) again, starting from the 'dd if=...' step. But instead of rebooting you could just power off
6) Clockwork recovery should now be flashed. To enter recovery, keep the 3D button, Vol-down and Power button pressed until you see the LG logo
Thank you for getting back with me. I tried to follow these steps and when I am in the Terminal Emulator and type adb push recovery.img /data it comes back with adb: not found. I have redownloaded the recovery file that you have attached to the SD card, same error, and then I tried to copy to the phone itself and same error. I can do any of the other prompts for the emulator but nothing that has to do with the recovery file it will not work. I am guessing maybe this is the problem because if it cannot find the recovery file, I cant do much of anything else. Do you have any suggestions of why the file still cannot be found on my phone?
connect adb through tcp
Try this:
1. If you are using terminal emulator to access adb then try downloading the app called remote adb. This tool will allow you to connect your device via tcp. Take note of the ip adress and port number. Usually the default port is fine.
2. Now open sshdroid, connectbot, terminal emulator and start an ssh session with the adb shell. You must have the correct public ip and port entered in to access the adb via tcp.
3. Once you have made the ssh connection between what ever emulator you are using and remote adb, start a shell as su.
4. Type the commands mentioned earlier.
This should let you run the whole thing from within your phone.
Alternatively...
1. start remote adb on your device.
2. start a terminal or cmd prompt on your cpu.
3. cd to androidSDK\platform-tools
4. type ---> adb start-server
The server then sets up connections to all running emulator/device instances. It locates emulator/device instances by scanning odd-numbered ports in the range 5555 to 5585, the range used by emulators/devices. Where the server finds an adb daemon, it sets up a connection to that port.
Note that each emulator/device instance acquires a pair of sequential ports — an even-numbered port for console connections and an odd-numbered port for adb connections. For example:
Emulator 1, console: 5554
Emulator 1, adb: 5555
Emulator 2, console: 5556
Emulator 2, adb: 5557 ...
As shown, the emulator instance connected to adb on port 5555 is the same as the instance whose console listens on port 5554.
Once the server has set up connections to all emulator instances, you can use adb commands to control and access those instances. Because the server manages connections to emulator/device instances and handles commands from multiple adb clients, you can control any emulator/device instance from any client (or from a script).
5. type --> adb forward tcp:5554 tcp:5555
5. type ---> adb devices. In response, adb prints this status information for your device. If there is no emulator/device running, adb returns no device, and you have not made a tcp connection.
6. Take note of the serial number listed. You will use it later to direct commands to device.
7. Type --> adb shell
8. Type --> su
9. Use commands from other post to achieve whatever you need.
10. once finished with shell, type --> exit twice to leave the shell
11. Finally, type --> adb server-kill
Hope that helps. Seems like you were having issues making the connection from device to adb, so that is what I focused on. If I can help anymore, just ask. We are all continually learning and the only stupid question is the one never asked.
B^)

execute "adb tcpip <port_no>" command without using usb

NON ROOTED PHONE
I am trying to create to backup of all application in android but I don't want the users to connect to USB even for the first time.
okay let me first explain what happens when we connect our phone with USB to ADB client
0. USB Debugging mode is enabled in the phone.
1. The phone is connected to PC using a USB cord.
2. We run
Code:
adb tcpip 9999
command from cmd with ADB already installed.
The above command helps now switched the abd demon (adbd) inside the android phone to listen through TCP-IP protocol
3. now we can disconnect the phone from the PC
4. using a terminal emulator application we can now fire the commands
a)
Code:
adb connect localhost:999
b)
Code:
backup -all -f /sdcard/dev/bck.ab
now a backup pop-up will open up, you can simply click backup button.
Now we can anytime execute the command in 4.a and 4.b util the user restarts the phone or
but the problem is I wish to execute
Code:
adb tcpip 9999
without PC. Can someone suggest me how to approach this problem. From where should I start reading or there is some existing application that can do this on a non-root phone.

ADB Backup doesn't work

I'm using GM1917 with Renovate ICE and am unable to perform an ADB backup.
When I run the command on my computer, it prompts me to unlock my phone and confirm the back up, but nothing pops up on my phone. I'm thinking that I may have disabled something that does this in the OP7, but I have no clue what it would be. Any advice?
Have you enabled USB DEBUG?
What command are you running exactly
For anyone running into this, I got it to work by running the command
Code:
adb backup "-apk -shared -all -f backup.adb"
The quotation marks actually make a difference here. Leaving off quotations makes it so the app doesn't open.

Is it possible to do adb operations from android phone itself, without a computer?

I have seen discussions online such as this:
https://stackoverflow.com/questions/12634280/what-is-a-adb-daemon
If I understand the answers give there correctly, whenever I use an adb command on my computer connected to a smartphone, the reason it does anything is because there is a background process adbd, the adb daemon, running on the smartphone. Everything I see on the computer screen when I issue an adb command is the result returned by the adbd daemon.
a) Is this correct? Is this how adb is supposed to work?
b) If it is correct, is there any way to programmatically enable/disable/re-enable the adbd process? Can I programmatically interact with adbd at all (either through Java or NDK)? Can I use adbd from the android phone itself and perform actions performed using adb, without using a computer?
I am hoping to do this on a non rooted device, but if not, any kind of device will do.
mahaju said:
I have seen discussions online such as this:
https://stackoverflow.com/questions/12634280/what-is-a-adb-daemon
If I understand the answers give there correctly, whenever I use an adb command on my computer connected to a smartphone, the reason it does anything is because there is a background process adbd, the adb daemon, running on the smartphone. Everything I see on the computer screen when I issue an adb command is the result returned by the adbd daemon.
a) Is this correct? Is this how adb is supposed to work?
b) If it is correct, is there any way to programmatically enable/disable/re-enable the adbd process? Can I programmatically interact with adbd at all (either through Java or NDK)? Can I use adbd from the android phone itself and perform actions performed using adb, without using a computer?
I am hoping to do this on a non rooted device, but if not, any kind of device will do.
Click to expand...
Click to collapse
Yes, but it requires having a rooted device and the terminal emulator app. Or you can install TWRP and use the terminal emulator that is built into TWRP.
Sent from my SM-S767VL using Tapatalk
reply to answer
Droidriven said:
Yes, but it requires having a rooted device and the terminal emulator app. Or you can install TWRP and use the terminal emulator that is built into TWRP.
Sent from my SM-S767VL using Tapatalk
Click to expand...
Click to collapse
I have an old rooted samsung phone with android 4.2.2
Is there any sample code on how I can interact with the adbd daemon? In the terminal emulator if I type "adb shell" it says starting daemon but then it says device not found. how would I do some basic stuff (like take a screen shot using "adb shell screencap" for example? Can I interact with it programmatically from java or ndk?
mahaju said:
I have an old rooted samsung phone with android 4.2.2
Is there any sample code on how I can interact with the adbd daemon? In the terminal emulator if I type "adb shell" it says starting daemon but then it says device not found. how would I do some basic stuff (like take a screen shot using "adb shell screencap" for example? Can I interact with it programmatically from java or ndk?
Click to expand...
Click to collapse
When using terminal emulator, it uses the same commands as adb shell(not the standard adb), but you remove "adb shell" from the commands. For example, in terminal emulator, it is:
reboot recovery
Instead of:
adb reboot recovery
Or
adb shell reboot recovery
Also, before running your commands in terminal emulator, you need to use the su command by typing:
su (then press enter, grant the app superuser/root permissions)
Then you can run the rest of your commands.
Sent from my SM-S767VL using Tapatalk

[Closed] Stuck in login-loop, trying to install com.android.settings via ADB

Background:
On a Nokia G10 I have been using ADB to uninstall unwanted apps to make the phone child-safe, without root being required. I followed steps here using the command:
Code:
.\adb shell pm uninstall -k --user 0 <package_name>
and can reinstall any app using:
Code:
.\adb shell pm install-existing <package_name>
This has been very successful and I have been able to uninstall and reinstall many apps as needed. The final step I took was uninstalling the settings app (com.android.settings) to prevent the user from just enabling the play store and downloading everything again. Whenever I needed to update/change anything, I would connect via ADB and reinstall the settings app and do what I needed to do.
This has been working well for months, no problems, a very elegant and airtight solution.
Problem:
Today I restarted the phone and it got stuck in a loop at the lock screen. Not a boot loop.
It turns on, and loads the lock screen up, then there's about half a second before it freezes, the lock screen crashes (goes black for a second) and the reloads the lock screen.
During that half second I can interact with the screen normally (e.g. swipe down the notifications/settings menu at the top, or open the power options menu) but then it crashes and reloads the lock screen.
Aim:
I need to reinstall com.android.settings . I know this will fix the loop because I encountered this error while setting up the system earlier. However, I was already connected via ADB at that time and could just run the command to reinstall the settings app. This stopped it crashing, it loaded normally and I could login immediately.
But now I cannot connect via ADB for some reason. Running these commands gives the following errors:
Code:
.\adb shell pm install-existing com.android.settings adb.exe: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
.\adb devices
List of devices attached
PT996******************* unauthorized
I have tried the following with no success:
1)
Code:
adb kill-server
adb start-server
2) Starting in safe mode gives the same problem
3) Ideas listed here: https://stackoverflow.com/questions/23081263/adb-android-device-unauthorized/25546300#25546300
I don't get a new prompt to allow access.
4) Trying to start in FASTBOOT mode... I'm not sure I'm doing it right. Holding down the power and -vol key the screen displays "FASTBOOT mode..." but does not progress to a menu screen.
What I need:
A way to install com.android.settings, or, a way to get ADB access.
Any suggestions welcome
Thanks
Some progress trying FASTBOOT:
Using this guide: https://forum.xda-developers.com/t/how-to-enter-recovery-mode-on-nokia-g10-g20.4353903/
I have been able to boot into recovery mode.
Does anyone know how I can use the option "Apply update from ADB" to issue ADB commands like this?
Code:
.\adb shell pm install-existing com.android.settings
According to this thread: https://android.stackexchange.com/questions/94126/adb-shell-in-recovery-mode-errorclosed
adb shell is inaccessible with stock recovery.
Using FASTBOOT in the Windows powershell terminal, can I issue any similar command to install an existing package?
or, can I use adb sideload to reinstall com.android.settings?
as adb is unauthorized you simply have no adb access anymore. if you are using the same PC then RSA key is lost (otherwise check the previously known working PC and copy .android directory to current PC)
fastboot is unrelated to adb and of no use at all.

Categories

Resources