Before we start, though, let’s just clarify what USB debugging is. A feature aimed mostly at developers, USB debugging opens up direct access to the Android system for the Android SDK (Software Development Kit). You can have the Android SDK downloaded on your computer, but unless you have USB debugging enabled, it won't work with your device. With all this in mind - whether you are a developer or someone who has decided to flash a custom ROM, or simply root your phone - here is how to enable USB debugging on different versions of Android:
How to enable USB debugging on Android KitKat and Jelly Bean (4.2 and later)
1. Navigate to Settings > About Phone > scroll to the bottom > tap Build number seven (7) times. You'll get a short pop-up in the lower area of your display saying that you're now a developer.
2. Go back and now access the Developer options menu, check ‘USB debugging’ and click OK on the prompt.
That’s it, you’re done!
You can now enable and disable it whenever you want by going into Settings > Developer Options > Debugging > USB debugging
How to enable USB debugging on Android 4.1 and 4.0
2. Once you have enabled developer options, you will be able to check the USB Debugging field. Simply scroll down to it and check it - a pop-up window will notify you that you’re now a developer. That’s all it takes!
How to enable USB debugging on Android 2.3 Gingerbread and earlier
Enable it - as simple as that!