There is a question about Getting IMEI number using ADB commands Android 12.
adb root
adb shell "service call iphonesubinfo 1 i64 0 | cut -c 52-66 | tr -d '.[:space:]'"
I tested the method, and it works well on Android 12.
But from android 13 on, it just returns an error message: "Package does not belong to ..."
Does anyone can help? Thanks!
Below ADB command uses UIAutomator of Android.
Method: Call app -> *#06# -> Get value
You can edit to get IMEI1, IMEI2, SN. My phone is Samsung Galaxy, if you use other phone brands, edit it accordingly.
Note: Not work when your phone is locked