adb shell dumpsys iphonesubinfo not working since Android 5.0 Lollipop

前端 未结 4 1584
心在旅途
心在旅途 2020-12-02 21:42

We used to get Device ID/IMEI using the following command:

adb shell dumpsys iphonesubinfo

But since last Android update (5.0 - Lollilop),

4条回答
  •  情话喂你
    2020-12-02 21:49

    i agree with alex P and jeremy we can get phone IMEI by service call but that results in packet which is complicated to see so after so much juggling with cmd as im not a programmer i have found solution to get IMEI alone and decided to share it as it can help to many . so here is script i made to get IMEI from lollypop 5.1 and it works with non rooted phones

    @echo off
    setlocal enabledelayedexpansion
    for /f "tokens=6*" %%a in ('adb shell "service call iphonesubinfo 1 ^| grep -m 1 \"'\""') do (
    set imei1=%%a)
    for /f "tokens=6*" %%b in ('adb shell "service call iphonesubinfo 1 ^| grep -m 2 \"'\""') do (
    set imei2=%%b)
    for /f "tokens=4*" %%c in ('adb shell "service call iphonesubinfo 1 ^| grep -m 3 \"'\""') do (
    set imei3=%%c) 
    set imei=!imei1!!imei2!!imei3!
    echo !imei! > imei.txt
    for /f "delims=" %%d in (imei.txt) do (
    set DeviceIMEI=%%d
    set DeviceIMEI=!DeviceIMEI:'=!
    set DeviceIMEI=!DeviceIMEI:.=!
    set OIMEI=Phone IMEI  !DeviceIMEI!
    )
    echo %OIMEI%
    pause
    

    it will result in " Phone IMEI 'whatever phone IMEI is'" *keep in mind it will only show imei of sim port which is default set for calling. if anyone can short this script it would be great.

提交回复
热议问题