Android/adb/shell

From Bask
Jump to navigation Jump to search

useful commands i Android 8.0.0

Get IMEI:

adb shell 'service call iphonesubinfo 1 | grep -o "[0-9a-f]\{8\} " | tail -n+3 | while read a; do echo -n "\u${a:4:4}\u${a:0:4}"; done'

Get IMSI:

adb shell 'service call iphonesubinfo 8 | grep -o "[0-9a-f]\{8\} " | tail -n+3 | while read a; do echo -n "\u${a:4:4}\u${a:0:4}"; done'

Get ICCID:

adb shell 'service call iphonesubinfo 13 | grep -o "[0-9a-f]\{8\} " | tail -n+3 | while read a; do echo -n "\u${a:4:4}\u${a:0:4}"; done'

list of service call transaction codes in android-5.0.0_r1

 1  getDeviceId
 2  getDeviceIdForSubscriber
 3  getImeiForSubscriber
 4  getDeviceSvn
 5  getSubscriberId
 6  getSubscriberIdForSubscriber
 7  getGroupIdLevel1
 8  getGroupIdLevel1ForSubscriber
 9  getIccSerialNumber
10  getIccSerialNumberForSubscriber
11  getLine1Number
12  getLine1NumberForSubscriber
13  getLine1AlphaTag
14  getLine1AlphaTagForSubscriber
15  getMsisdn
16  getMsisdnForSubscriber
17  getVoiceMailNumber
18  getVoiceMailNumberForSubscriber
19  getCompleteVoiceMailNumber
20  getCompleteVoiceMailNumberForSubscriber
21  getVoiceMailAlphaTag
22  getVoiceMailAlphaTagForSubscriber
23  getIsimImpi
24  getIsimDomain
25  getIsimImpu
26  getIsimIst
27  getIsimPcscf
28  getIsimChallengeResponse
29  getIccSimChallengeResponse