The only way to do it is to erase the file that contains the password. You won't be able to do this from a booted device, at least assuming you are running 4.2+ and USB debugging is off/your computer isn't authenticated with the device. You will need to flash a custom recovery if you do not have one already. Once you boot into recovery, you have two options. You can either use the file manager built into TWRP recovery, or you can use ADB. You need to delete the file /data/system/gesture.key. Use the file manager to delete it, or run from your computer:
adb shell rm /data/system/gesture.key
This will only work if your screen is still partially functional; it doesn't disable the passcode lock, but it erases your saved pattern so that any pattern will unlock the device. If you are able to touch any of the points on the pattern lock, it will unlock the device. Once unlocked, you can remove the lock screen, assuming your touch screen is functional.
And yes, this is an inherent security risk with unlocked devices.
LG Nexus 4 16GB on T-Mobile LTE:
CM 11 KitKat + hells-core + TWRP || ASUS Nexus 7 2012 32GB:
Stock 4.4 + m-kernel + TWRP
Samsung Galaxy S 4G (sold) AT&T Samsung Galaxy SII i777 (sold) AT&T Samsung Galaxy S Captivate i897 (sold)
All in One Guide for Samsung i897 Captivate, i9000 Galaxy S
Get extra space on Copy
with a new account!