In order to fulfill the basic functions of our service, the user hereby agrees to allow Xiaomi to collect, process and use personal information which shall include but not be limited to written threads, pictures, comments, replies in the Mi Community, and relevant data types listed in Xiaomi's Private Policy. By selecting "Agree", you agree to Xiaomi's Private Policy and Content Policy .

Tips & Tricks

Tutorial For You

[Tutorial] [Guide] How To Enable Camera2API in Your MIUI Device Without Root

2018-05-04 14:08:31
82967 333

Hi Mi Fans!
Many of you may know the HDR+ & portrait mode results with Google Camera app in Pixel devices and some developers have ported that camera app to work with many devices, but a main reason that still many are unable to use it is, the app needs Camera2api enabled in your device.

Most of the tutorials on internet or youtube are by rooting your device and installing magisk/magisk modules or by editing the build.prop using file explorers which also needs root access for your device, due to which many users who doesn’t want to root their device aren’t able use the Google Camera app.
Today by using this guide you can enable  Camera2api and use Google Camera in your device without rooting your device.

Please proceed with caution, as I don’t take any responsibility if you do anything wrong in this process or for breaking any exisiting features of your camera app.

I am showing this tutorial from Redmi Note 5 Pro device running on MIUI version with an unrooted device.

  • Unlocked bootloader of your device
  • Working TWRP recovery img file for your device
  • PC with adb installed
  • Manual camera test/Root checker apps in your device to check status.

Let’s quickly jump into the guide now.

1. To unlock bootloader for your device please follow this guide. Learn how to unlock the Bootloader of your Mi Phone
2. Download TWRP for your device and place the img file in the same folder where you have saved the adb files and rename it to twrp.img
( Redmi Note 5 Pro users can download this TWRP Redmi Note 5 Pro twrp.img credits: Shahan_mik3, vasishath )
3. Configure adb in your PC download adb from here and extract it to any folder in your PC. (4.49 MB, Downloads: 1500)

How to Enable Camera2API:

1. Now connect your device to your PC using the USB cable and change the connection mode to Transfer files.

2. Go to Settings - About Phone - Tap 7 consecutive times on MIUI Version to enable developer options, and go to Settings - Additional Settings - Developer options and enable USB debugging option.

3. Open the folder of adb in your PC, hold the shift key on your PC keyboard and right your mouse on the empty space in the adb folder and select “Open command window here”

4. Now enter the following command in the command window/PowerShell window which will show the serial number of your device and status of connection.
adb devices

Keep your phone screen unlocked as it may ask for USB debugging authorization, as shown in step 2, 2nd screenshot.

5. Once your device is detected as shown in above screenshot, you can boot into fastboot mode in your device by using the Volume down+Power key simultaneously in power off mode of your device or by using the following command in cmd.
adb reboot bootloader

This will boot your device into fastboot mode as shown in image at 2nd step.

6. Now we need to boot into TWRP recovery for your device temporarily, it will not affect your device.
To do this enter the following command and hit enter key, make sure recovery name is twrp.img and it is placed in the adb folder.
fastboot boot twrp.img

7. Once you hit enter your device will temporarily boot TWRP recovery like this.
You will see the screen like on left screenshot, swipe the blue colour arrow bar to right side too enter into the TWRP recovery options.
(We don’t need to do anything from the recovery, keep the device connected to PC and rest it aside)

8. Now once again enter the “adb devices” command and hit enter to check the connection of device with PC.

It will show your device serial number and recovery as status.

9. Now we need to edit the build prop to add a line which enables Camera2API for that we will need to start adb shell using the following command.
adb  shell

After entering the command hit enter key

10. Once the adb shell opens up you need to add a line for enabling Camera2api, copy paste the below command and hit enter
setprop 1

11.  After that we need to exit the adb shell using the exit command, enter the command as shown below and hit enter.

12. Now you need to reboot the device, you can do that from the recovery or just by using the following command.
adb reboot

enter the command as shown and hit enter key.

13. That’s it once your device boots up it will have Camera2api enabled and the TWRP which we booted above will be removed (if followed the steps)

Redmi Note 5 Pro, MIUI Stable update without rooting or any issue for updates.

