adb 判断imei,通过adb shell获取第二个imei号

本文介绍如何通过adb shell命令及service call获取Android设备的第二个IMEI号,包括使用`service call iphonesubinfo`的具体步骤和示例。适用于有多个IMEI需求的开发者或技术人员。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

I was able to get one imei number through adb shell with command

adb shell service call iphonesubinfo 1

But device has two imei numbers ,

How to get second imei number through adb shell

The output of adb shell service call iphonesubinfo 1 is as below (which is inbetween quotes)

Result:

Parcel(

0x00000000: 00000000 0000000f 00320031 00340033 '........1.2.3.4.'

0x00000010: 00360035 00380037 00300039 00380039 '5.6.7.8.9.0.9.8.'

0x00000020: 00360037 00000035 '7.6.5... ')

imei=123456789098765

Help me to find second imei......

解决方案

Yes, you can get both IMEI with service call iphonesubinfo.

Though the order in which they are fetch is not always definite in my experience, but you can always fetch both and compare to one if you need to.

/system/bin/service call iphonesubinfo 3 i32 1 | cut -d\' -f2 | sed -e 's/[^0-9]//g' | tr -d '\n'

/system/bin/service call iphonesubinfo 3 i32 2 | cut -d\' -f2 | sed -e 's/[^0-9]//g' | tr -d '\n'

You can substitute /system/bin/service with adb shell service if you are running from adb and not from device shell.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值