How to make `adb reboot` work like `/system/bin/reboot`? I have a problem with my device. When I do adb reboot then it stuck on boot in a loop.

But, when I do adb shell and then reboot, it works fine.

I searched over the internet and understand that both have different behavior:


adb reboot works like you plug the phone battery out. Means, it will not close any application, not show any pretty Restarting splash screen.
adb shell reboot uses /system/bin/reboot executable and it does a soft reboot with closing opened application, showing the splash screen, etc..


To verify that adb shell reboot execute /system/bin/reboot, I have moved the /system/bin/reboot to another place and as expected the reboot command not working anymore so I put it back after confirmation.

I want adb reboot to use /system/bin/reboot executable.

I want to do it from within the Android device that makes it a general solution for all users of the device. I know I can execute adb shell reboot but other users will not do this. 

Is there any way of doing this?
Write a script in your PC, look for 'reboot' argument, and execute your own command instead.

I do not know how a Window's compatible script would look like, but this is how a simple bash script would look like.


#!/bin/bash
ADB="PATH_TO_RENAMED_ADB_BINARY"

if [[ "$1" == "reboot" ]] && [[ -z ${2} ]]; then         # $1 is the first argument received by adb
    "$ADB" shell '/system/bin/reboot'    
else
    "$ADB" "$@"                            # $@ contains all the arguments received by adb
fi


Save the script as adb, give executable permission to it, rename adb binary with the name adb_orig, and then save this script as adb where adb is originally located.