get cellinfo with adb shell


Question

I have just installed adb and I am trying to retrieve information on the cellular tower which my phone is connected to. My phone is a Samsung Galaxy Trend Lite running Jelly Bean OS (4.1.2). I have rooted the phone and I am using the adb shell as super user.



I tried to use dumpsys telephony.registry from the shell, which gave me a cellInfo parameter, but it's equal to null.



I would like to retrieve a string with info like MCC, MNC, LAC, and CID possibly. Is this feasible? Is this the right way or is there a better one?



UPDATE 1



As suggested by @xavier_fakerat I opened a terminal in ubuntu and I typed adb logcat | grep -E 'MCC|MNC'. However I received the following message which does not seem useful to me (maybe I'm wrong...)



I/SA ( 2688): [OR] onReceive log=[SA = 1.6.0125 V = 16 HWD = 800X480 1.5 dpi = 240 SIZE = 2 LOCALE = it_IT CSC = ITV MCC = 0 MNC 0 T = user DEVICE = kylevess P = kylevessxx I = JZO54K M = GT-S7390 OKLEFT false DIS JZO54K.S7390XXUAOI1 PSS = 3.979127307850313 ]


UPDATE 2



I also tried the suggestion of @Ali Said and I was able to get the cid, although the output sometimes is equal to 0, sometimes is 68. I did the second option he proposed



adb logcat -b radio | grep "cid"


and received many rows like



D/RIL
  ( 1391): RIL:[AP][RPC EN] msgid=0x413a str=MSG_MS_GET_ELEMENT_REQ tid 472 cid 68


or



D/RIL
  ( 1391): RIL:[AP][RPC DE] msgid=0x204 str=MSG_RSSI_IND tid 0 cid 0


So now I think I am left with finding the LAC code only. Nevertheless, none of the solutions so far allowed me to retrieve all the info i was looking for at the same time. Also, option 1 of @Ali Said (adb logcat -b radio | grep ": +CREG:") seems what I REALLY need, but it doesn't output anything. Maybe it's a matter of the +CREG command (if it is an AT command as far as I can understand), which is not supported by my phone. Just a guess, I went very far for my possibilities, but I am pretty sure I am approaching the solution...



Finally, the output from adb logcat -b radio | grep "MCC" is



D/RIL ( 1391): GetSamsungPLMNname:: GetSamsungPLMNname :: deci MCC=222, MNC=88



while here is a link to the logcat from the cid info. Hope this could be of interest if someone wants to help me out.


Answer

Both of these worked for me:



Option1: grep AT command for cell info



$> adb logcat -b radio | grep ": +CREG:" 
D/AT ( 873): +CREG: 2,1,"2444","0FA2A694",6
D/AT ( 873): +CREG: 2,1,"2444","0FA2A694",6
D/AT ( 873): +CREG: 2,1,"2444","0FA2A694",6


[1] phone is registered with the network
[2444] hex : Location Area Code (LAC)
[0FA2A694] hex : Cell Id (cid).



Option 2 : you can grep "cid" from logact -b radio you should get it this. note it is decimal this time.



$> adb logcat -b radio | grep "cid"
D/use-Rlog/RLOG-RIL( 9193): cid: 262317716
D/use-Rlog/RLOG-RIL( 9193): cid: 262317716
D/use-Rlog/RLOG-RIL( 9193): cid: 262317716





Option1 is my personal preference. hope that helps.


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes