S4 (i9500 or i9505) won’t turn on unless you insert the battery, then it starts booting but shuts off after two seconds? Apparently, this is fairly common on the S3 and S4.

Symptoms

Did your Samsung Galaxy S4 or S3 turned off randomly and then any attempt to turn it back on via the power button is unresponsive? 
Did you try taking out the battery and replacing it, the device vibrates with the Galaxy S4 logo showing up for about a couple seconds, then the screen goes blank again.
Did you try another battery?

Cause

Your power button is stuck. So when you remove and replace the battery, the power button is already pressed in causing your phone to turn on by itself.

Then because the power button is still pressed in, the phone then turns off after a couple of seconds. You normally cannot get into recovery or download mode as the phone shuts down before being able to enter any of the other modes.

Possible Solutions

I’d suggest trying each in succession until your phone power switch is responding once again as normal.

The following do not require stripping

  • Hold the phone sideways with the power button facing down, now lightly tap it on a slightly soft surface and then test to see if the button comes unstuck. This gentle persuasion can be repeated without harm to your phone
  • You can also try flicking the power switch with your thumb

Going further will require stripping your phone and you do so at your own risk

  • Try blow out the power button with compressed air, make sure the lines are free of water
  • Clean the power button with pure isopropyl alcohol, preferably dip a q-tip in alcohol and then press the button in a number of times – make sure to allow the board to dry completely before putting the battery back in
  • Try just heat the power button’s joints with a soldering iron
  • Replace the switch – you’ll need some skills and another switch which you can temporarily borrow from the volume up or down