This is a project I try to find a way to simulate touch on iPhone touch screen without human finger, and also able to switch that touch on/off.
This Cookie Run game makes me wonder if I can send simulated human touch to the screen. That’s why I came up with this. To create a bot for the game lol. (and a great excuse to pause my freelance work! :P)
So I did some research. There’s UIAnimation framework that can do this. But it only works with app built from Xcode. You can send the app to background but still no touch can be sent outside the app :(
Seems like I can really do this with a software approach without jailbreaking my device. So I moved on to a hardware approach. Which is harder, literally.
I assume that the touch has to be large enough for the screen to recognize. That’s where the coin comes in. And here is my hypothesis…
If I pass some current to a coin that sits on the screen. It will work like a human touch!
…but how much current???
From here I found this quote…
"Some reports I read said the human finger is about 15pF but it was dependent on finger size and glass and level of iron in your blood. Try a capacitor about that size with one lead electronically connected to the screen and the other grounded…. maybe you could ground it to the dock connector.”
15pF sounds pretty small! If I just pass a low humble amount of current (or voltage? not sure what term I should use here) to it, then it should work. Sweet!
I tried putting a anode (flat) side of a typical AA 1.5V battery on the screen. It works. But then I tried again without using my hand to touch the battery directly. It didn’t work.
Next I hooked up my old dusty Raspberry Pi to the coin! And tried turning a GPIO port connect to that coin on/off. (see how to ssh and control GPIO here) It turns out touches showed up even before I actually close the circuit. Just strange.
Which can only mean that the magnetic field from my running Raspberry Pi got transferred via the wire to the screen. And that means turning GPIO on/off can’t trigger the touch on the screen. It just stays touched. And after about 7 seconds it’s unregistered.
As a conclusion, it’s not the current flow that works. It’s the magnetic field of the object that touches the screen. I’ll have to find some other way to do this. (e.g. using a capacitor)
That’s it. I’m off to do the annual boring tax documents. *sigh*…