mopaography.blogg.se

How to use android studio to unlock phone
How to use android studio to unlock phone







Time_taken_to_unlock = 3-10 secs (3s if using fingerprint)

how to use android studio to unlock phone

Given that I deploy app around 25-50 times a day during active development the amount of time saving is considerable. Next time when you run the app the device will be automatically unlocked. Click + -> “Run another configuartion” and select the shell script config added in above step Go to app configuartion, scroll to bottom and find “Before Launch” section. #!/bin/bash # When a device is attached there will be atleast 3 lines -> heading, device details, an empty new line if adb devices | wc -l | grep "3" then # Check if device locked, this may differ on some OEMs if adb shell dumpsys window | grep "mInputRestricted=true" thenĪdb shell input keyevent KEYCODE_WAKEUP # wakeup deviceĪdb shell input touchscreen swipe 530 14 # swipe up gestureĪdb shell input text "000000" # Edit ConfigurationĪdd the script path and finalize the shell script configuration We can automate the device unlock on app deployment by creating a bash script which uses adb to unlock the device and add it to our run configuration.Ĭopy the script code below and create a file named “device_awake.sh”ĭownload the script directly device_awake.sh do not forget to give execute permissions You also waste time in unlocking the device which can add up if you are deploying the app multiple times. Its kind of annoying when you deploy the app to a physical device and the device is locked.

how to use android studio to unlock phone

Most of the devices have a lock on it (if not, you should), also the device auto-locks after some time. There are cases when you need to test your app on physical device or even on your personal device. Save 5 to 36 hours of development time per year by 5 mins of automation.









How to use android studio to unlock phone