Device = Redmi 5 Plus.

I have 250 apps as a .bak created by PC app. But the cheater PC app is asking for premium to restore it now. So, I can extract the .bak and find my apps.

I wanted to batch install those apks. I tried adb install apkname.apk to check if it works. But the phone keeps prompting me to accept the install and countdown starts, or else it will auto deny after countdown finishes. I've also tried 3rd-party app like ApkInstaller but it's the same.

I read many articles and they say it works without prompt. So, why am I getting this issue? How to bypass this prompt automatically?

  • there is a similar question i just found searching about it (but not a duplicate ), i see that as me you want a batch/cmd solution but only got a linux one, so here it is: android.stackexchange.com/a/214145 that is a very complete answer that show how to do it. and this is a very compact and simple one, android.stackexchange.com/a/229080 , i just tested it and it still works.
    – bigubr
    Jun 7, 2021 at 1:31
  • UPDATE: So, in the end, it seems the problem was the 'MIUI optimization' feature. After I turned it off the batch install command works fine.
    – NKoyee
    Aug 9, 2021 at 10:23

1 Answer 1


In addition to adb install, you can directly use package manager from adb shell to install apps. Place .apk files in /data/local/tmp and make sure files are readable, SELinux context must be u:object_r:shell_data_file:s0. Now:

~$ cd /data/local/tmp
~$ ls *.apk | xargs -I {} pm install '{}'

Another simple root solution is to use some file explorer e.g. MiXplorer to batch install apps. Select all .apk files and tap on Install from menu.

  • Thank you Irfan for answering. But can you explain what the SELinux context here means? And what the commands are doing and what they mean. I tried copying an apk to the 'data/local/tmp' and did the 'adb shell' but after that all the commands are coming "permission denied". And the MiXplorer that you suggested is not free. I tried the other installer but they do ask for the permission.
    – NKoyee
    Jul 16, 2019 at 15:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .