You must have an unlocked bootloader to install CyanogenMod. Visit the Xiaomi mày Unlock Tool website for instructions.
Bạn đang xem: Xiaomi redmi note 3
Special boot modesRecovery: With the device powered down, hold the Volume Up và Power buttons.Fastboot: With the device powered down, hold the Volume Down & Power buttons.
|Redmi cảnh báo 3 Pro|
|850 900 1800 1900 MHz|
|1900 2000 850 900 1900 2100 MHz|
|B1 B3 B5 B7 B8 B38 B39 B40 B41|
|Qualcomm Snapdragon 650 MSM8956|
|4 x 1.4 GHz và 2 x 1.8 GHz hexa-core Cortex A53 & A72|
|164 g (5.78 oz)|
|150 milimet (5.9 in) (h)76 milimet (2.9 in) (w)8.7 mm (0.34 in) (d)|
|139.7 milimet (5.5 in)|
|up lớn 256 GB (hybrid sim slot)|
|4.1 A2DP, LE|
|16MP, flash: dual-tone|
|Fingerprint, accelerometer, gyro, proximity, compass|
Modifying or replacing your device’s software may void your device’s warranty, lead to lớn data loss, hair loss, financial loss, privacy loss, security breaches, or other damage, and therefore must be done entirely at your own risk. No one affiliated with the CyanogenMod project is responsible for your actions. Good luck.
Note: Bootloader Unlock
You must have an unlocked bootloader khổng lồ install CyanogenMod. Visit the Xiaomi mi Unlock Tool website for instructions.
Installing a custom recovery using fastboot
See All About Recovery Images for more information about custom recoveries và their capabilities.Connect the Redmi lưu ý 3 lớn the computer via USB.Open a terminal on your PC and reboot the device into fastboot mode by typingadb reboot bootloaderor by using the hardware key combination for your device while it is powered off.Once the device is in fastboot mode, verify your PC sees the device by typing fastboot devicesFlash recovery onto your device by entering the following command:fastboot flash recovery your_recovery_image.imgwhere the latter part is the filename of the recovery image.Once the flash completes successfully, reboot the device into recovery to lớn verify the installation. Boot to lớn recovery instructions: With the device powered down, hold the Volume Up and Power buttons.Note: Some ROMs overwrite recovery at boot time so if you vị not plan lớn immediately boot into recovery lớn install CyanogenMod, please be aware that this may overwrite your custom recovery with the stock one.
Installing CyanogenMod from recoveryPlace the CyanogenMod .zip package, as well as any optional .zip packages, on the root of /sdcard:Note: You can copy the .zip packages to lớn your device using any method you are familiar with. The adb method is used here because it is universal across all devices và works in both Android & recovery mode. If you are in recovery mode, you may need lớn ensure /sdcard (sometimes called Internal Storage) is mounted by checking its status in the Mounts menu. If you have booted regularly, USB debugging must be enabled.If you are not already in recovery, boot to recovery mode now.With the device powered down, hold the Volume Up và Power buttons.In Team Win Recovery Project, select menu choices by tapping on the appropriately labelled button.Optional (Recommended): Select the Backup button lớn create a backup.Select Wipe and then Factory Reset.Select Install.Navigate lớn /sdcard và select the CyanogenMod .zip package.Follow the on-screen notices lớn install the package.Optional: Install any additional packages you wish using the same method (if you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on đứng top of it).Once installation has finished, return to the main menu & select Reboot, then System. The device will now boot into CyanogenMod.
1 Introduction2 Build CyanogenMod và CyanogenMod Recovery2.1 Prepare the Build Environment4 Installing a custom recovery using fastboot
These instructions will hopefully assist you lớn start with a stock Redmi cảnh báo 3, unlock the bootloader (if necessary), và then tải về the required tools as well as the very latest source code for CyanogenMod (based on Google’s game android operating system). Using these, you can build both CyanogenMod & CyanogenMod Recovery image from source code, và then install them both to lớn your device.
It is difficult lớn say how much experience is necessary to follow these instructions. While this guide is certainly not for the very very very uninitiated, these steps shouldn’t require a PhD in software development either. Some readers will have no difficulty & breeze through the steps easily. Others may struggle over the most basic operation. Because people’s experiences, backgrounds, và intuitions differ, it may be a good idea lớn read through just to ascertain whether you feel comfortable or are getting over your head.
Remember, you assume all risk of trying this, but you will reap the rewards! It’s pretty satisfying khổng lồ boot into a fresh operating system you baked at home :) và once you’re an Android-building ninja, there will be no more need to lớn wait for “nightly” builds from anyone. You will have at your fingertips the skills lớn build a full operating system from code to lớn a running device, whenever you want. Where you go from there– maybe you’ll địa chỉ cửa hàng a feature, fix a bug, địa chỉ a translation, or use what you’ve learned to lớn build a new tiện ích or port to lớn a new device– or maybe you’ll never build again– it’s all really up khổng lồ you.
What you’ll needA relatively recent computer (Linux, OS X, or Windows) with a reasonable amount of RAM & about 100 GB of không tính phí storage (more if you enable ccache or build for multiple devices). The less RAM you have, the longer the build will take (aim for 8 GB or more). Using SSDs results in considerably faster build times than traditional hard drives. A USB cable compatible with the Redmi chú ý 3 (typically micro USB, but older devices may use mini USB or have a proprietary cable) A decent internet connection & reliable electricity :)
If you are not accustomed khổng lồ using Linux– this is an excellent chance khổng lồ learn. It’s free– just tải về and run a virtual machine (VM) such as Virtualbox, then install a Linux distribution such as Ubuntu (AOSP vets Ubuntu as well). Any recent 64-bit version should work great, but the latest is recommended.
You want to use a 64-bit version of Linux. A 32-bit Linux environment will only work if you are building CyanogenMod 6 & older. For CyanogenMod 10.1, if you encounter issues with 64bit host binaries, you can mix BUILD_HOST_32bit=1 in your environment. This is generally not needed, though, especially with CyanogenMod 10.2 and newer.
Using a VM allows Linux lớn run as a guest inside your host computer– a computer in a computer, if you will. If you hate Linux for whatever reason, you can always just uninstall và delete the whole thing. (There are plenty of places lớn find instructions for web10_setting up Virtualbox with Ubuntu, so I’ll leave it to lớn you to vì that.)
So let’s begin!
Build CyanogenMod và CyanogenMod Recovery
Prepare the Build Environment
You only need to vày these steps the first time you build. If you previously prepared your build environment và have downloaded the CyanogenMod source code for another device, skip khổng lồ Prepare the device-specific code.
Install the SDKIf you have not previously installed adb and fastboot, install the android SDK. “SDK” stands for Software Developer Kit, và it includes useful tools that you can use lớn flash software, look at the system logs in real time, grab screenshots, và more– all from your computer.
While the SDK contains lots of different things– the two tools you are most interested in for building game android are adb and fastboot, located in the /platform-tools directory.
Install the Build Packages
Several “build packages” are needed to build CyanogenMod. You can install these using the package manager of your choice.
A package manager in Linux is a system used lớn install or remove software (usually originating from the Internet) on your computer. With Ubuntu, you can use the Ubuntu Software Center. Even better, you may also use the apt-get install command directly in the Terminal. (Learn more about the apt packaging tool system from Wikipedia.)
For both 32-bit và 64-bit systems, you’ll need:
bc bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop maven openjdk-7-jdk pngcrush schedtool squashfs-tools xsltproc zip zlib1g-devIn addition to the above, for 64-bit systems, get these:
g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-devFor Ubuntu 15.10 (wily) and newer, substitute:lib32readline-gplv2-dev → lib32readline6-dev
For Ubuntu 16.04 (xenial) & newer, substitute (additionally see java notes below):libwxgtk2.8-dev → libwxgtk3.0-dev openjdk-7-jdk → openjdk-8-jdk
Java versions: Different versions of CyanogenMod require different versions of the JDK (Java Development Kit):CyanogenMod 7 – 9: Sun/Oracle Java SE 1.6 CyanogenMod 10.1: Sun/Oracle Java SE 1.6 or 1.7 CyanogenMod 10.2 – 11.0: Sun/Oracle Java SE 1.6 or 1.7 (OpenJDK 1.7 works fine, but the build system will display a warning) CyanogenMod 12.0 – 13.0: OpenJDK 1.7 (see chú ý about OpenJDK 1.8 below) CyanogenMod 14.1: OpenJDK 1.8
Ubuntu 16.04 (Xenial Xerus) or newer và OpenJDK: Since OpenJDK 1.7 was removed from the official Ubuntu repositories, you have a couple options:Enable experimental OpenJDK 1.8 tư vấn in CyanogenMod 13.0 (not available in earlier version). Khổng lồ enable OpenJDK 1.8 support, địa chỉ cửa hàng this line lớn your $HOME/.bashrc file: export EXPERIMENTAL_USE_JAVA8=true.
Also see http://source.android.com/source/initializing.html which lists needed packages.
Create the directories
You will need to set up some directories in your build environment.
To create them:
$ mkdir -p ~/bin$ mkdir -p ~/android/system
Install the repo commandEnter the following to tải về the “repo” binary & make it executable (runnable):
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo$ chmod a+x ~/bin/repo
Put the ~/bin directory in your path of executionIn recent versions of Ubuntu, ~/bin should already be in your PATH. You can kiểm tra this by opening ~/.profile with a text editor & verifying the following code exists (add it if it is missing):
# set PATH so it includes user"s private bin if it existsif < -d "$HOME/bin" > ; then PATH="$HOME/bin:$PATH"fi
Initialize the CyanogenMod source repositoryEnter the following khổng lồ initialize the repository:Note: Make sure the centimet branch entered here is the one you wish to build and is supported on your device.
$ cd ~/android/system/$ repo init -u https://github.com/CyanogenMod/android.git -b cm-13.0
Download the source code
To start the tải về of all the source code to lớn your computer:
$ repo syncThe centimet manifests include a sensible default configuration for repo, which we strongly suggest you use (i.e. Don’t địa chỉ cửa hàng any options to lớn sync). For reference, our mặc định values are -j 4 and -c. The -j 4 part means that there will be four simultaneous threads/connections. If you experience problems syncing, you can lower this lớn -j 3 or -j 2. -c will ask repo lớn pull in only the current branch, instead of the entire centimet history.
Prepare to lớn wait a long time while the source code downloads.
The repo sync command is used to update the latest source code from CyanogenMod & Google. Remember it, as you can vị it every few days khổng lồ keep your code base fresh và up-to-date.
Get prebuilt apps (CM11 và below)
$ cd ~/android/system/vendor/cmthen enter:
$ ./get-prebuiltsYou won’t see any confirmation- just another prompt. But this should cause some prebuilt apps khổng lồ be loaded và installed into the source code. Once completed, this does not need to be done again.
Prepare the device-specific code
Helpful Tip – Errors during breakfast
Different maintainers setup their device inheritance rules differently. Some require a vendor directory to be populated before breakfast will even succeed. If you receive an error here about vendor makefiles, then jump down khổng lồ the next section Extract proprietary blobs. The first portion of breakfast should have succeeded at pulling in the device tree & the extract blobs script should be available. After completing that section, you can rerun breakfast kenzo
After the source downloads, ensure you are in the root of the source code (cd ~/android/system), then type:
$ source build/envsetup.sh$ breakfast kenzoThis will download the device specific configuration và kernel source for your device. An alternative to lớn using the breakfast command is lớn build your own local manifest. To vì this, you will need to lớn locate your device on CyanogenMod’s GitHub & list all of the repositories defined in cm.dependencies in your local manifest.
If you want khổng lồ know more about what source build/envsetup.sh does or simply want to lớn know more about the breakfast, brunch và lunch commands, you can head over to the Envsetup help page.
Instead of typing cd ~/android/system every time you want lớn return back to the root of the source code, here’s a short command that will vì chưng it for you: croot. Khổng lồ use this command, you must first run source build/envsetup.sh from ~/android/system.
Extract proprietary blobs
Now ensure that your Redmi note 3 is connected lớn your computer via the USB cable và that you are in the ~/android/system/device/xiaomi/kenzo directory (you can cd ~/android/system/device/xiaomi/kenzo if necessary). Then run the extract-files.sh script:
$ ./extract-files.shYou should see the proprietary files (aka “blobs”) get pulled from the device and moved khổng lồ the ~/android/system/vendor/xiaomi directory. If you see errors about adb being unable lớn pull the files, adb may not be in the path of execution. If this is the case, see the adb page for suggestions for dealing with “command not found” errors.
Your device should already be running a build of CyanogenMod for the branch you wish lớn build for the extract-files.sh script khổng lồ function properly.
It’s important that these proprietary files are extracted khổng lồ the ~/android/system/vendor/xiaomi directory by using the extract-files.sh script. Makefiles are generated at the same time lớn make sure the blobs are eventually copied lớn the device. Without these blobs, CyanogenMod may build without error, but you’ll be missing important functionality, such as graphics libraries that enable you to see anything!
Turn on caching lớn speed up build
You can speed up subsequent builds by adding
export USE_CCACHE=1to your ~/.bashrc tệp tin (what’s a .bashrc file?). Then, specify the amount of disk space lớn dedicate lớn ccache by typing this from the top of your game android tree:
prebuilts/misc/linux-x86/ccache/ccache -M 50Gwhere 50G corresponds khổng lồ 50GB of cache. This only needs to be run once và the web10_setting will be remembered. Anywhere in the range of 25GB khổng lồ 100GB will result in very noticeably increased build speeds (for instance, a typical 1hr build time can be reduced lớn 20min). If you’re only building for one device, 25GB-50GB is fine. If you plan lớn build for several devices that vày not chia sẻ the same kernel source, aim for 75GB-100GB. This space will be permanently occupied on your drive, so take this into consideration. See more information about ccache on Google’s app android build environment initialization page.
If you are a very active developer, working on many other projects than just Android, you might prefer khổng lồ keep your app android ccache independent (because it’s huge & can slow down the efficiency of ccache in your other projects). Beginning with CyanogenMod 12.1, you can specify environment variables for the location and form size of CyanogenMod’s ccache. Some syntax examples: export ANDROID_CCACHE_DIR="$HOME/android/.ccache" và export ANDROID_CCACHE_SIZE="50G".
If the build doesn’t start, try lunch and choose your device from the menu. If that doesn’t work, try breakfast & choose from the menu. The command make kenzo should then work.
A second, bonus tip! If you get a command not found error for croot, brunch, or lunch, be sure you’ve done the source build/envsetup.sh command in this Terminal session from the ~/android/system directory.
A third tip! If the build to lớn fails while downloading Gello, you’ll need to lớn import a missing certificate into Maven’s truststore. Detailed instructions on how to bởi that can be found here
If the build breaks…If you experience this not-enough-memory-related error…
ERROR: signapk.jar failed: return code 1make: ***
Search for instances of -Xmx2048m (it should appear either under OPTIONS.java_args or near usage of signapk.jar), & replace it with -Xmx1024m or -Xmx512m.
Then start the build again (with brunch).If you see a message about things suddenly being “killed” for no reason, your (virtual) machine may have run out of memory or storage space. Assign it more resources & try again.
Install the build
Assuming the build completed without error (it will be obvious when it finishes), type:
$ cd $OUTin the same terminal window that you did the build. Here you’ll find all the files that were created. The stuff that will go in /system is in a folder called system. The stuff that will become your ramdisk is in a folder called root. And your kernel is called… kernel.
But that’s all just background info. The two files we are interested in are (1) recovery.img, which contains CyanogenMod Recovery, & (2) cm-13.0-20161224-UNOFFICIAL-kenzo.zip, which is the CyanogenMod installation package.
Installing a custom recovery using fastboot
See All About Recovery Images for more information about custom recoveries and their capabilities.Connect the Redmi cảnh báo 3 lớn the computer via USB.Open a terminal on your PC & reboot the device into fastboot mode by typingadb reboot bootloaderor by using the hardware key combination for your device while it is powered off.Once the device is in fastboot mode, verify your PC sees the device by typing fastboot devicesFlash recovery onto your device by entering the following command:fastboot flash recovery your_recovery_image.imgwhere the latter part is the filename of the recovery image.Once the flash completes successfully, reboot the device into recovery khổng lồ verify the installation.Note: Some ROMs overwrite recovery at boot time so if you bởi not plan khổng lồ immediately boot into recovery khổng lồ install CyanogenMod, please be aware that this may overwrite your custom recovery with the stock one.
Back khổng lồ the $OUT directory on your computer– you should see a tệp tin that looks something like:
The above tệp tin name may vary depending on the version of centimet you are building. Your build may not include a version number or may identify itself as a “KANG” rather than UNOFFICIAL version. Regardless, the tệp tin name will end in .zip & should be titled similarly lớn official builds.
Now you can flash the cm...zip tệp tin above as usual via recovery mode. Before doing so, now is a good time khổng lồ make a backup of whatever installation is currently running on the device in case something goes wrong with the flash attempt. While CyanogenMod Recovery doesn’t have a backup feature, there are other custom recoveries available that do. You can also use something lượt thích Titanium Backup (root required) as an alternative.
Success! So….what’s next?
You’ve done it! Welcome to lớn the elite club of self-builders. You’ve built your operating system from scratch, from the ground up. You are the master/mistress of your domain… & hopefully you’ve learned a bit on the way và had some fun too.
Now that you’ve succeeded in building CyanogenMod for your device, here are some suggestions on what to vị next.
Also, be sure to lớn take a glance at the Dev Center on this wiki for all kinds of more detailed information about developer topics ranging from collecting logs, understanding what’s in the source code directories, submitting your own contributions, porting CyanogenMod to new devices, & a lot more.
Content of this page is based on informations from wiki.cyanogenmod.org, under CC BY-SA 3.0 licence.