Get/set imei number with adb for android phones [duplicate] - android

This question already has answers here:
adb shell dumpsys iphonesubinfo not working since Android 5.0 Lollipop
(4 answers)
Closed 7 years ago.
I want to get/set an imei number for rooted android phone.
I tried this command
adb shell dumpsys iphonesubinfo
I tried this command also
adb shell getprop gsm.baseband.imei
I tried this command also
service call iphonesubinfo 1

You can't set the IMEI, of any of the forms.
For getting it via ADB, see this question

Related

Run ADB Shell script when more than one device is conncected [duplicate]

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.

How to connect to any specified Wi-Fi network(SSID) using ADB command [duplicate]

This question already has answers here:
How do I connect to a specific Wi-Fi network in Android programmatically?
(11 answers)
Connecting to WiFi using adb shell
(7 answers)
Closed 4 years ago.
Lets assume I have Wi-Fi networks 'A' 'B' & 'C'. I want to connect the connected android device to SSID: 'A' which is password protected. Is there a way to perform this using ADB command by providing SSID and password in the same command?
$ am startservice \
-n com.google.wifisetup/.WifiSetupService \
-a WifiSetupService.Connect
Go with android developer console.

Adb shell command to change the device language? [duplicate]

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

Get Android OS version of device connected via ADB [duplicate]

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

Unable to run 'adb root' on a rooted Android phone [duplicate]

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.

Categories

Resources