How to turn Xiaomi Redmi Note 9 Pro into an Android development tool: the complete guide

Xiaomi Redmi Note 9 Pro

Android Studio

Many beginners face problems already at the stage of connecting the device to the PC: drivers are not installed, adb devices do not see the smartphone, and when you try to unlock the bootloader, Mi Unlock Status: 999 error appears. This article will help you avoid the typical bugs and set up the Redmi Note 9 Pro (model joyeuse or excalibur) to develop from scratch – even if you’ve never worked with a new model before. ADB or Fastboot.

We will consider not only the technical side, but also practical tips: how to speed up the assembly of projects, what settings are available. MIUI It is worth turning off for stable operation, and why some features (for example, Wireless) ADB) Be prepared for the fact that the process will require patience - especially if you plan to unlock the bootloader in the official way (which is mandatory for installation). TWRP or LineageOS).

1. Preparation of Xiaomi Redmi Note 9 Pro for development

Before you start setting up, make sure your device meets the minimum requirements. Redmi Note 9 Pro was released in several versions:

  • πŸ“± Global (joyeuse) – international version with support for all frequencies and Google Services.
  • πŸ“± India (excalibur) – similar to global but may have regional restrictions.
  • πŸ“± China – without Google Services, requires manual installation of GApps.

The Global version is best for development, as it out of the box supports Google Play Services and has fewer compatibility issues. If you have a Chinese model, be prepared for the extra steps of installing Open GApps once you unlock the bootloader.

Also check the version MIUI. At the time of writing, current versions:

  • πŸ”„ MIUI 14 (Android 12) - stable version for most tasks.
  • πŸ”„ MIUI 13 (Android 11) – Suitable, but may require an update for compatibility with the latest versions of Android Studio.

⚠️ Note: If your device is working on MIUI China ROM, Some of the developer’s functions (for example, OEM Unlock) can be hidden, in which case you need to reflash the device to the global version or use it. TWRP fitting.

Before you start, back up your data. Unlocking the bootloader and resetting your settings will result in a complete cleanup of the device. Use Mi Cloud or third-party tools like Titanium Backup (requires root rights).

πŸ“Š What version? MIUI You're using it?
MIUI 14 (Android 12)
MIUI 13 (Android 11)
MIUI 12.5 or older
I don't know.

2 Unlock the bootloader: the official method

Without an unlocked bootloader (Bootloader Unlock), you will not be able to install custom firmware, TWRP Xiaomi officially lets you unlock the bootloader, but the process requires waiting and following strict rules.

Steps to unlock:

  1. Link your Mi Account to your device: πŸ”— Go to Settings. β†’ Xiaomi account β†’ Mi Cloud. πŸ”— Turn on synchronization and confirm binding through SMS.
  2. Activate the Developer Mode: πŸ› οΈ Go to Settings. β†’ The phone. πŸ› οΈ Press 7 times on the version MIUI, until you have been notified you have become a developer!.
  3. Turn it on. OEM Unlock and Debugging by USB: πŸ”“ Back to Settings β†’ Additionally. β†’ For developers. πŸ”“ Activate the switches Unlock OEM and debugging. USB.
  4. Connect your device to your PC and use the Mi Unlock Tool: πŸ–₯️ Download the utility from the official website of Xiaomi. πŸ–₯️ Launch it. miflash_unlock.exe Sign in with the same Mi Account as you do on your phone. πŸ–₯️ Follow the instructions of the program. You usually have to wait. 72–168 hours (3–7 days) before unlocking.

⚠️ If you have a Couldn’t unlock or Mi Unlock Status: 999 error, check it out: πŸ”Œ Cable USB (Use the original or high-quality USB Type C). πŸ”Œ Port port USB on PC (try to connect to the back port of the system unit). πŸ”Œ Mi Unlock Tool (update to the latest) is often solved by changing the cable or port.

Linked to the Mi Account to the device|Developer mode activated|On. OEM Unlock in the settings|Drivers installed ADB PC-only|Download the Mi Unlock Tool of the latest version-->

Installation of drivers ADB and Fastboot on PC

Without properly installed drivers, your PC won’t be able to recognize the Redmi Note 9 Pro in modes. ADB Official drivers from Xiaomi often work unstable, so we recommend using universal solutions.

Instructions for Windows:

  1. Download Platform Tools from Google: πŸ“₯ Download the archive from the official website. πŸ“₯ Unpack at the root of the disk C:\platform-tools\.
  2. Install drivers manually: πŸ”§ Connect your phone in Fastboot mode (clip the power supply) + Loudness down when switched on). πŸ”§ Open Device Manager. β†’ Find a device with an exclamation point (usually Android Bootloader Interface). πŸ”§ Right-click. β†’ Update the driver β†’ Perform a search on this computer β†’ point the way C:\platform-tools\.

