You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

如何通过ADB命令获取高API级别设备及三星Galaxy设备的IMEI

Fixing ADB IMEI Retrieval on Samsung Galaxy Devices

Hey there, I see you're struggling to pull the IMEI from your Samsung Galaxy via ADB—let's get this sorted out.

Why Your Current Commands Aren't Working

  • The adb shell dumpsys iphonesubinfo command is restricted on most modern Samsung devices (and newer Android versions) due to tightened permission controls. Regular ADB shell users don’t have access to this service anymore, which is why you’re getting no output.
  • When you ran adb shell service call iphonesubinfo without specifying the method number, you triggered a generic call that returns raw Parcel data. That messy hex output actually contains your IMEI—it just needs a little parsing.

Method 1: Parse the Raw Parcel Output

The Parcel data you received uses UTF-16 encoding for the IMEI string. Here’s how to extract it:

  1. Skip the initial hex values (the first 8 bytes in your example: 00000000 0000000f) and focus on the rest. In your output, that’s 00350033 00390038 00320037 00380030 00350034 00350031 00300031.
  2. Each pair of bytes starting with 00 maps to an ASCII character. For example:
    • 0033 → '3'
    • 0035 → '5'
    • 0038 → '8'
  3. Extract these characters in order, and you’ll get your full IMEI. For your sample output, that would be 35897208451510 (double-check against your device’s actual IMEI to confirm the order).

To make this easier, run the specific service call command targeting the IMEI retrieval method directly:

adb shell service call iphonesubinfo 1

(Note: On some Android 10+ devices, use 2 instead of 1 if the above doesn’t work.)
This returns a Parcel focused solely on the IMEI, making parsing faster.

Method 2: Use Alternative Commands (No Parsing Needed)

If hex parsing feels like a hassle, try these simpler commands that work on most Samsung devices:

  • Telephony Registry Dump:
    adb shell dumpsys telephony.registry | grep mDeviceId
    
    This will return a line like mDeviceId=35897208451510—just grab the value after the equals sign.
  • System Property Check:
    adb shell getprop ril.deviceid
    
    Many Samsung devices store the IMEI in this system property, which you can pull directly.

Note About Root Access

If none of the above work, your device might have stricter security controls. If your device is rooted, try running the commands with root privileges:

adb root
adb shell dumpsys iphonesubinfo

Root access grants full access to restricted services, so this should return the IMEI directly if other methods fail.

内容的提问来源于stack exchange,提问作者yash

火山引擎 最新活动