The setprop service.adb.tcp.port 5555
worked on my non-rooted device, now I need to restart adbd
as the shell
user :
$ adb shell
shell@android:/ $ getprop ro.build.version.release
4.1.2
shell@android:/ $ getprop service.adb.tcp.port
shell@android:/ $ setprop service.adb.tcp.port 5555
shell@android:/ $ getprop service.adb.tcp.port
5555
I tried this to restart adbd
, but the PID of adbd
didn't change :
shell@android:/ $ ps -C adbd
USER PID PPID VSIZE RSS WCHAN PC NAME
shell 161 1 4724 308 ffffffff 00000000 S /sbin/adbd
shell@android:/ $ stop adbd
shell@android:/ $ start adbd
shell@android:/ $ ps -C adbd
USER PID PPID VSIZE RSS WCHAN PC NAME
shell 161 1 4724 308 ffffffff 00000000 S /sbin/adbd
shell@android:/ $ exit
$ adb connect 192.168.2.27
failed to connect to '192.168.2.27:5555': Connection refused
Then I sent a SIGHUP
to try and trigger a adbd
restart, but all it did was to kill adbd
and now I cannot connect via USB anymore :
shell@android:/ $ kill -SIGHUP 161
$ adb shell
error: device offline
So now I HAVE to reboot in order start adbd
which I've accidentally killed.
After reboot I also tried setprop ctl.restart adbd
but it didn't work :
shell@android:/ $ ps -C adbd
USER PID PPID VSIZE RSS WCHAN PC NAME
shell 176 1 4720 300 ffffffff 00000000 S /sbin/adbd
shell@android:/ $ getprop ctl.restart
shell@android:/ $ setprop ctl.restart adbd
shell@android:/ $ getprop ctl.restart
shell@android:/ $ ps -C adbd
USER PID PPID VSIZE RSS WCHAN PC NAME
shell 176 1 4720 300 ffffffff 00000000 S /sbin/adbd
shell@android:/ $
Can you help me restart adbd
on my non-rooted device without reboot ?
USB Debugging
in Developer Options. – Irfan Latif Dec 10 '19 at 14:36settings put global adb_enabled 0
andsettings put global adb_enabled 1
.setprop ctl.restart adbd
should also work. Tag shows you are on JB where SELinux should not be a problem. – Irfan Latif Dec 10 '19 at 15:32settings put global adb_enabled 0
command got me disconnect before the nextsettings put global adb_enabled 1
command got executed – SebMa Dec 10 '19 at 16:31