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”
- Emulator: ERROR: x86 emulation currently requires hardware acceleration
- Emulator: ERROR: x86 emulation currently requires hardware acceleration
- ‘App not Installed’ Error on Android
- ‘App not Installed’ Error on Android
- Draw a transparent circle onto a filled android canvas
- How to use navigateUp to close the application
- Can’t start Eclipse – Java was started but returned exit code=13
- Can’t start Eclipse – Java was started but returned exit code=13
- What exactly is “com.google.android.packageinstaller”
- Differences between arm64 and aarch64
- google console error `OR-IEH-01`
- Install an apk file from command prompt?
- Install an apk file from command prompt?
- My users get “net::err_name_not_resolved”
- Solving “adb server version doesn’t match this client” error [duplicate]
- Unity remote 5 not working
- How to display Toast in Android?
- Can’t create handler inside thread that has not called Looper.prepare()
- How can I recursively find all files in current and subfolders based on wildcard matching?
- How to perform grep operation on all files in a directory?
- recyclerview No adapter attached; skipping layout
- Exception : AAPT2 error: check logs for details
- This adb server’s $ADB_VENDOR_KEYS is not set
- Can’t create handler inside thread that has not called Looper.prepare()
- This adb server’s $ADB_VENDOR_KEYS is not set
- E: unable to locate package pip
- recyclerview No adapter attached; skipping layout
- Exception : AAPT2 error: check logs for details
- Flutter pageview : Find first and last page and swipe directions
- subprocess.Popen(): OSError: [Errno 8] Exec format error in python?
- What are the possible reasons for NFC Service to become dead after some time?
- How can I find and run the keytool
- How to substitute shell variables in complex text files
- Enable VT-x in your BIOS security settings (refer to documentation for your computer)
- NetworkType.UNMETERED vs NetworkType.METERED – PeriodicWork
- Getting net::ERR_UNKNOWN_URL_SCHEME while calling telephone number from HTML page in Android
- How can I recursively find all files in current and subfolders based on wildcard matching?
- Simple Android RecyclerView example
- Find all Bluetooth devices (headsets, phones etc) nearby, without forcing the devices in discoverable mode
- Curl command for https ( SSL )
- You need to use a Theme.AppCompat theme (or descendant) with this activity
- “Default Activity Not Found” on Android Studio upgrade
- You need to use a Theme.AppCompat theme (or descendant) with this activity
- How to exclude a directory in find . command
- “sed” command in bash
- Still getting warning : Configuration ‘compile’ is obsolete and has been replaced with ‘implementation’
- What is ‘Context’ on Android?
- How to install APK from PC?
- android image button
- How to exclude a directory in find . command