I am trying to monitor some commands in my adb shell and I could go watch adb shell <command> but the extra time to have to connect up to the shell is killing me.
Does the Android adb shell have its own version of watch so I can monitor some commands
while true; do <command>; sleep 2; done
Related
Not a duplicate question or at least I couldn't find anything about this
So I've been getting into ADB and the ADB shell but I don't always have access to a PC so I got a terminal emulator from the play store and some commands don't work via ADB shell
Example: dumpsys battery
Output: can't find service: battery
The command works in ADB shell but not in their terminal emulator. Other dumpsys services work
Why is this?
I need to take the native dump of the android process.
The cmd I am using is:
adb shell am dumpheap -n <pid> /data/local/tmp/dump.txt
The device is S8, Oreo OS.
Everytime I run this cmd, the 'dump.txt' is generated with the following content:
Native heap dump not available. To enable, run these commands
(requires root):$ adb shell setprop libc.debug.malloc 1 $ adb shell
stop $ adb shell start
Though I am doing it says and the phone is also rooted but it still gives the same content.
I am stuck. Any help would be appreciated.
In an effort to test doze and standby mode im trying to change the battery level and also the set to ac etc using adb and a api 23 emulator.
But when i run the following bash command:
adb shell dumpsys battery set level [95]
i get the following error:
Bad value: [95]
also when i run :
adb shell dumpsys battery set [ac]
i get the following error:
Dump current battery state, or:
set [ac|usb|wireless|status|level|invalid] <value>
unplug
reset
i am assuming meaning it could not find the ac command. How can i change the emulator to ac and also update the battery level ?
update: there is a command adb shell dumpsys battery unplug
to unplug the emulator so should there not be a command to plug it in for AC power ?
there is a command adb shell dumpsys battery unplug to unplug the
emulator so should there not be a command to plug it in for AC power ?
Yes, the command is:
adb shell dumpsys battery set ac 1
To change the level of the battery you can use this command:
adb shell dumpsys battery set level 42
If you'd like to test Doze, I recommend trying the commands directly from the Developer Site here.
The commands to cycle through Doze modes are as follows:
$ adb shell dumpsys battery unplug
$ adb shell dumpsys deviceidle step
$ adb shell dumpsys deviceidle -h
And for testing App Standby:
To force your app into App Standby mode:
$ adb shell dumpsys battery unplug
$ adb shell am set-inactive <packageName> true
To simulate waking your app:
$ adb shell am set-inactive <packageName> false
$ adb shell am get-inactive <packageName>
I have connected an android device over tcpip using adb connect <ipaddress>. I am able perfrom all operations of adb on this devices.
However when I issues a command adb -s <ip>:5555 reboot, I see that prompt simply hangs and reboot is not being performed on the devices.
Is this a known limitation of adb over tcpip?
Are there any other ways to issue reboot commands in such cases?
Thanks in advance
Command adb -s :5555 reboot is incorrect, adb -s <IP Address>:<5555> reboot is correct.
If your device IP is 172.16.7.123, use the following.
$ adb connect 172.16.7.123
Lets say your list of devices show the following
$ adb devices
List of devices attached
172.16.7.123:5555 device
0554e0700a67240d device
The correct way to reboot the device using adb is
$ adb -s 172.16.7.123:5555 reboot
After issuing the above command, your prompt will hang since the adbd daemon is killed on the device.
To return it to normal, use adb disconnect 172.16.7.123 on another prompt and it will return to normal.
Does anyone know the command to hot reboot that you would use in the terminal emeulator? Would it be a command similar to the the normal reboot commands. If anyone could help thankx.
Probably depends on what do you mean by hot.
Anyway, you can use:
$ adb -s <SERIALNO> reboot
or
$ adb -s <SERIALNO> shell 'stop; sleep 5; start'