diff --git a/src/com/android/phone/TelephonyShellCommand.java b/src/com/android/phone/TelephonyShellCommand.java
index 3cff658..b158588 100644
--- a/src/com/android/phone/TelephonyShellCommand.java
+++ b/src/com/android/phone/TelephonyShellCommand.java
@@ -172,6 +172,7 @@
             "set-allowed-network-types-for-users";
     // Check if telephony new data stack is enabled.
     private static final String GET_DATA_MODE = "get-data-mode";
+    private static final String GET_IMEI = "get-imei";
     // Take advantage of existing methods that already contain permissions checks when possible.
     private final ITelephony mInterface;
 
@@ -328,6 +329,8 @@
                 return handleAllowedNetworkTypesCommand(cmd);
             case GET_DATA_MODE:
                 return handleGetDataMode();
+            case GET_IMEI:
+                return handleGetImei();
             case RADIO_SUBCOMMAND:
                 return handleRadioCommand();
             default: {
@@ -382,6 +385,7 @@
         onHelpDisableOrEnablePhysicalSubscription();
         onHelpAllowedNetworkTypes();
         onHelpRadio();
+        onHelpImei();
     }
 
     private void onHelpD2D() {
@@ -685,6 +689,15 @@
         pw.println("    the result would be 'unknown'.");
     }
 
+    private void onHelpImei() {
+        PrintWriter pw = getOutPrintWriter();
+        pw.println("IMEI Commands:");
+        pw.println("  get-imei [-s SLOT_ID]");
+        pw.println("    Gets the device IMEI. Options are:");
+        pw.println("      -s: the slot ID to get the IMEI. If no option");
+        pw.println("          is specified, it will choose the default voice SIM slot.");
+    }
+
     private int handleImsCommand() {
         String arg = getNextArg();
         if (arg == null) {
@@ -1919,6 +1932,37 @@
         return result ? 0 : -1;
     }
 
+    private int handleGetImei() {
+        // Verify that the user is allowed to run the command. Only allowed in rooted device in a
+        // non user build.
+        if (Binder.getCallingUid() != Process.ROOT_UID || TelephonyUtils.IS_USER) {
+            getErrPrintWriter().println("Device IMEI: Permission denied.");
+            return -1;
+        }
+
+        final long identity = Binder.clearCallingIdentity();
+
+        String imei = null;
+        String arg = getNextArg();
+        if (arg != null) {
+            try {
+                int specifiedSlotIndex = Integer.parseInt(arg);
+                imei = TelephonyManager.from(mContext).getImei(specifiedSlotIndex);
+            } catch (NumberFormatException exception) {
+                PrintWriter errPw = getErrPrintWriter();
+                errPw.println("-s requires an integer as slot index.");
+                return -1;
+            }
+
+        } else {
+            imei = TelephonyManager.from(mContext).getImei();
+        }
+        getOutPrintWriter().println("Device IMEI: " + imei);
+
+        Binder.restoreCallingIdentity(identity);
+        return 0;
+    }
+
     private int handleUnattendedReboot() {
         // Verify that the user is allowed to run the command. Only allowed in rooted device in a
         // non user build.
