adb: inaccessible or not found [duplicate] - android

This question already has answers here:
/system/bin/sh: adb: not found
(2 answers)
Closed 1 year ago.
I have connected to my android tablet from PC and can confirm the results by running adb devices.
Chrome has been installed on Android's homescreen.
However, I met the error below when I ran
Patio730:/ $ adb shell am start -n com.android.chrome/com.google.android.apps.chrome.Main
/system/bin/sh: adb: inaccessible or not found

You have entered inside your device shell and adb is not installed on the device.
Run the command without adb shell prefix, just like this:
am start -n <...>
Or you can do exit and then type the original command:
exit
adb shell am start -n <...>

Related

Android skip chrome welcome screen using adb

I am trying to skip the chrome welcome screen when running tests. The problem is other solutions that I have found like this one don't seem to work anymore.
Commands used:
$ adb shell pm clear com.android.chrome
$ adb shell 'echo "chrome --disable-fre --no-default-browser-check --no-first-run" > /data/local/tmp/chrome-command-line'
$ adb shell am start -n com.android.chrome/com.google.android.apps.chrome.Main
The solution for me was actually a combination of the question and this answer. The solution can also be found in another question/answer, though it's not entirely clear.
The following should work:
$ adb shell am set-debug-app --persistent com.android.chrome
$ adb shell 'echo "chrome --disable-fre --no-default-browser-check --no-first-run" > /data/local/tmp/chrome-command-line'
$ adb shell am start -n com.android.chrome/com.google.android.apps.chrome.Main
Some notes:
In the Chromium project documentation, it's mentioned that for the command line file to be used, the user should
"Enable command line on non-rooted devices" in chrome://flags
Setting Chrome as the debug application replaces this requirement.
In older device versions, the command line file was expected in /data/local. This folder is no longer writable from adb shell in non-rooted devices, so /data/local/tmp should be used instead. This is documented in this bug
In the ChromeSwitches.java current source code, only --disable-fre still exists. The other flags might be required in older Chrome versions, but I didn't verify.
What is your OS version? It is working on Android 10. You can try the below commands:
$ adb shell pm clear com.android.chrome
$ adb shell am set-debug-app --persistent com.android.chrome
$ adb shell am start -n com.android.chrome/com.google.android.apps.chrome.Main

How do I execute an adb command in Android Studio? [duplicate]

This question already has answers here:
'adb' is not recognized as an internal or external command, operable program or batch file
(27 answers)
Closed 6 years ago.
For example, I want to execute this command from this tutorial:
$ adb shell monkey -p your.package.name -v 500
How do I do it? Where do I enter the command? I've tried entering it into the terminal but it says that '$' is not recognized.
I also tried removing '$' but it then says that "'adb' is not recognized as an internal or external command,
operable program or batch file."
$ isn't part of the command.
Use adb shell monkey -p your.package.name -v 500
adb is the command you ran on your terminal.
For example:
adb devices
shows you the connected devices.
adb shell
Starts a remote shell in the target emulator/device instance.
See https://developer.android.com/studio/command-line/adb.html for more info about adb.

adb shell command from batch file [duplicate]

This question already has an answer here:
windows batch script not execute next line after "adb shell"
(1 answer)
Closed 5 years ago.
I have a .bat file that runs script for testing an app and printing the log to file i have all the commands i tested them manually.
Problem:
after entering the command adb shell, the shell opens in the command prompt. I wrote the next commands that are entered in the shell with root#generic
the commands aren't going through and it just waits at that spot.
what do i have to type in front of the commands to make them appear
example of what i have
cd directory of sdk
adb
adb shell
am instrumentation ... (this is the command that won't go through once the shell is open.
any help appreciated I've tried a few things with no success
Just use the following line in your batch file:
adb shell am instrumentation
that will connect to the shell on the Android device and run the am command.

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