This is not the way to do it:
Man builds machine to push phone buttons from half a world away (video) — Engadget
See here how it’s done commercially: DeviceAnywhere – The Ultimate Mobile Application Testing Platform
Their system controls real phones, but they do it electrically, not by pushing physical buttons.
I’m not affiliated with DeviceAnywhere in any way, but this needed some “second opinion”.