Android device disconnects seconds after opening

There is a notification on the phone that UIAutomator needs to be kept running.

I authorized some permissions now I cannot open the device. The status is Unauthorized

Check the USB debugging on your device, worst case just unplug your device and replug it.
Keep in mind that it will always bee unauthorized so long as developer mode is not active.