Restart adbd as shell user on a non-rooted device without rebooting after the "setprop" operation 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 ?
In the specific context of setting the adb tcp/ip port, the adb tcpip 5555 command does restart the adbd service.

As one can see the PID of adbd is changed after the adb tcpip command :

$ adb shell ps | egrep -w "adbd|PID"
USER     PID   PPID  VSIZE  RSS     WCHAN    PC         NAME
shell     3675  1     4720   300   ffffffff 00000000 S /sbin/adbd
$ adb tcpip 5555
restarting in TCP mode port: 5555
$ adb shell ps | egrep -w "adbd|PID"
USER     PID   PPID  VSIZE  RSS     WCHAN    PC         NAME
shell     3800  1     4720   300   ffffffff 00000000 S /sbin/adbd