I have found that using some cheap after-market chargers causes my iPhone5s to do that. It quits as soon as I unplug it from the charger. No trouble with using genuine Apple cords. A Belkin also worked. I just watched it runthrough some of my sent text messages and then it typed a gibberish word and sent it without me touching the phone! The first time I saw it act like that it flased all kinds of screens and apps and suddenly tried placing a call to an unknown number beforeI could unplug it! While it is under that "influence", I couldn't get any control using the home button. Glad to know it isn't being remotely hijacked. See if that is what is causing your problem. I assume some kind of electrical incompatibility. The first time I also noticed the phone get very warm in a short time!