You will need root permissions to do so from an app.
That said, it is possible to enable ADB by executing the following terminal commands:
setprop persist.service.adb.enable 1
start adbd
This blog post gives an excellent example of how to execute these commands with escalated permissions through su
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…