my issue is pretty much in the title.
I have been trying to remove the FRP of a samsung Flip 3.
I set up ADB, downloaded the CLI tools with the right version. (I am not using Android Studio)
Can anyone help
Thank you in advance :))
When I try to execute any command in the ADB CLI it returns error: closed .
This happened when I tried to execute these commands:
adb shell am start -n com.google.android.gsf.login/
adb shell am start -n com.google.android.gsf.login.LoginActivity
adb shell content insert --uri content://settings/secure --bind
It happens with pretty much every command that I tried. I think it's due to the "sideload" mode of the phone when I execute adb devices .
I overall need any way of removing the FRP, maybe my best shot would be if I could enable USB Debugging from the recovery screen.
Related
I have some old shell scripts that needs to be executed on an android device but the command to fetch the total cpu, memory and swap usage is top. More specific it is:
top -m 1 -d 1.0 -n $duration
Now I have been looking to find a replacement for this and I found out that I can use dumpsys. The problem what I have is that I want to give a timeout like this:
dumpsys -t 20 cpuinfo
I checked this site: https://developer.android.com/studio/command-line/dumpsys.html but didn't find out why this doesn't work. Even when I try the help I get the same error
dumpsys --help
Can't find the service: --help
Does someone know what is going on? My current android version is 6.0.1 if this is important.
Thanks in advance!
It is true that dumpsys --help does not work. I think there is a mistake in their document. However, below works:
# adb shell dumpsys input
# adb shell dumpsys -l
Add permission on your manifest "android.permission.DUMP".or
There's another (hacky) way to access dumpsys without rooting your device - through adb shell.
This will require allowing USB debugging, and finding the port of the adb service.
Enable USB debugging on your device. This option is found under Settings -> Developer Options.
Connect your device to a PC, and run the following command from the PC's shell/command line: adb tcpip 12345. Then, from your devices shell, issue the command adb connect localhost:12345 from your application. You can now disconnect the device from USB. Alternatively, you can scan the ports on your device one by one without USB connection, using adb connect localhost: and find the port adb service is listening to.
Authorize USB debugging from the pop up confirmation dialog, if prompted. Check the "always" checkbox to do not require this step again.
Now, when you have access to the adb service, use adb shell dumpsys ... from your application code to get whatever service dump you need.
I keep having an issue with the Android Studio ADB not recognizing my devices. So far, the only solution I've found is to do a complete reboot of my entire computer, which isn't practical. I'd like to be able to restart the ADB from terminal, because I have seen other posts on here that claim it will fix the issue. However, I can't figure out where to use the commands "adb kill-server", because doing it at the base directory returns a "command not recognized". Can somebody help me figure out how to navigate into Android from terminal and use the command? Or, does anybody have another solution to the original problem of Android Studio not recognizing my devices?
Thanks in advance! Sorry for the wordiness.
blackbelt:~ blackbelt$ adb kill-server
blackbelt:~ blackbelt$ adb start-server
works on Linux as well as on Mac. In my machine, adb is in PATH
"command not recognized". Can somebody help me figure out how to
navigate into Android from terminal and use the command? Or, does
anybody have another solution to the original problem of Android
Studio not recognizing my devices?
In your case adb is not declared in PATH. You can either export the PATH, or specify the full qualified path to adb in the command line. E.g.
blackbelt:~ blackbelt$ /path/to/platform-tools/adb kill-server
blackbelt:~ blackbelt$ /path/to/platform-tools/adb start-server
or
blackbelt:~ blackbelt$ ./adb kill-server
blackbelt:~ blackbelt$ ./adb start-server
if you are inside platform-tools
Well instead of doing it through command line, if you find that hard you can also do the same from android studio.
Go to tools -> Android -> Android device monitor . Then it will open the separate window where you can see all the devices or emulator attached to the process. On the left hand side below the Devices tab there will be and menu bar, you need to click on the drop down arrow which will give you the option to reset the adb. Here is the image for reference
If you are using windows try to update the device driver for your device make sure the adb is correctly installed. When you connect your device to system see if it is allowed to be used at the system.
if adb kill-server not responding. Find the process id (PID) by typing top in terminal and finding PID next to adb. Then type kill <PID>
For example, for me PID for adb was 70163. Then i typed kill 70163
Simply stop adb:
adb kill-server
Then you can start it again any time:
adb start-server
This is my first post here, so first of all, hello everybody!
I am not sure if it is bug or a feature:) but I have noticed that when you will run adb install with no device connected, it firstly starts adb daemon (if was not currently running), and then wait for the device. After that, when you open new window and run adb kill-server, adb install command will not stop, but shows protocol fault and then restart adb daemon again.
There is no other way of stopping this, than killing the process (for example using ctrl+c).
Screenshot
I have also noticed that other commands like adb shell, adb devices, adb wait-for-device doesn't act like adb install - stop when adb kill-server will be lunched.
My version of ADB is 1.0.31
I have tested this issue on Linux and Windows, and both works the same.
Please let me know, what do you think about it.
Best Regards,
Pawel
Regarding this post: adb shell auto-complete under Windows 7?
The owner's answer is: "Solved this problem by recompiling adb under cygwin. :)"
Unfortunately I can't send comments asking him how did he recompiled the adb under cygwin.
So my question is: How could I recompile adb under cygwin to get auto-compete working in adb?
EDIT: I realized that actually cygwin is already auto-completing when I type inside android bash, but the text is not being showed. Weird, isn't? E.g:
# ls /data/tem
[TAB]
# ls/data/tem | <<<--- the cursor jumps to here
[ENTER]
It list all files and folders within /data/temp folder.
You can use ADB enhanced Putty
It support auto complete and coloring
you can download it from
ADB Putty
Just start it suing the following command-line:
adb-putty.exe -adb -P 5037 transport-usb
read more at ADB enhanced Putty (replacement for "adb shell" command)
Try PuTTY Tray. Its work for me!
connect to the phone via "adb connect ip:port"
run Putty Tray, select Adb and click "Open"
PS.
You can specify device ID in session settings.
I'm (fortunately) not a Windows user but I guess the problem is not in adb but in your shell that is not letting some keys (i.e. TAB) reach it.
Try this to see if TAB is received by the android shell:
adb shell
# printf '%d\n' "'$(dd bs=1 count=1 2>/dev/null)"
<type TAB+ENTER>
9
If you cannot see 9 (ascii TAB) then your problem is in the Windows shell and you could try cygwin bash to reproduce the test and see the results.
Are you mis-understanding the original post? I think that guy is saying he stopped using the Command Prompt and switched to cygwin.
You can make auto complete work in the Windows command prompt as well. Just run cmd /f instead of cmd. The other post has instructions on how to permanently enable autocomplete.
If you want to use cygwin then focus on trying to get autocomplete to work in cygwin. It's been years since I used cygwin, but I thought it was enabled by default. Maybe you need to turn off case sensitivity? How to deactivate uppercase check in cygwin folder autocompletion?
Regardless which shell you use it will only auto complete folder and file names.
I would like to crash my Android app by using command-line ADB tool during my app is running, is it possible to do? and how ?
(Basically, I want to test if my app persist the necessary informations when it is crashed. So, I would like to demo this by crash my app by some command-line tool, like ADB.)
***** Update ********
In other words, how to kill my app process by using ADB tool?
kill probably won't work.
adb shell am force-stop <your.app.package>
adb shell kill <PID>
Try the below command in abd shell.
You can kill your app from the shell:
adb -s YOURDEVICEID shell
top // find your app pid
kill -p YOUR_APP_PID
I can easily kill my app from Eclipse DDMS. Just stop the process , e.g. stop "com.my.app"
You can actually trigger a crash via the "crash" param to adb shell am
adb shell am crash <package name>
This is an obscure option but can be confirmed when emulator is running via: adb shell am help
Details: reference
crash [--user <USER_ID>] <PACKAGE|PID>
Induce a VM crash in the specified package or process
Wish this was easier to find I cannot find the original source where I found it but should be more obviously listed on docs page vs only shown when connected am help menu...
https://developer.android.com/studio/command-line/adb#am
App crashing at runtime is nothing but an Occurance of Exception, The place after which you want to crash your app, write a logic which causes for an Exception.
The best way to crash your app is to add an Exception to your package.
Like division by 0 - add it to your app code.
I don't know if you've got the answer yet. The answer is pretty much the same as #bas but instead of using , you need to you the package name
adb shell am force-stop <package name>
you can get the package name by using this command
adb shell pm list package -3
-3 means all 3rd party apps that are installed in device.