title: Unlock patterns using adb sendevent in Android
body: <p>After checking some answers:</p>
  
  <p><a href="https://stackoverflow.com/questions/23529460/is-there-a-way-to-unlock-android-phone-via-adb-if-i-know-the-pattern">Is there a way to unlock android phone via adb, if I KNOW the pattern</a> and
  <a href="https://stackoverflow.com/questions/27348392/unlock-screen-galaxy-nexus-adb">Unlock Screen Galaxy Nexus ADB</a></p>
  
  <p>Im trying to unlock a pattern using adb commands using this script <a href="https://github.com/mattwilson1024/android-pattern-unlock/blob/master/unlock.sh" rel="nofollow noreferrer">https://github.com/mattwilson1024/android-pattern-unlock/blob/master/unlock.sh</a> (for automation purpose). </p>
  
  <p>Unfortunately the events arent working but I noticed that if I turn on the screen by myself (without using adb shell input keyevent 26) while the script is running, the events work and the pattern unlock.</p>
  
  <p>Could someone explain me why this is happening and if there is another way to unlock patterns? maybe without using events (like I wrote before is for automation purpose, not for a phone that was locked).</p>