ADB

Fastboot

adb devices


fastboot devices

If the commands return the serial number of the device, the drivers are installed correctly.

For macOS/Linux The process is simpler – just install Platform Tools and add a path to them in the environment variable PATH. For example, in ~/.bashrc or ~/.zshrc add a line:

export PATH=$PATH:/path/to/platform-tools

πŸ’‘

If adb devices can’t see the device, try restarting the service. ADB Adb kill-server and adb start-server.

4.Set up Android Studio to work with Redmi Note 9 Pro

Android Studio is the main tool for Android development. To ensure that your Redmi Note 9 Pro correctly appears in the list of debugging devices, follow the following steps:

Installation and configuration:

  1. Download and install Android Studio from the official website.
  2. During installation, select components: β˜‘οΈ Android SDK β˜‘οΈ Android SDK Platform-Tools β˜‘οΈ Android Emulator (optional if you only test on a physical device).
  3. After installation, open up. SDK Manager (Tools β†’ SDK Manager and install: πŸ“± Android 12 (API 31) - for compatibility with MIUI 14. πŸ“± Google USB Driver – if you are using Windows.

Connection of the device:

  1. Turn on Debugging. USB on the telephone (see section 2).
  2. Connect Redmi Note 9 Pro to PC and select File Transfer Mode (MTP).
  3. In Android Studio, open a project or create a new one (File) β†’ New Project).
  4. Press Run (▢️) β†’ Select your device in the list.
Problem.Possible causeDecision
The device is not displayed in adb devicesDrivers not installedReinstall drivers through Device Manager
Installation failed: INSTALL_PARSE_FAILED_MANIFEST_MALFORMEDIncompatible version MIUI or targetSdkVersionUpdate. MIUI Change your targetSdkVersion to build.gradle
Error: more than one device/emulatorSeveral devices are connected.Specify the target device explicitly: adb -s SEERIAL_NUMBER install app.apk

πŸ’‘

If you are developing under Android 12+, Make sure that build.gradle indicates compileSdkVersion 31 and above, otherwise the application will not install on the Redmi Note 9 Pro with the help of the app. MIUI 14.

5. Optimizing Productivity for Development

Redmi Note 9 Pro is equipped with a Snapdragon processor 720G It's 6GB of RAM (top-end), but even that may not be enough to comfortably work on heavy projects:

Settings MIUI speed up:

  • ⚑ Turn off animations: Go to Settings β†’ For developers, set the scale of the animation window, the scale of the animation transition and the scale of the duration of the animator on the Off..
  • ⚑ Limit background processes: C Settings β†’ Annexes β†’ Application management disable auto-run of unnecessary applications. Use Permissions β†’ Auto-start to limit background activity.
  • ⚑ Turn on Do Not Interrupt ARCore (if you use it) AR): B Settings β†’ For developers, activate Don't Stop ARCore Apps.

Optimization of Android Studio:

  • πŸ–₯️ Increase the memory for Gradle: Open gradle.properties in the project. Add the lines: org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
  • πŸ–₯️ Disable unnecessary plugins: Go to File β†’ Settings β†’ Deactivate plugins like Android Games or Firebase if you don’t use them.