14. Now you can install the Google Camera mods available for your device and install it.

15. This edit may not be lost with incremental OTA updates, but it will be lost incase of full rom updates, factory data reset or by installing fastboot rom, even if it is disabled you can enable it easily by following the above steps again.

Redmi Note 5 Pro updated from MIUI stable version to update and Camera2api is still enabled.

1. It may break some features of your camera in few devices like video calls from dialer app you will need to disable camera2api to bring it back, please proceed with caution.
2. If anything goes wrong you may need to flash fastboot rom so please take full backup of your data before trying out.
3. This process doesn't void your warranty, but still proceed on your own risk.
4. This process may work in any device running on Android Lollipop and above.
5. To disable Camera2api change the step 10 command to setprop 0 and follow all the proccess said here and everything will be normal as before enabling.

Thanks to MiAkash & Lavnidhi for their help and support in doing this guide.

Hope this helps the few users who doesn't want to root but like to use Google Camera Mods.


Number of participants 13 Experience +170 Pack Reason

View Rating Log

2018-05-04 14:08:31
Favorites583 RateRate
Tutorial For You
In the sea of knowledge, let us seek some oysters together. I'm here to share some tutorials on gadgets and software.
55 Article Description     1732 Subscribers


lavnidhi | from mobile


Yes , it works perfectly. I enabled it on my Redmi note 4 and updated via updater and still my api2 is enabled and google cam working.
2018-05-04 21:07:08
Proud Mi Fan


Apiyush265 | from Redmi Note 4


Woohoo!! thanks for it.. really needed and amazing
2018-05-05 06:46:19

MIUI Beta Tester

sanyaanuj | from Redmi 4


wooow great problem solved...
2018-05-05 06:46:59

Mi FC President

DiLshad Sys | from Mi A1


well explained
thanks bro wilk try on rn5p
2018-05-05 06:47:33

MIUI Beta Tester

dgandhi786 | from Redmi Note 4


thaNks a lot bro !!1
2018-05-05 06:50:39

Master Bunny

h8mn | from MIX 2


good info. thankx
2018-05-05 06:51:43
mi mIx2 n many mi goodies

Semi Pro Bunny

Apurv Gupta | from Mi MIX 2


Thanks for this guide. Will try it.
2018-05-05 07:02:25

MIUI Beta Tester

1750087562 | from Redmi 4


wow thanx
2018-05-05 07:16:31
Very nice bro
2018-05-05 07:35:13

MIUI Beta Tester

MAK | from Redmi Note 5 Pro


Awesome, Great Tutorial with complete information, Thank you for sharing..
2018-05-05 07:43:21
please sign in to reply.
Sign In Sign Up

Siva Abhi

Super Moderator

India 2nd year
APP scratch card
6th MIUI
Mi Max
2016 Diwali with Mi
3 Days Check-In
7 Days Check-In
21 Days Check-In
40 Days Check-In
70 Days Check-In
100 Days Check-In
1 Year Check-In
Lucky Draw No.
500K Members
Mi Explorers
App Review
1 million members
June-100 replies in a month
July-100 replies in a month
Aug-100 replies in a month
Sep-100 replies in a month
Oct-100 replies in a month
Nov-100 replies in a month
Dec-100 replies in a month
100 ответов в декабре
1st Anniversary
My Poster My Life
MIUI 7th Anniversary
2 million registered members
Newbie Member
Twitter Medal
Mi Apps
Christmas 2017
2018 New Year Medal
MIUI Instagram
MIUI Beta Tester
Mi Community Updater
Color Your Planet
Color Our Planet Game
STAR Bug Hunter
The Motivator
MIUI Subscriber
MIUI 8th Anniversary
Eid Mubarak
5 Million Registered Users
Mi Music: 20 FREE Downloads
Ringtones Mania
10 Million Downloads
Throwback With Mi 2018
Xiaomi's 9th Birthday
9 Years of MIUI
Dark Mode
Mi-stery Box Game
We Help!
#AnswerMi Vol 1

Read moreGet new
Copyright©2010-2020, All Rights Reserved
Content Policy
Quick Reply To Top Return to the list