For anyone else who’s wondering, I figured it out. You simply have to disconnect the phone from your device first.
For example, if it’s plugged into your PC for USB Debugging, simply unplug your phone before closing Android Studio.
Or if you’re using Wireless Debugging, disconnect from your phone (or simply turn off Wireless Debugging) before closing Android Studio.
solved How do I keep Android Studio from stopping my app when I close Android Studio?