How to get IMEI Number From adb Command I am working on adb with my Samsung Galaxy Device. I want to get the IMEI number of the device using adb but I have been unable to do that.

I tried the Following:

    adb shell dumpsys iphonesubinfo


but it returns nothing.

I also tried with Service Call Command:

 adb shell service call iphonesubinfo


but it gives me Strange Result Like this:

  Result: Parcel(                                                        
0x00000000: 00000000 0000000f 00350033 00390038 '........3.5.8.9.'    
0x00000010: 00320037 00380030 00350034 00350031 '7.2.0.8.4.5.1.5.'   
0x00000020: 00300031 00000033                   '1.0.3...        ')


Can anybody Help me out with this?
Given the tag 7.0-nougat, I'm assuming you have or are targeting Android Nougat. Android Nougat comes with toybox which acts as an alternative to busybox and has some useful utilities. I managed to use those tools to print IMEI like this:

adb shell
service call iphonesubinfo 1 | toybox cut -d "'" -f2 | toybox grep -Eo '[0-9]' | toybox xargs | toybox sed 's/\ //g'


Since you wouldn't be getting an interactive shell when using a script or an app, you can pass the commands like this:

adb shell "service call iphonesubinfo 1 | toybox cut -d \"'\" -f2 | toybox grep -Eo '[0-9]' | toybox xargs | toybox sed 's/\ //g'"