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).
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:
- Link your Mi Account to your device: π Go to Settings. β Xiaomi account β Mi Cloud. π Turn on synchronization and confirm binding through SMS.
- 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!.
- Turn it on. OEM Unlock and Debugging by USB: π Back to Settings β Additionally. β For developers. π Activate the switches Unlock OEM and debugging. USB.
- 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:
- Download Platform Tools from Google: π₯ Download the archive from the official website. π₯ Unpack at the root of the disk C:\platform-tools\.
- 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 devicesIf 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:
- Download and install Android Studio from the official website.
- During installation, select components: βοΈ Android SDK βοΈ Android SDK Platform-Tools βοΈ Android Emulator (optional if you only test on a physical device).
- 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:
- Turn on Debugging. USB on the telephone (see section 2).
- Connect Redmi Note 9 Pro to PC and select File Transfer Mode (MTP).
- In Android Studio, open a project or create a new one (File) β New Project).
- Press Run (βΆοΈ) β Select your device in the list.
| Problem. | Possible cause | Decision |
|---|---|---|
| The device is not displayed in adb devices | Drivers not installed | Reinstall drivers through Device Manager |
| Installation failed: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED | Incompatible version MIUI or targetSdkVersion | Update. MIUI Change your targetSdkVersion to build.gradle |
| Error: more than one device/emulator | Several 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?
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:
- 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 bootloaderTWRP
fastboot flash recovery twrp.img
fastboot reboot recoveryTWRP
Format Data
Getting root rights:
- Download Magisk (the latest version) from GitHub.
- V TWRP Choose Install β indicate downloaded Magisk.zip.
- 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).