Developing Android mobile apps requires testing on real devices β emulators donβt always accurately reproduce the behavior of a smartphone. If you own a Xiaomi Redmi (be it a Redmi Note 12, Redmi 10 or another model), youβve faced the peculiarities of connecting to Android Studio, from the lack of a device in the list to ADB authorization errors. This problem is due to the MIUI security policy, which blocks debugging by default.
Unlike Google Pixel or Samsung devices, where it is enough to turn on Developer Mode, Xiaomi smartphones require additional manipulations: unlocking OEM Unlock, confirming your Mi Account account and installing proprietary drivers. In this article, we will analyze all the steps from preparing your phone to the first successful launch of an application through Android Studio, as well as solving typical errors such as unauthorized device or no permissions.
1.Preparation of the phone: Enabling the Developer Mode
The first step is to activate the hidden menu for developers. On Xiaomi Redmi smartphones, this process is standard for all models based on MIUI 12/13/14, but has nuances depending on the firmware version.
- π± Go to Settings β The phone.
- π Press 7 times in a row on the item Version MIUI (A notice will appear saying, βYou have become a developer!")
- π Return to the main Settings menu β there will be a new section Additional Settings β For developers
If there is no MIUI version (relevant for some regions), try clicking on the Build Number or Android Version. On Redmi models with Global ROM, the path may differ: Settings β System β About Phone β Kernel Version.
β οΈ Note: Some Xiaomi devices require a reboot after activation of the developer mode. USB and Unlock. OEM may not show up.
π‘
If after 7 taps nothing happens, check if the phone is Child Mode (child mode) or a third-party launcher that blocks system settings.
2. Set developer settings on Xiaomi Redmi
Once the developer mode is activated, you need to enable key options to work with Android Studio. Open the Developer section (path: Settings β Additional settings β Developers) and follow the following steps:
- π§ Turn on Debugging. USB (USB debugging)
- π Activate Unlocking. OEM (OEM Unlocking) is a must for custom recovery or rooting firmware
- π In the Configuration section USB By default, select File Transfer (MTP)
- π‘οΈ Turn off the check. MIUI down USB (MIUI Optimization β Turn off) if it interferes with debugging
Pay special attention to the item Unblocking OEM. New Redmi models (e.g. Redmi Note 13 Pro)+) This option can be blocked until you link the device to your Mi Account and confirm the developerβs rights through the SMS. More about this in the next section.
| Option. | Meaning | Explanation |
|---|---|---|
| USB debugging | Included. | Allows Android Studio to interact with the device |
| Unlocking the OEM | Included. | It is necessary to unlock the bootloader (bootloader). |
| USB configuration | MTP (or PTP) | Data transfer mode compatible with ADB |
| Checking MIUI on USB | Disconnected. | Otherwise, the system will request confirmation each time it connects. |
β οΈ Note: If the option is Unblocked OEM Inactive (grey), meaning that the device is blocked by the manufacturer, you will need to link Mi Account and wait 7-15 days to unlock it (Xiaomi policy for new devices).
Redmi Note 10/11/12|Redmi 9/9A/9C|Redmi K50/K60|Redmi A1/A2|Another model-->
3. Install ADB drivers and set up Android Studio
Even if the Xiaomi Redmi phone is properly configured, without the ADB (Android Debug Bridge) drivers, Android Studio will not be able to recognize it. Here is a step-by-step guide for Windows (for macOS/Linux, the steps are similar, but without installing drivers):
- Download Platform Tools: π₯οΈ Go to the official website of Android Developers π₯ Download the archive. platform-tools-latest-windows.zip (For other OSes, select the appropriate version) π Unpack the archive into the root of the disk C:\ (for example, C:\platform-tools\)
- Install drivers for Xiaomi: π Connect your phone to your PC through USB-cable (preferably original) π±οΈ In Device Manager, find a device with an exclamation point (usually an Android Phone). β Android ADB Interface) π Update the driver manually, specifying the path to the folder C:\platform-tools\
Check the connection via the command line:
cd C:\platform-tools
adb devicesIf the device is displayed with unauthorized status, confirm debugging on the phone screen.
For users of macOS or Linux, it is enough to install platform-tools through package managers:
# For macOS (via Homebrew)
brew install android-platform-tools
For Linux (Debian/Ubuntu)
sudo apt install adb fastbootDrivers installed without errors|The phone is determined in the Device Manager|Adb devices show the serial number|On the phone screen appeared window confirmation debugging-->
4 Unblock Mi Account and Confirm Developer Rights
One of the unique features of Xiaomi smartphones is that it links the device to a Mi Account to unlock the bootloader. Without this step, the OEM Unlock option will remain inactive, and some ADB features will be limited.
- Create or sign in to Mi Account: π± Go to Settings. β Accounts. β Mi Account π Register or log in (use a valid email)
- Activate Developer Rights: π§ Back to Settings β Additional settings β For developers π Click on Mi Unlock Status and link the device to your account. β³ Wait 7-15 days (depending on the model) and then you have the option. OEM Unlock will become active
If you bought a Xiaomi Redmi phone "with your hands", make sure that the previous owner untie his Mi Account. Otherwise, unlocking the bootloader will not be possible without his participation.
adb shell getprop ro.boot.verifiedbootstateThe value of orange means that the bootloader is unlocked, green is blocked.
What to do if Mi Account is not confirmed?
5. Solving Typical Connection Errors
Even after setting up correctly, errors can occur, and here are the most common problems and solutions for Xiaomi Redmi:
| Mistake. | Reason. | Decision |
|---|---|---|
| device unauthorized | No confirmed debugging on the phone. | On the phone screen will appear a request β click βAllowβ |
| no permissions | Problems with drivers or adb | Reinstall the driver manually or run adb kill-server, then adb start-server. |
| offline | USB-cable does not support transmission of data | Use the original cable or check the USB port on your PC |
| device not found | ADB does not see the device | Check if debugging is enabled and if drivers are installed correctly |
If you canβt see your device after connecting to Android Studio, follow these steps:
- π Reset it. ADB-Adb kill-server adb start-server
- π Turn it off and plug it back in. USB-cable (try another port)
- π± On the phone in the section For developers, turn off and turn on debugging by USB
- π₯οΈ In Android Studio, go to File β Sync Project with Gradle Files
β οΈ Note: Some Redmi models (e.g. Redmi) 9T) post-refresh MIUI You reset your developer's settings. Always check them before you start.
π‘
If Android Studio doesnβt see the device, but Adb devices show it correctly, the problem is setting up the development environment. Go to Run β Edit Configurations and select the target device manually.
6 First launch of the app on Xiaomi Redmi
Once you've set up everything, you just have to start the project on your device. Here's how to do it in Android Studio:
- Connect the phone: π Use it. USB-cable (preferably from the set) π± On the phone screen, select File Transfer Mode (MTP)
- Select your device in Android Studio: π₯οΈ In the top toolbar, click on the drop-down list of devices π± Your Xiaomi Redmi should appear in the list (e.g. Redmi Note 12) 5G (Android 13))
- Launch the application: βΆοΈ Press the green Run button (or Shift) + F10) β³ Wait for the project assembly and installation APK device
If you have an Installation failed error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED, check the file AndroidManifest.xml For Xiaomi devices, you may also need to disable optimization MIUI:
adb shell settings put global hidden_api_policy 1This command temporarily disables MIUI restrictions on calling hidden APIs.
7. Optimization of performance in debugging
Debugging on a real Xiaomi Redmi device can slow down due to background MIUI processes.
- π Turn on Do not turn off the screen in the developer settings
- β‘ Turn off window animation, transition animation and animation duration (set the value Animation disabled)
- ποΈ Clear the cache. MIUI through settings β Memory. β Clear the cache
- π Activate High Performance Levels in Battery Settings for Android Studio
For models with a Snapdragon processor (like the Redmi K60), it is also useful to enable Force GPU Rendering in the developer settings.This will speed up the rendering of the interface, but can increase battery consumption.
π‘
If the app is slowing down on Xiaomi Redmi, try disabling MIUI Optimization in the developer settings.This will remove some system limitations, but may affect stability.