Looks great in the gif but even if 4 digit PINs are used on an iPhone, Apple has thought about the use of robots.
As someone in the comments noted, the iPhone locks out anyone after 6 misses. For a minute. Miss a seventh time and the lockout is 15 minutes.Onan eighth miss and the lockout is 30 minutes. Miss 10 and it is an hour.
If the lockout time doubles on every subsequent miss, it will be a long, long time before the robot finds the answer.
Use more than 4 digits and it will pretty much never find it.