Any way to reboot a iDevice that is connected to a USB port via terminal (Mac terminal)? So, I am making a program to reboot iDevices (if there power buttons are broken), is there any way to induce the iDevice to reboot via the Mac shell?
idevicediagnostics is a Linux tool which can help here. It is also available for macOS according to these instructions.

Once installed you can use

idevicediagnostics restart


to restart your device.

To Restart the iOS devices connected more than one devices by 

idevicediagnostics -u udidnumber restart