How to fix Senors error on Xiaomi Mi 4 when using custom rom


Xiaomi Mi 4 is a flagship phone from Xiaomi with high-end specs. Furthermore it is installed MIUI ROM exclusivity makes the device more attractive. However, in order to exploit the full potential as well as optimize the device, many users have conducted install custom ROM for their device. Moreover, with outstanding development support from the CyanogenMod community, the device has had many versions ROM CyanogenMod different for Xiaomi Mi 4 with its own capabilities.

However, many users reported the error that senors . sensor does not work on custom ROMs. In this post xaiandroid shares with you how to fix it Senors for the sensor to work on the custom ROM. To do so, you need to replace the existing image file on the system with the new one. Note the new file shared in the Download section.

After you proceed then senors . sensor will work again. But before doing this, you need to back up all data before proceeding.


  • Download | Persist image file (File: persistnew.img)
  • Download | Terminal Emulator for Android (Android app, opens in Google Play Store)

How to fix Senors error on Xiaomi Mi 4

  1. Make sure you have root access on your device.
  2. Download Terminal Emulator for Android and grant root access when asked.
  3. You also need to download persistnew.img from the download section.
  4. Put the persistnew.img file in a safe place on your device’s storage.
  5. Open a terminal emulator and enter the following command:


    dd if=/dev/block/mmcblk0p22 of=/sdcard/persist.img

  6. When successful, you will receive a persist.img file on your device’s storage.
  7. Copy and and place the files in a safe place. Create multiple backups just in case if you ever want to restore the files.
  8. Now place the persistnew.img file where the image file still exists. For example, on sdcard or internal storage
  9. Now open the terminal emulator application again and enter the following command:

    dd if=/sdcard/persistnew.img of=/dev/block/mmcblk0p22

  10. Reboot the system.

In case you want to restore previously existing files, you proceed to do the same and replace the existing file files. Now test your sensor with any sensor testing app like Sensor Box.


We will be happy to hear your thoughts

Leave a reply

App New
Reset Password