ADB shell command like linux hwinfo? - Other Tools & General Discussion

I'm trying to find out how to list the hardware present in my phone- in particular what gsm radio hardware I have compared to other variants of my phone.
I've looked at adb shell commands and tried "dumpsys hardwareinfo" but nothing is displayed.
If anyone could point me in the right direction would be very grateful,

Related

Is this coming for us?

http://forum.androidcentral.com/thunderbolt-rooting-roms-hacks/77617-auto-root-unroot-windows.html
We already have almost the same thing(I think, I haven't used either). They both do the same thing, push files to your phone and automate the commands so you don't have to use adb

Obtain MSL code on Linux/Unix

How to find the MSL for your Photon Q
chrisngrod posted a tool for getting the MSL from logcat (http://forum.xda-developers.com/showthread.php?p=31765156) but is in the form of a .bat script, which isn't very useful for Mac or Linux users. I'm a decently regular reader, but I guess I've never posted. So sorry that this isn't in the dev section.
I'm assuming a couple things here
You have the android SDK installed, or at least adb available to you
You have a Motorola Photon Q (on Sprint?) plugged into your computer and appropriate drivers installed (if needed--not sure)
USB Debugging is enabled on your device
You know what a terminal is, or at least how to use one
You are in the current directory of adb. If it's in your path, omit the "./"
Make sure your computer sees your phone
Code:
./adb devices
You should see something like
Code:
List of devices attached
T*******Y device
where *'s are numbers. If you don't see any devices, make sure nothing else is interfering (tethering apps on computer, etc)
Now, go to the dialer on your phone, and dial ##DATA#. A menu should pop up, tap on Data Profile, then the three dots at the top right, and finally Edit. Enter 6 random digits, and click Verify.
Now go back to your computer and run this
Code:
./adb logcat -b radio -d | grep "grde"
Hopefully you'll only see one line. If there's more than one, look for one that looks like this
Code:
09-21 21:56:38.837 360 360 E RIL-MOTEXT: NV Read 32, length 6, data length 6, grde - 313934333230
The last set of numbers is what we care about. Your MSL is encoded in the even digits (in counting i.e. 2, 4 ,6 ,8 ..). Mine happened to be hidden in some 3's. So this phone's MSL is 194320.
Test it out by going back to your phone and typing it in.
This worked for me, and I haven't found anywhere else that talked about doing it for the Photon Q, so please correct any incorrect information.
asinginglamp said:
How to find the MSL for your Photon Q
Now go back to your computer and run this
Code:
./adb logcat -b radio -d
Hopefully you'll only see one line. If there's more than one, look for one that looks like this
Code:
09-21 21:56:38.837 360 360 E RIL-MOTEXT: NV Read 32, length 6, data length 6, grde - 313934333230
The last set of numbers is what we care about. Your MSL is encoded in the even digits (in counting i.e. 2, 4 ,6 ,8 ..). Mine happened to be hidden in some 3's. So this phone's MSL is 194320.
Click to expand...
Click to collapse
I was able to do this with only the phone and connectbot. Putting in a false code and then looking over logcat for the NV Read 32, Mine was also hanging out with a group of 3s.
KitsunePaws said:
I was able to do this with only the phone and connectbot. Putting in a false code and then looking over logcat for the NV Read 32, Mine was also hanging out with a group of 3s.
Click to expand...
Click to collapse
Nice. I tried doing it with aLogcat, but didn't see anything. Didn't think to try connectBot.
with me it was between the 3's, i copied the msl.bat to the ADB-platform tools folder what i use for compiling-decompiling apk's, and it worked.
This Is Cray
Gojira-r32 said:
with me it was between the 3's, i copied the msl.bat to the ADB-platform tools folder what i use for compiling-decompiling apk's, and it worked.
Click to expand...
Click to collapse
err
i tried this method the only thing i see on the transcript using adb logcat is checksubsidylockpasswrdcomplete<>errorno=RIL_OEM_CDMA_GENERIC_FAILURE..
Like ive tried everything, any suggestions..besides call sprint
batzluminatti said:
err
i tried this method the only thing i see on the transcript using adb logcat is checksubsidylockpasswrdcomplete<>errorno=RIL_OEM_CDMA_GENERIC_FAILURE..
Like ive tried everything, any suggestions..besides call sprint
Click to expand...
Click to collapse
Do you get anything with adb logcat?
???
asinginglamp said:
How to find the MSL for your Photon Q
chrisngrod posted a tool for getting the MSL from logcat (http://forum.xda-developers.com/showthread.php?p=31765156) but is in the form of a .bat script, which isn't very useful for Mac or Linux users. I'm a decently regular reader, but I guess I've never posted. So sorry that this isn't in the dev section.
I'm assuming a couple things here
You have the android SDK installed, or at least adb available to you
You have a Motorola Photon Q (on Sprint?) plugged into your computer and appropriate drivers installed (if needed--not sure)
USB Debugging is enabled on your device
You know what a terminal is, or at least how to use one
You are in the current directory of adb. If it's in your path, omit the "./"
Make sure your computer sees your phone
Code:
./adb devices
You should see something like
Code:
List of devices attached
T*******Y device
where *'s are numbers. If you don't see any devices, make sure nothing else is interfering (tethering apps on computer, etc)
Now, go to the dialer on your phone, and dial ##DATA#. A menu should pop up, tap on Data Profile, then the three dots at the top right, and finally Edit. Enter 6 random digits, and click Verify.
Now go back to your computer and run this
Code:
./adb logcat -b radio -d | grep "grde"
Hopefully you'll only see one line. If there's more than one, look for one that looks like this
Code:
09-21 21:56:38.837 360 360 E RIL-MOTEXT: NV Read 32, length 6, data length 6, grde - 313934333230
The last set of numbers is what we care about. Your MSL is encoded in the even digits (in counting i.e. 2, 4 ,6 ,8 ..). Mine happened to be hidden in some 3's. So this phone's MSL is 194320.
Test it out by going back to your phone and typing it in.
This worked for me, and I haven't found anywhere else that talked about doing it for the Photon Q, so please correct any incorrect information.
Click to expand...
Click to collapse
The first command works..Recognizes dev, then the logcat command works ONLY when i leave off at the -d. When i do the process i see the RI-MOTEXTem Hook header type 0, requestcode 0x2000016...blah blah blah..how do i write the second part of the comand..?
msl
I ran into that error- OEMRequestunlock thingy.... I tried looking through myself with alogcat, but nothing... at the time I thought I fixed it by downgrading the android OS... then the .bat still didn't work... I figured out that that was because of the path statement not including the location of findstr.exe (grep in this linux example) but now I think that maybe the .bat file didn't work originally because of the path statement and I maybe didn't have to downgrade the OS, but if you're straight up doing it by typing the command into terminal and with grep no less and encountering the problem, then I'll bet it was necessary to downgrade the OS.
So what I'm saying is- you probably have to downgrade the Android OS to one that has the MSL in the ril. Also, it might not be showing up in aLogcat because you'd have to tell it to read the radio log (which is what the -radio switch does)
Hope this helps
I made one phone call to Sprint tech support and simply asked for my MSL, and the lady gave it to me. No questions asked.

adb shell - funky color codes or something

When I adb shell from windows command prompt, I get some type of encoding symbols, I think colors or something, making it pretty much unusable. I've used it before and this didn't happen, so perhaps something in the CM version I'm using, or perhaps some windows setting I accidentally changed.
Any help would be appreciated.
I'm using CM11-20150809-UNOFFOCIAL-moto_msm8960_jbbl with mionica's kernel.
I suspect you are correct - if you used a linux command prompt, it would probably be fine...
You could try changing to UTF-8. In cmd:
Check what it's set to currently:
Code:
chcp
Mine is 437. Try changing to 65001
Code:
chcp 65001
Found this info here:
http://www.javawebdevelop.com/2824222/
Hopefully it helps, never had this issue myself before.
arrrghhh said:
You could try changing to UTF-8. In cmd:
Check what it's set to currently:
Code:
chcp
Mine is 437. Try changing to 65001
.
Click to expand...
Click to collapse
Thanks for reply. I was 437, tried 65001, no luck. It did change things very slightly, the backwards arrows now come out as square boxes, but all the rest of the codes still there.
I've also searched for solution myself. One was to open adb shell from a cygwin shell piped thru cat (adb shell | cat) , which kinda works. It hides the color codes, but other things don't work exactly right, like prompt jumps to top of page when I login or su, but without clearing the screen, so it's overwriting existing text, and other weird things not spacing themselves right, etc... also up/down arrows don't respond right in nano text editor.
I used to be able to just adb shell from regular command prompt and everything worked fine, so I suspect the change in behavior is either my cm version, kernel version, or less likely something I changed in windows or phone settings.
I tried ansicon, that made things worse.
I also read something about busybox settings, but I don't have busybox installed so not sure if it's related.

Sending Android Keyevents via Leonardo Arduino

I hope I am posting this to the right forum, if not, can someone point me to a more appropriate one.
I am trying to send keyevent commands from my Leonardo Arduino to my Android tablet, part of a head unit. I can send the commands via ADB shell on my laptop, but I cannot figure out how to send them via the arduino.
I have been looking for weeks on how to do this, I have gotten some close hits (http://www.instructables.com/id/USB-Pedal-HID-Keyboard-With-Arduino-Leonardo/) but they are in the area of sending the standard ASCII keyboard codes, and I am looking to send screen diming/brighten and sleep/wake.
Has anyone had experience in this area?
Thanks,
-Erik
I have noticed that I can execute an "input keyevent" in a serial terminal via a USB keyboard, but the instruction is just ignored, no errors, and if I just type "input" it gives me the usage method so I know it is there. Does the Android need to be rooted to execute the command, or is it a permission issue?
Thanks,
-Erik

Change Android settings with ADB?

Hi, I'd like to know if it's possible (and if so, how) to directly change android settings via adb commands.
My wife has broken the LCD screen on her phone (OnePlus 7T HD1907, Android 11, rooted with Magisk). I'm having a lot of trouble getting screen mirroring and USB OTG input devices to work at the same time; I have a USB v3 hub, and a USB OTG connector, but I've only been able to consistently get either screen mirroring or input devices to work, not both at the same time. The screen on the phone has now completely failed so I can no longer switch back and forth between the two to make changes on the phone. When I did have it working briefly I turned on the "experimental desktop mode on secondary displays" in Developer Settings, which just made things worse because Android settings don't seem to be available in desktop mode.
I have an identical phone to which I can refer, if needed.
Feenix0 said:
Hi, I'd like to know if it's possible (and if so, how) to directly change android settings via adb commands.
My wife has broken the LCD screen on her phone (OnePlus 7T HD1907, Android 11, rooted with Magisk). I'm having a lot of trouble getting screen mirroring and USB OTG input devices to work at the same time; I have a USB v3 hub, and a USB OTG connector, but I've only been able to consistently get either screen mirroring or input devices to work, not both at the same time. The screen on the phone has now completely failed so I can no longer switch back and forth between the two to make changes on the phone. When I did have it working briefly I turned on the "experimental desktop mode on secondary displays" in Developer Settings, which just made things worse because Android settings don't seem to be available in desktop mode.
I have an identical phone to which I can refer, if needed.
Click to expand...
Click to collapse
I don't know if it contains your specific setting, however, many settings can be read/stored/modified using the foillowing commands from a shell/ADB. using
Code:
# read settings, there are three partitions. Secure, System & Global
settings list secure;
settings list system;
settings list global;
# to read a specific one
settings get secure "sleep_timeout";
# to change a setting
settings put secure "sleep_timeout" "-1";
# there's another command for delete, but I cnat remember it for certain, so dont wish to guess and lead you astray ;) and I am sure you know how to do a web search
The above is for a shell, adding adb shell to the front would run it explicitly from adb.
Trying to change system settings requires Android is rooted.
xXx yYy said:
Trying to change system settings requires Android is rooted.
Click to expand...
Click to collapse
It is.
DiamondJohn said:
I don't know if it contains your specific setting, however, many settings can be read/stored/modified using the foillowing commands from a shell/ADB. using
Code:
# read settings, there are three partitions. Secure, System & Global
settings list secure;
settings list system;
settings list global;
# to read a specific one
settings get secure "sleep_timeout";
# to change a setting
settings put secure "sleep_timeout" "-1";
# there's another command for delete, but I cnat remember it for certain, so dont wish to guess and lead you astray ;) and I am sure you know how to do a web search
The above is for a shell, adding adb shell to the front would run it explicitly from adb.
Click to expand...
Click to collapse
Would I simply type "adb shell" to start the shell after connecting to the device? I'm assuming that this would be a linux shell.
xXx yYy said:
Trying to change system settings requires Android is rooted.
Click to expand...
Click to collapse
I am pretty sure that not ALL settings require root to be changed.
Feenix0 said:
It is.
Click to expand...
Click to collapse
Well, that makes it hypothetical in this case
Feenix0 said:
Would I simply type "adb shell" to start the shell after connecting to the device? I'm assuming that this would be a linux shell.
Click to expand...
Click to collapse
There are many ways to do things.
Personally (if not using the app I created and listed below), I start a shell with adb shell and I am running windows, so that is run from a command shell.
At that point, you enter the ANDROID shell (Not linux, its an android device)
I then change to a root shell with su; Only because anything worth doing usually requires root, and at least some of these will.
And then I can run any of the statements above. I would suggest you run a list of each and save that off as a backup.
Another option to see many of these in action and generate a "restore" of the existing, is using the app I created called TeMeFI
You can find these under the menu Current State>Settings>*

Categories

Resources