adb – Programming an Android application to switch default SIM for mobile Data

I am working on a project in which I have to switch the default SIM for data automatically, and without the need for user intervention. I read some posts on internet and got to know a method in which we can switch off one of the sim and Data will automatically be switched to secondary sim.

This needs Android debug bridge. But, I am not able to find any function responsible for switching default data sim.

adb – There is no way for me to boot recovery mode on my tablet

So, I recently thought about rooting my Lenovo Tab M10 (according to the TWRP site, TB-X605F), so I flashed the latest version of TWRP to my tablet from fastboot, and realised: “Oh. I can’t boot recovery on this.” Holding power+volume down brings me to fastboot again, as expected. Power+volume up shows a weird “FFBM Mode” message in what looks to be the Arial font, centred on screen, on a grey background. Holding power and both volume buttons boots as if i was just holding power. I have no idea what to do. None of the fastboot boot commands exist on my tablet, nor do some of the fastboot oem commands. I am running Android 9.0 Pie on my tablet, and Linux Mint on my PC, using the adb and fastboot packages if that would help.

adb – Turning on “show pointer” breaks mirrored screen. How to turn off without phone screen

I am trying to help a friend who’s screen broke on their Huawei P30. The screen is dead-dead. No touch, no light, nothing.

So I tried to connect an external screen to it, an voila, I have a screen. I even have a mouse and keyboard working. However, I want to copy the contents of the phone onto the computer, and nothing is showing up on the computer when I plug it in. So I tried to get ADB to help me.

ADB is not trusted, or something along those lines. So I go back to the screen, and turn on developer mode, and try to change settings to hopefully bypass the notification asking to give permission. Nothing works, I keep trying new settings.

This is where I mess up. Apparently there is a bug or something, because when you turn on (and I have no idea why I did this) “Show Pointer” the external display goes black with a grey bar at the top theoretically showing the pointer X and Y coordinates, etc.

If I reboot the device I see the home screen for 0.5 to 3 seconds before it reverts back to the black screen. If in this time, I click on the settings icon, it immediately goes to black.

Question: Is there a way, without access to the screen of a device to:

  1. get ADB to work without it been an authorized device (I’m guessing not), or
  2. turn off pointer location somehow using ADB or similar method, or
  3. navigate the menus of the phone with a keyboard only, no mouse, no clicking, just keystrokes, so I can disable this blind (using another phone or video to know how many times to press down, for example)?

Any advice at all would be great. Since they already have a new phone, I don’t want to have to pay to replace the screen, but that is last resort (which I hope would work).

How to use phone as camera and microphone for PC via ADB?

There are many previous questions asking about how to use the phone as camera and microphone for PC. For example:

However, all the answer involve installing an app in the phone. In my experience, DroidCam is very lagging. I think if there is a way to do that via ADB, then it will be much faster. We have such solutions for projecting phone’s screen.

Is there a way to do so? If no, then why is that?

adb – How to find PID of test runner

I have my app and my tests saved as following:

App package name:
Test runner:

When I run the app by itself, I can use adb to see the pid of my app: adb shell ps | grep

u0_a839      14710  1044 41927360 714352 0                  0 S

When I run my app with automation, I tried calling the same adb command while the tests were running: adb shell ps | grep
But nothing shows up.

does “adb install”overwrite or skips when the apk is already installed?

i just want to have more clarity in what adb does by default .

when i run adb install for an apk that is already installed the cmd only shows :

Performing Streamed Install

it does not specify if it is skipping the install or if overwriting.

and is there a verbose option for adb for it to be more clear of what is doing ?

adb – What is Android OS in context of Chrome OS?

What kind of operating system is Android? I’ve tried using other file types, but not any of them work: .ios, .img, .exe, .pkg.

My terminal needs a password which is chromeos-setdevpasswd. Yet, when I use it with sudo sh, it times out and resets its own pass.

As I know, I have to take out the data strips screw to stop it from timing out. I don’t know if that’s why I can’t use certain commands because I’ve already been to root status in crosh.

adb – Boot-Up System Test tools

I am a test automation script developer using Python. One of my recents tasks has been to create scripts that can output the following test cases from an Android device under test during boot-up:

-Identification – SW Ver, SN, CPU, memory,….

-Memory test – bad block count

-DDR Training

-Peripheral inventory check

-Error logging

Ideally, this would all be done via adb interface, but I don’t know what tools or commands are available to do such tests. Some are trivial such as SW ver, SN. But others like the memory test, and ddr training are new to me.
If anyone can point me in the right direction in terms of adb commands and/or test apps, that would be great.
I’m not an Android developer nor do I know Java so my knowledge of the inner workings of Android is very sparse.