How to fix Galaxy S4 stuck at boot screen despite factory reset? I am new to all of this, and I am having trouble with my Verizon Samsung Galaxy S4 SCH-I545. I am on a Mac, but can also run Windows 7 in VMware Fusion.

A couple days ago, I successfully rooted my phone, by flashing it with odin.
Several days after that, I successfully installed Safestrap Recovery, but did not do anything with it. Then I tried flashing a ROM for TWRP, and thats where my troubles started.

When I rebooted my phone, it constantly got stuck at the Samsung Galaxy S4 screen. 

I tried wipe data/factory reset and wipe cache partition, but to no avail. 

I can boot into the stock recovery (Safestrap got removed when I wiped my phone), and I can boot into fastboot.

When I boot it into recovery, it says


  E:failed to mount /system (Invalid argument)


Then I tried flashing the stock ROM with Odin and it kept failing. (I may have done this wrongly, because I did not get a PIT file with my Stock ROM download, and therefore had to use a different one that I found for the I545)

I also installed SDK tools for Mac, and used terminal to sideload a ROM, but once it hit 100%, my phone says 


  E: footer is wrong
  E: signature verification failed


So here I am now: Terminal will connect to my phone when I select Apply Update From ADB in recovery, 

 adb devices - shows my phone
 fastboot devices - shows nothing
 adb shell - gives error 'closed'
 reboot bootloader - gives error 'closed'


I have tried using the following to fix the error 'closed' but again, to no avail.

 adb kill-server
 adb start-server
Whoa, hold the phone! Had this problem and thank God I didn't do factory reset. Have a Galaxy S4, my carrier is Sprint if that matters. It's rooted, otherwise stock. My fix, hope it works 4 u:

1) Pull battery, wait 10 secs, put it back in, don't turn it on.
2) Simultaneously press vol down, button below screen, and power.
3) When it powers up, immediately release only the power button, keep
   holding the other 2 for a few seconds.

Boot up normally and you're done, but backup your data now...