Enable USB Debugging on OnePlus Phones – Quick Guide
In this article
Yes, you can enable USB debugging on a OnePlus phone by turning on Developer options and toggling the USB debugging switch, which then lets your device communicate with a computer for ADB commands, app testing, and data transfer.
What You'll Need
- A OnePlus smartphone running OxygenOS (or the Android version that ships with your device).
- A USB‑C to USB‑A (or USB‑C) cable that can transfer data, not just charge.
- A computer with the Android Debug Bridge (ADB) installed – optional but useful for confirming the connection.
- Patience and a few minutes of time.
Step‑By‑Step
- Open the Settings app on your OnePlus device. The icon looks like a gear and is usually found on the home screen or in the app drawer.
- Scroll down and tap About phone. Depending on your OxygenOS version the label may be About device or System → About phone.
- Locate the entry labeled Build number. Tap it repeatedly – typically seven times – until a toast message appears that says “You are now a developer!” or “Developer mode has been turned on.” If your device is protected by a lock screen PIN, pattern, or password, you will be asked to enter it before the toggle activates.
- Press the Android back button (or swipe from the left edge) to return to the main Settings screen. You should now see a new entry called Developer options near the bottom of the list.
- Tap Developer options**. The first toggle at the top, labeled On or Enable, turns the whole menu on. Switch it on.
- Scroll within Developer options until you find USB debugging. The exact wording can vary – some versions display “USB debugging (ADB)” – but it will always be a checkbox or switch.
- Tap the switch to enable it. A confirmation dialog will appear warning you about the security implications of enabling debugging. Read it, then tap OK to confirm.
- Connect your OnePlus phone to the computer using the data‑capable USB‑C cable. Pull down the notification shade; you should see a notification that says “USB charging this device” or similar.
- Tap the notification and select File Transfer / Android Auto (or “Transfer files”). This ensures the USB link is in a mode that supports ADB.
- On your computer, open a command prompt or terminal window and type
adb devices. The first time you do this, the phone will display an RSA key fingerprint prompt asking if you trust the computer.- Check the box that says “Always allow from this computer” (if you plan to use this PC regularly) and tap Allow. The device should now appear in the list of attached devices.
- Congratulations – USB debugging is now active. You can run ADB commands, install apps via
adb install, capture logs, or use development tools such as Android Studio.- If you ever need to disable debugging, simply return to Settings → Developer options and toggle USB debugging off.
Common Mistakes
- Skipping the Build number tap: Without unlocking Developer options first, the USB debugging toggle will not be visible.
- Using a charge‑only cable: Some cheap cables lack data lines, so the computer never sees the device and ADB will report “no devices attached.”
- Leaving the USB mode on “Charging only”: Even with debugging enabled, the phone must be in a data‑transfer mode for ADB to communicate.
- Ignoring the RSA prompt: If you dismiss the “Allow USB debugging?” dialog, the computer will not be authorized and ADB commands will fail.
- Disabling “Stay awake” unintentionally: Some developers keep the screen on while debugging; forgetting to enable it can cause the phone to lock and break the connection.
Tips
- Enable Stay awake (found in Developer options) while the phone is charging; this prevents the screen from turning off during long ADB sessions.
- Use the “Always allow from this computer” checkbox the first time you authorize a PC – it saves you from repeatedly confirming the RSA fingerprint.
- If you plan to develop frequently, consider adding the
adbpath to your system’s environment variables for easier command‑line access. - On newer OnePlus models, the USB‑C port may support “fast charging only” when a proprietary charger is used; switching to a generic data cable ensures the port stays in ADB‑compatible mode.
- When using Android Studio, enable “USB debugging (Security settings)” only if you need to debug apps that use the Android Debug Bridge over a network; otherwise, the standard toggle is sufficient.
Troubleshooting
1. ADB reports “no devices attached”
- Check that the cable is firmly plugged into both the phone and the computer. Try a different USB‑C cable that you know supports data transfer.
- Make sure the phone’s USB mode is set to “File Transfer” or “Transfer files” rather than “Charging only.”
- Restart both the phone and the computer. A simple reboot often clears a stale USB driver state.
- On Windows, open Device Manager and look for “Android Composite ADB Interface.” If it appears with a yellow exclamation mark, reinstall the Google USB driver from the Android SDK Manager.
- On macOS or Linux, ensure the
adbbinary is up to date. Runadb kill-server && adb start-serverto reset the daemon.
2. RSA key prompt never shows up
- Toggle USB debugging off, then on again. This forces the system to re‑prompt for authorisation.
- Clear the list of authorized computers: Settings → Developer options → Revoke USB debugging authorizations. After revoking, reconnect and accept the prompt.
- Some security‑focused apps (e.g., certain antivirus or device‑management tools) can block the RSA dialog. Temporarily disable such apps and try again.
3. Phone disconnects after a few seconds
- Check the USB power settings. In Developer options, the “USB configuration” option can be set to “Charging.” Change it to “MTP (Media Transfer Protocol)” or “File Transfer.”
- Disable “Battery optimization” for the “ADB” service: Settings → Battery → Battery optimization → All apps → Select “ADB” and choose “Don’t optimize.”
- Some OnePlus devices have a “USB debugging (Security settings)” toggle that, when enabled, restricts debugging to a secure mode. If you don’t need that level of security, keep it disabled.
If none of the above resolves the issue, consider reinstalling the Android SDK platform‑tools on your computer or contacting OnePlus support for hardware‑related USB port problems.
Frequently Asked Questions
Do I need to root my OnePlus phone to enable USB debugging?
No. USB debugging is a standard developer feature available on all OnePlus phones without rooting.
Can I enable USB debugging without going through the Build number tap?
No. The Build number tap unlocks Developer options, which is required before the USB debugging toggle appears.
Is USB debugging safe to leave on all the time?
Leaving it on makes the device more vulnerable if it is connected to an untrusted computer. It is best practice to disable it when you are finished debugging.
Will enabling USB debugging affect battery life?
Only while the phone is connected to a computer and the screen is on. Enabling “Stay awake” can increase consumption, but the impact is minimal for short sessions.
What if my OnePlus phone runs Android 13 and the menu looks different?
The path is still Settings → About phone → Build number, then Settings → System → Developer options. Labels may vary slightly (e.g., “System” instead of “About phone”), but the steps remain the same.
Can I use wireless ADB instead of a USB cable?
Yes, once USB debugging is enabled you can run adb tcpip 5555 while the phone is connected via USB, then connect over Wi‑Fi. However, the initial USB connection is required to start the wireless session.