MacBook Pro Retina (2015) only stays on with power key held down
My MacBook Pro Retina 2015 won’t stay on unless I hold down the power key and keep it held down for the entire time I’m using it.


Unfortunately, this is a hardware issue and not a software one.  This is very similar to the question/answer:  Keyboard key stuck or not being recognized; how to fix  but different in that we're dealing with the power button and not an individual key.

The keyboard is connected via USB and the power button functions through the USB as well.  If you disassemble your MBP and remove the top case assembly, you'll find there's only one cable connecting it to the logic board and that cable is a USB cable.

More than likely, it's a short and not a dirty contact because the power button isn't a latching switch; it's a momentary switch like your keyboard keys.  If the contact were dirty, you wouldn't be able to turn it on.  In this case, you can turn it on but you have to hold it because there's a short in the circuit somewhere.  How do we know this?


  The only clue I have is a very brief “Do you want to shut down/sleep” dialog that popped up once before the random shutdown but hasn’t since.


That pop up happens when you press the power button.  Thing is, it's happening too fast and acting like you're holding the power button for the "5 second power off no matter what." 

We also know it's not a software issue because it happens from a powered off state.  The OS is not in the picture during the pre-boot process.