Home > Tips and Tricks

How to Fix Invalid IMEI on any MediaTek via ADB Commands

In this guide, we will show you the steps to fix the invalid IMEI on your MediaTek device using ADB Commands. When you step into custom development, there’s a plethora of tweaks and modifications available for you to try out. From flashing custom ROMs to installing a custom recovery like TWRP, the possibilities stand endless. Along the same lines, you could also gain administrative privileges by rooting your device via Magisk. However, each of these customizations does bring in a few risks as well.

If you don’t flash the mods correctly or flash them to the incorrect partitions, then you are inviting trouble. In this regard, you could easily repair most of these partitions by flashing its stick counterpart via Fastboot Commands. However, it is the repairing of NVRAM or EFS Partition that could prove to be a challenging task. For the unaware, this partition holds your device IMEI number. So if there are any issues with NVRAM/EFS, then there is a high possibility of losing the IMEI number,

Well, this is the last thing that you would want to happen. In this regard, there do exist a few third-party tools such as Modem Meta, Maui Meta, and the likes. However, most of the users prefer to maintain a safe distance from such tools, and so do I. Therefore, I looked out for some alternatives and then stumbled upon a pretty nifty method to fix the invalid IMEI on your MediaTek device using just the ADB Commands. And in this guide, we will be sharing this method with you all. So without any further ado, let’s get started.

How to Fix Invalid IMEI on any MediaTek via ADB Commands

How to Fix Invalid IMEI on any MediaTek via ADB Commands

The below instructions are listed under separate sections for ease of understanding. Make sure to follow in the exact same sequence as mentioned. Droidwin and its members wouldn’t be held responsible in case of a thermonuclear war, your alarm doesn’t wake you up, or if anything happens to your device and data by performing the below steps.

STEP 1: Install Android SDK

install adb platform tools windows

First and foremost, you will have to install the Android SDK Platform Tools on your PC. This is the official ADB and Fastboot binary provided by Google and is the only recommended one. So download it and then extract it to any convenient location on your PC. Doing so will give you the platform-tools folder, which will be used throughout this guide.

STEP 2: Enable USB Debugging and OEM Unlocking

Next up, you will also have to enable USB Debugging and OEM Unlocking on your device. The former will make your device recognizable by the PC in ADB mode. This will then allow you to boot your device to Fastboot Mode. On the other hand, OEM Unlocking is required to carry out the bootloader unlocking process.

Fix Invalid IMEI on MediaTek via ADB Commands

So head over to Settings > About Phone > Tap on Build Number 7 times > Go back to Settings > System > Advanced > Developer Options > Enable USB Debugging and OEM Unlocking.

STEP 3: Unlock the Bootloader

The process also requires an unlocked bootloader. Do keep in mind that doing so will wipe off all the data and could also nullify the device’s warranty. So if that is all well and good, then please refer to our comprehensive guide to How to Unlock Bootloader of Any Android Device.

STEP 4: Root MediaTek Device

Next up, you will have to root your MediaTek device in order to gain admin-level privileges as well as access to the system partition. So please refer to our detailed tutorials:

STEP 5: Fix Invalid IMEI on MediaTek via ADB Commands

  1. Connect your device to the PC via USB cable. Make sure USB Debugging is enabled.
  2. Then head over to the platform-tools folder, type in CMD in the address bar, and hit Enter. This will launch the Command Prompt.
  3. Type in the following command in the CMD window to open the shell window:
    adb shell
  4. Then execute the below command in the CMD window to get the SuperUser access on your device
    su

    fix imei on mediatek using adb commands

  5. You will now get a prompt on your device, make sure to Allow/Grant it.
  6. Now type in the below command to write the IMEI on SIM 1 (make sure to replace 123456789012345 with your IMEI number)
    echo 'AT +EGMR=1,7,"123456789012345"'>/dev/radio/pttycmd1
  7. Then type in the following command to write the IMEI on SIM 2 (again, make sure to replace 123456789012345 with your IMEI number)
    echo 'AT +EGMR=1,10,"123456789012345"'>/dev/radio/pttycmd1
  8. That’s it, you may now restart your phone for the IMEIs to be saved.

So with this, we round off the guide on how you could fix the invalid IMEI on your MediaTek device using ADB Commands. If you have any queries concerning the aforementioned steps, do let us know in the comments. We will get back to you with a solution at the earliest.

Share:
  • I didn’t succeed on the Redmi Note 10 5G, I only got a confirmation for the “su” command, after entering the IMEI it didn’t accept them…

  • Angelo Agustin M. Carlon

    Hi Im using custom ROM Android 12 AOSP, but sadly the steps above didn’t work. Also, I noticed many pttycmd in that folder, Is it OK to echo to all of those pttycmd just to try?

  • Faisal Baloch

    A technical geek by birth, he always has a keen interest in the Android platform right since the birth of the HTC Dream. The open-source environment always seems to intrigue him with the plethora of options available at his fingertips. “ Video Crater and Blogger ” Love From Pakistan City Gwadar.

  • Thank you very much for this solution. I busted my head for days trying to find solution. May God help you in your life on your way forward.

    • Hola….el problema que encuentro es que cuando ejecutó este método u otros como aplicaciones y reinicio tengo cuelgues y cuando reinicia el IMEI no está. Hay algo que impide escribirlo. Saludos