⚠️ Note: If you are using Wireless ADB (Wi-Fi, please note that MIUI If you lose a connection, do it: adb tcpip 5555 adb connect IP_DISTRIBUTIONS:5555 Where IP_The device can be found in the settings β†’ The phone. β†’ Status.

How to speed up the project assembly by 2 times?
Use Gradle caching and task parallelization. Add to gradle.properties: org.gradle.parallel=true org.gradle.caching=true org.gradle.daemon=This will reduce build time by 30-50% (depending on the project).

Installation TWRP and obtaining root rights (optional)

If you plan to test apps that require root access, or install custom firmware (like LineageOS), you will need to use the software. TWRP β€” Custom recovery: The process is risky and can result in a brick device, so follow the instructions carefully.

Steps to install TWRP:

  1. Download the current version TWRP For the Redmi Note 9 Pro: πŸ“₯ Official builds: twrp.me. πŸ“₯ Unofficial (if not official): search the forums XDA Developers.

Fastboot

adb reboot bootloader

TWRP

fastboot flash recovery twrp.img


fastboot reboot recovery

TWRP

Format Data

Getting root rights:

  1. Download Magisk (the latest version) from GitHub.
  2. V TWRP Choose Install β†’ indicate downloaded Magisk.zip.
  3. Reboot the device. Check root with adb shell su If #-root is received successfully.

⚠️ Attention: Magisk installation may break some banking applications (due to SafetyNet).To get around the check: Install MagiskHide Props Config. In Magisk settings, activate MagiskHide and add banking apps to the hide list.

7. Application testing and debugging

Now that your Redmi Note 9 Pro is ready to be developed, it’s time to get to the test.

Debugging tools:

  • 🐞 Logcat – View logs in real time: In Android Studio, open the Logcat tab (View) β†’ Tool Windows β†’ Logcat. Filter the logs by tag: tag:MyApp.
  • 🐞 Android Profiler – Analysis of usage CPU, Memory and energy: Available in View β†’ Tool Windows β†’ Profiler. Allows you to find memory leaks and optimize performance.
  • 🐞 ADB over Wi-Fi (if) USB uncomfortable: adb tcpip 5555 adb connect IP_DISTRIBUTIONS:5555

Frequent mistakes and their solutions:

  • 🚨 INSTALL_FAILED_TEST_ONLY: Reason: App assembled from Android:testOnly="Solution: delete the attribute in AndroidManifest.xml Or build a release version.
  • 🚨 DEVICE_UNAUTHORIZED: Reason: Key is not confirmed RSA Solution: disconnect/connect. USB-cable and confirm debugging on the phone.

πŸ’‘

To test geolocation without going outdoors, use Mock Locations in the developer settings. Install an app like Fake. GPS and select it in Settings β†’ For developers β†’ Mock location app.

8.Alternative ways to develop on the Redmi Note 9 Pro

If Android Studio seems too cumbersome or you want to try other tools, consider the following options:

Lungs. IDE and editors:

  • πŸ’» Visual Studio Code + Flutter/Dart: Install Flutter and Dart extensions. Supports Hot Reload, which speeds up development.
  • πŸ’» AIDE (Android IDE): The full development environment on the phone itself. Java/Kotlin C++ (through NDK).
  • πŸ’» Termux + CLI-Tools: Install Termux from F-Droid. Install git, openjdk and gradle via pkg install. Clone the repository and assemble the project directly on your phone!

Development without PC:

  • πŸ“± Pydroid 3 – for Python development (including Kivy for Android applications).
  • πŸ“± Dcoder – Java, Kotlin, C support++ languages.
  • πŸ“± OnlineGDB - Web-IDE to compile and debug the code directly in the browser.

If you choose to develop directly on your phone, consider the limitations:

  • ⚠️ Slow build of projects (due to hardware constraints).
  • ⚠️ Limited debugging capabilities (no full Logcat or Profiler).
  • ⚠️ Difficulties with dependency management (for example, Gradle may not work well).

FAQ: Frequent Development Questions on Redmi Note 9 Pro

❓ Can I Develop on Redmi Note 9 Pro Without Unlocking the bootloader?
Yes, but with limitations, you can: πŸ“± Testing applications through ADB. πŸ“± You can use Android Studio to debug it: ❌ Install custom firmware (LineageOS, AOSP). ❌ Get root access. ❌ Modifying system files.
❓ Why Android Studio Can't See My Device?
The problem might be in: πŸ”Œ Drivers – reinstall them through Device Manager. πŸ”Œ Connection mode – select File Transfer (MTP). πŸ”Œ Settings ADB β€” Adb kill-server adb start-server If nothing helps, try another one. USB-cable.
❓ How to update MIUI data-free?
Official Updates Through Settings β†’ The system updates save the data: πŸ”„ When you upgrade to a new version of Android (for example, 11 to 12) you may need to reset. πŸ”„ If you have custom firmware, update only through TWRP! We recommend before updating: πŸ“± Make a backup through Settings β†’ Additionally. β†’ Backup and reset. πŸ“± Save important files to your PC or cloud.
❓ Can I return the official firmware after installation? TWRP?
Yes, but the process depends on the current state of the device: πŸ”™ If you have a set TWRP, But no custom firmware: Download the official Fastboot ROM For your model from Xiaomi.Swipe through the Mi Flash Tool in Clean All mode. πŸ”™ If custom firmware is installed: Return to stock recovery via Fastboot: fastboot flash recovery recovery.img Then, you should go through the official firmware. ⚠️ Once you return to the official firmware, the bootloader will remain unlocked. To block it back, use: fastboot oem lock Attention: this will result in the reset of all data!
❓ What Android Studio Alternatives Are Right for the Redmi Note 9 Pro?
If Android Studio is too heavy for your PC or phone, try: Visual Studio Code Pros Tool + Flutter Light, Fast Build, Hot Reboot Limited Support for Native Android Code AIDE It works right on the phone, support. Java/Kotlin Slow assembly of large Termux projects Full control, support CLI-Hard to configure, no graphical interface