Does an exploit exist to enable Android debug mode on a locked phone?

Does someone know an exploit to activate the Android debug mode even if the phone is locked? I’ve tried some software to unlock but this is not the way I want to resolve it …