Accessing IMEI Number with MacroDroid

simon_FFM

New member
Hi,

is there a possibility in a Macro of accessing the IMEI Number of the Device and store it into a macroDroid Variable? Just looked through the Statements in Set Variable Action and couldn't find an imei expression. I want to access an API for Tracking Purposes for which I need the Imei Number. Due I want to make Macro to be used on several devices I do not want to type them in manually. Is that possible?

Thanks!
 

Josué García

MacroDroid Support
Staff member
Hi,

is there a possibility in a Macro of accessing the IMEI Number of the Device and store it into a macroDroid Variable? Just looked through the Statements in Set Variable Action and couldn't find an imei expression. I want to access an API for Tracking Purposes for which I need the Imei Number. Due I want to make Macro to be used on several devices I do not want to type them in manually. Is that possible?

Thanks!
If I am correct, macrodroid can no longer read the IMEI on android 10 and above, if you have any lower version you can find it in the magic text
 

Dimlos

Well-known member
The IMEI can be obtained by the following command in ADB Shell [Tasker Plugin].
Code:
service call iphonesubinfo 4 | cut -c 52-66 | tr -d '.[:space:]'
Since the output includes characters other than IMEI, it is necessary to extract them using regular expressions, etc.
 

Dimlos

Well-known member
The code is from the internet, but we have confirmed that it works with the following devices.
If there are IMEI1 and IMEI2, only IMEI1 is displayed.

Xiaomi / Redmi 9T / Android 10 --- OK
Xiaomi / Redmi Note 9S / Android 11 --- OK
OPPO / A54 5G / Android 11 --- OK
Xiaomi / Redmi Note 11 / Android 12 --- NG
OPPO / Reno5 A / Android 12 --- OK
SHARP / AQUOS Sense4 lite / Android 12 --- OK
Google / Pixel 5a / Android 13 --- NG
 

Attachments

  • IMEI.macro
    4.2 KB · Views: 14

simon_FFM

New member
The code is from the internet, but we have confirmed that it works with the following devices.
If there are IMEI1 and IMEI2, only IMEI1 is displayed.

Xiaomi / Redmi 9T / Android 10 --- OK
Xiaomi / Redmi Note 9S / Android 11 --- OK
OPPO / A54 5G / Android 11 --- OK
Xiaomi / Redmi Note 11 / Android 12 --- NG
OPPO / Reno5 A / Android 12 --- OK
SHARP / AQUOS Sense4 lite / Android 12 --- OK
Google / Pixel 5a / Android 13 --- NG
Hi Dimlos,
thanks for Your Macro. I have installed the Plugin and Enabled Wifi & Usb Debugging in Development Options - but I get Errorcode:
java.lang.Exception: Device at localhost:5555 has no adb enabled or connection is refused

(Samsung Tab A7, Android 11)
 

Dimlos

Well-known member
When using ADB Shell [Tasker Plugin], you must first connect to the PC and enter the adb command
Code:
adb tcpip 5555
this command is valid until the device is rebooted.
 
Top