This question already has answers here:
Android ADB commands to get the device properties
(4 answers)
Closed 7 years ago.
Can one use adb or adb shell commands to get attached emulator/device OS info, i.e. API version?
To get Android version you can use:
adb shell getprop ro.build.version.release
to get API level:
adb shell getprop ro.build.version.sdk
You can see all available properties with this command:
adb shell getprop
I know , you already got the correct solution , & here is my solution only for additional information.
You will get every details by cat ing the /system/build.prop file like
adb shell cat /system/build.prop
Here is collection of adb commands
For all properties:
adb shell getprop
Related
This question already has answers here:
How to use ADB Shell when Multiple Devices are connected? Fails with "error: more than one device and emulator"
(15 answers)
Closed 4 years ago.
I have one login script written to login to my device, when multiple devices are connected, how to run that script in particular device.
login.sh
adb shell input text abc#def.com
adb shell input keyevent 61
adb shell input text abc123
adb shell input keyevent 61
When multiple devices are connected you can retrieve the list with adb devices :
$ adb devices
List of devices attached
017296d5904c device
192.168.56.101:5555 device
Then, you can target a particular device by using the -s option :
adb -s 017296d5904c shell input keyevent 61
source
The final step is to iterate on your devices list with a for loop and run your commands.
I would like to know how to retrieve specific hardware information, for example, from the camera, using an adb command. I would like to know if its possible to retrieve hardware ID or Physical device object name for example, to store these values.
Sdk:
adb shell getprop ro.build.version.sdk
Complete list:
adb shell getprop
Through the package manager:
adb shell pm list features
To retrieve detailed information about the camera
adb shell dumpsys media.camera
adb shell getprop
replace x with the prop. you want
This question already has answers here:
Change Device language via ADB
(14 answers)
Closed 7 years ago.
I'm new in android automation and i've been working on adb commands to help me with tests on a physical device.
Is there a way to change the language of the device under test via adb?
I found the command below:
adb shell am start -n com.android.settings/.Settings -e :android:show_fragment com.android.settings.LocalePicker
Not worked. I also tried via shell with:
adb shell setprop persist.sys.language pt
But it didn't worked too.
I use the following to open locale settings in one of my applications:
final Intent intent = new Intent(Settings.ACTION_LOCALE_SETTINGS);
context.startActivity(intent);
The ACTION_LOCALE_SETTINGS constant is defined as follows:
public static final String ACTION_LOCALE_SETTINGS = "android.settings.LOCALE_SETTINGS";
So this should work:
adb shell am start -a android.settings.LOCALE_SETTINGS
I searched a lot for this in Google, but no hope, how to check the OS version of Bluestacks emulator in Windows? There is a video in YouTube for checking bluestack version, but not the Android version used in it.
I went to settings – > Advanced settings, but there was no tab corresponding to About tab which is found in an Android emulator like in the case of Genymotion emulator.
There is an easier way of getting to know the android version without having to install any application.
There are some scripts (php/js) that can detect your android version while visiting websites:
Try; http://demo.mobiledetect.net/ Or;
http://detectmobilebrowsers.com/
Install Terminal Emulator from Play Store, open the application and type:
getprop ro.build.version.release
you will get something like: 4.4.4 for KitKat.
or
getprop ro.build.version.sdk for getting the sdk version which will return 19
Open a browser in Bluestacks and go to http://demo.mobiledetect.net
I have tested this on multiple devices of which the Android version is known, and it is accurate.
Currently responds to Bluestacks as v4.4.2 (Kitkat)
Without any installation, you could use your adb commands.
For example, for your main emulator
adb -s emulator-5554 shell getprop ro.build.version.release
adb -s emulator-5554 shell getprop ro.build.version.sdk
For your multi emulators add up by 10,
adb -s emulator-5564 shell getprop ro.build.version.release
adb -s emulator-5564 shell getprop ro.build.version.sdk
adb -s emulator-5574 shell getprop ro.build.version.release
adb -s emulator-5574 shell getprop ro.build.version.sdk
//... so on
You could also do the shell commands by their local ip,
adb -s 127.0.0.1:5555 shell getprop ro.build.version.release
adb -s 127.0.0.1:5555 shell getprop ro.build.version.sdk
adb -s 127.0.0.1:5565 shell getprop ro.build.version.release
adb -s 127.0.0.1:5565 shell getprop ro.build.version.sdk
adb -s 127.0.0.1:5575 shell getprop ro.build.version.release
adb -s 127.0.0.1:5575 shell getprop ro.build.version.sdk
//... so on
just use Droid Info .. which gives you alot of Information quite easely.
This question already has answers here:
adb shell su works but adb root does not
(11 answers)
Closed 5 years ago.
After rooting my device, I need to run adb root and then adb shell so I could then access my applications database. When trying to run adb root I keep getting "adbd cannot run as root in production builds". Why is this? The only other option is to use the Android emulator for testing, but we all know how terrible the emulator is (not really a viable development solution).
I finally found out how to do this! Basically you need to run adb shell first and then while you're in the shell run su, which will switch the shell to run as root!
$: adb shell
$: su
The one problem I still have is that sqlite3 is not installed so the command is not recognized.