Well, if your phone is rooted you can run commands with the su -c
command.
Here is an example of a cat
command on the build.prop
file to get a phone’s product information.
adb shell "su -c 'cat /system/build.prop |grep "product"'"
This invokes root permission and runs the command inside the ' '
.
Notice the 5 end quotes, that is required that you close ALL your end quotes or you will get an error.
For clarification the format is like this.
adb shell "su -c '[your command goes here]'"
Make sure you enter the command EXACTLY the way that you normally would when running it in shell.
Related Posts:
- adb shell su works but adb root does not
- adb shell su works but adb root does not
- How to use ADB Shell when Multiple Devices are connected? Fails with “error: more than one device and emulator”
- Why am I getting Permission Denied when trying to push a Sqlite file to my rooted Android device?
- “unable to locate adb” using Android Studio [duplicate]
- “unable to locate adb” using Android Studio [duplicate]
- Error: No toolchains found in the NDK toolchains folder for ABI with prefix: llvm
- Solving “adb server version doesn’t match this client” error [duplicate]
- Error: No toolchains found in the NDK toolchains folder for ABI with prefix: llvm
- How to use adb command to push a file on device without sd card
- ‘adb’ is not recognized as an internal or external command, operable program or batch file
- Android ADB devices unauthorized
- adb is not recognized as internal or external command, operable program or batch file
- What causes signal ‘SIGILL’?
- adb server is out of date. killing
- Android: adb pull file on desktop
- ADB No Devices Found
- Android device does not show up in adb list
- Set adb vendor keys
- ADB Android Device Unauthorized
- Session ‘app’: Error Installing APK
- How can I use adb over WiFi?
- Android ADB device offline, can’t issue commands
- IllegalArgumentException: Unable to locate adb in Android Studio v2.3
- Android Studio: Unable to obtain result of ‘adb version’
- adb command not found
- How to resolve the “ADB server didn’t ACK” error?
- Android Device not recognized by adb
- ADB stopping at (waiting for devices)
- How can I get the android-support-v4.jar file (from Android Support Library) on Linux?
- Android Studio doesn’t see device
- Android: adb: Permission Denied
- ADB error: cannot connect to daemon
- Failed to find Build Tools revision 23.0.1
- Running Node.Js on Android
- Running Node.Js on Android
- Android Device not recognized by adb
- Android ADB doesn’t see device
- Installing ADB on macOS [duplicate]
- How to authorize and accept ADB RSA key with broken touch screen on Android
- Adb backup does not work
- adb socket not working and daemon
- Error: Could not automatically detect an ADB binary. Some emulator functionality will not work until a custom path to ADB is added in the extended…
- USB Debugging option greyed out
- How to open adb and use it to send commands
- INSTALL_FAILED_NO_MATCHING_ABIS when install apk
- Android Studio – ADB Error – “…device unauthorized. Please check the confirmation dialog on your device.”
- adb devices return error: protocol fault (no status)
- Android Device not recognized by adb
- Not able to access adb in OS X through Terminal, “command not found”
- ‘App not Installed’ Error on Android
- google console error `OR-IEH-01`
- How can I recursively find all files in current and subfolders based on wildcard matching?
- Enable VT-x in your BIOS security settings (refer to documentation for your computer)
- NetworkType.UNMETERED vs NetworkType.METERED – PeriodicWork
- Find all Bluetooth devices (headsets, phones etc) nearby, without forcing the devices in discoverable mode
- “Default Activity Not Found” on Android Studio upgrade
- how to overcome Android Studio cannot resolve symbol for android classes
- What is the meaning of Log.i()
- How can I kill a process by name instead of PID, on Linux?
- Execution failed app:processDebugResources Android Studio
- Android Emulator Error Message: “PANIC: Missing emulator engine program for ‘x86’ CPUS.”
- Android – could not install *smartsocket* listener
- ./configure : /bin/sh^M : bad interpreter
- IllegalStateException: Can not perform this action after onSaveInstanceState with ViewPager
- How to create a Custom Dialog box in android?
- Unfortunately Launcher3 has stopped working error in android studio?
- Android basics: running code in the UI thread
- Error:Execution failed for task ‘:app:transformClassesWithDexForDebug’
- Horizontal ListView in Android?
- Rotating a view in Android
- Android error “unable to find explicit activity class”
- Can not resolve method ‘findViewById(int)’
- Cannot resolve symbol ‘context’
- Writing a simple shell in C using fork/execvp
- How to get current time and date in Android
- Gradle DSL method not found: ‘compile()’
- how to use getSharedPreferences in android
- Set transparent background of an imageview on Android
- Play sound on button click android
- How to make the corners of a button round?
- What does set -e mean in a bash script?
- ClassLoader referenced unknown path: /data/app/
- Unknown URL content://downloads/my_downloads
- android edittext onchange listener
- Determining translationX/Y values for ObjectAnimator; how to move a view to an exact screen position?
- React Native: JAVA_HOME is not set and no ‘java’ command could be found in your PATH
- Android getText from EditText field
- Warning: Do not place Android context classes in static fields; this is a memory leak (and also breaks Instant Run)
- How to solve failed to find build tools revision 26.0.2?
- Why is the Android emulator screen blank?
- Exception ‘open failed: EACCES (Permission denied)’ on Android
- What is Activity.finish() method doing exactly?
- Android – Command not found
- How to determine the version of Gradle?
- sendUserActionEvent() is null
- SDK Location not found in android studio
- Android app unable to start activity componentinfo
- How do I know the script file name in a Bash script?
- Shell command to monitor changes in a file