For android versions before 11 I was using the below command to get IMEI number from my device:
adb shell "service call iphonesubinfo 4 | cut -c 52-66 | tr -d '.[:space:]'"
or
adb shell service call iphonesubinfo 1 | toybox cut -d "'" -f2 | toybox grep -Eo '[0-9]' | toybox xargs | toybox sed 's/\ //g'
From android 12 it's not working anymore, these returns nothing
Can someone help with it ?