As in title: How can I turn off an Android phone in the same Ethernet remotely using a Windows computer?
They are in the same Local Area Network and connected to the same router, the Android phone is connected to the router via WiFi and the Windows computer is connected to the router via a cable.
I have tried numerous times to get a solution using Google search with different keywords, and objectively Google isn't very competent in understanding complex sentences and I can't get what I am looking for, see for yourself what the results Google gave: Google: How can I turn off an Android phone in the same Ethernet remotely using a Windows computer?, most of the results are exactly the opposite of what I intended to achieve.
I want to connect to the phone wirelessly and send commands through WiFi.
I figure I need to use either Telnet or SSH to do this, log into the Android device remotely and use Android terminal commands to shutdown the phone.
Unfortunately I have tried telnet and here is the result:
C:\Windows\System32>telnet 192.168.1.3
Connecting To 192.168.1.3...Could not open connection to the host, on port 23: Connect failed
I know what this means, this is because telnet port is not open and the telnet server isn't online on the Android phone by default.
So naturally I need to install some application on the Android phone that runs the telnet/SSH server and opens the telnet/SSH port, and setup a login and password, so I can connect to the phone remotely and it has to somehow execute the commands.
The phone isn't rooted, but I have Android Studio and the phone does have USB Debugging, what tweaks do I need to make in order to enable remote logging?
And I don't know how to use Android terminal, is there even a command line interface shell on Android? I don't have any experience with this, however from what I have learned Android is based on Linux and I have some experience in Ubuntu 20.04 LTS WSL, I know I can use these commands:
sudo power off
shutdown -h now
Android must use something similar.
How can I achieve this?
The suggested duplicate: How can I shutdown my Android phone using an adb command? doesn't answer my question because it shuts down the phone through USB while I have explicitly stated in my question that I want to shutdown the phone wirelessly through WiFi connection.
adb shell reboot -p