Sample Header Ad - 728x90

Android Enthusiasts

Q&A for enthusiasts and power users of the Android operating system

Latest Questions

19 votes
4 answers
173148 views
Why can't I get root access from shell?
> adb shell sh-4.1$ su Permission denied I have rooted my phone successfully. I know this because I'm able to install apps on SD card and I have a program called [SD Maid][1] that is able to operate with root permissions. [1]: https://play.google.com/store/apps/details?id=eu.thedarken.sdm&hl=en
> adb shell sh-4.1$ su Permission denied I have rooted my phone successfully. I know this because I'm able to install apps on SD card and I have a program called SD Maid that is able to operate with root permissions.
Kshitiz Sharma (489 rep)
Feb 21, 2013, 10:16 AM • Last activity: Jul 29, 2025, 09:37 AM
3 votes
1 answers
11997 views
How to run a script in background from adb shell?
I have a problem with USB tethering on my rooted Nougat phone (LineageOS). After some time phone stops USB tethering. To fix that I run the following script like this: adb shell su nohup sh tether.sh & exit exit tether.sh #!/system/bin/sh service list while true; do if ! pidof -s dnsmasq > /dev/null...
I have a problem with USB tethering on my rooted Nougat phone (LineageOS). After some time phone stops USB tethering. To fix that I run the following script like this: adb shell su nohup sh tether.sh & exit exit tether.sh #!/system/bin/sh service list while true; do if ! pidof -s dnsmasq > /dev/null then echo -n "Connectivity lost at " date -u +%FT%TZ echo "Waiting 3 seconds..." sleep 3 echo "Calling ConnectivityManager.setUsbTethering(false)" service call connectivity 33 i32 0 2>&1 sleep 3 echo "Calling ConnectivityManager.setUsbTethering(true)" service call connectivity 33 i32 1 2>&1 echo "Waiting 3 seconds..." fi sleep 3 done Problem: If I use nohup my call to service call connectivity fails with service not found. And I put service list on top of the script which returns Found 0 services:. However the same commands work when ran directly from adb shell; su. Why service call doesn't work inside this background script? Does it need the same tty to work?
Nazar554 (188 rep)
Aug 27, 2019, 08:33 PM • Last activity: Jun 17, 2025, 06:35 PM
0 votes
0 answers
48 views
Error when logging in as root bash after updating kernel with new Magisk
I want chroot to work. It all happened when I upgraded Magisk and then repatched my kernel. Now that I'm logging in as root bash, I get this error: ``` bash: cannot set terminal process group (6898): Inappropriate ioctl for device bash: no job control in this shell ``` Then, if I press ^C, all comma...
I want chroot to work. It all happened when I upgraded Magisk and then repatched my kernel. Now that I'm logging in as root bash, I get this error:
bash: cannot set terminal process group (6898): Inappropriate ioctl for device
bash: no job control in this shell
Then, if I press ^C, all commands are not working and the shell exits with **signal number 2**. How do I fix this?
Yare yare daze (1 rep)
May 15, 2025, 08:14 PM • Last activity: May 17, 2025, 05:44 AM
1 votes
1 answers
570 views
ADB SU root inputs location
Where do I enter the commands for SU abilities and root access or settings? ``` fd = open("/system/file.txt", O_RDWR | O_LARGEFILE | O_NONBLOCK); if (fd Code source: https://android.stackexchange.com/q/213631 No, I'm not doing this for any reason, and I don't need to throw an explanation at all. I'm...
Where do I enter the commands for SU abilities and root access or settings? ``` fd = open("/system/file.txt", O_RDWR | O_LARGEFILE | O_NONBLOCK); if (fd Code source: https://android.stackexchange.com/q/213631 No, I'm not doing this for any reason, and I don't need to throw an explanation at all. I'm just tooling around and I'm trying to learn on my own as well as reading and doing my own research, so please spare me the whys, the whats, and the whos, and just explain to me where I enter these commands.
W K. Omni (11 rep)
Jun 30, 2024, 01:31 PM • Last activity: May 10, 2025, 11:01 AM
1 votes
1 answers
1158 views
What are system/secure/global namespaces about?
In the `settings` command (i.e. which invokes `cmd` command), there are 3 namespaces: * `system` * `secure` * `global` What are these, and why are some features on one rather than another?
In the settings command (i.e. which invokes cmd command), there are 3 namespaces: * system * secure * global What are these, and why are some features on one rather than another?
user301378
Jul 24, 2019, 02:31 PM • Last activity: Apr 5, 2025, 04:13 PM
35 votes
1 answers
225386 views
adb shell -> su: not found
[![enter image description here][1]][1] [1]: https://i.sstatic.net/kMkc0.jpg How can I overcome this problem? Devices: 1. Samsung Galaxy TabS - Android 4.4.2 2. HTC M8 - Android 5.0.1 The two devices have the same problem.
enter image description here How can I overcome this problem? Devices: 1. Samsung Galaxy TabS - Android 4.4.2 2. HTC M8 - Android 5.0.1 The two devices have the same problem.
mcxxx (461 rep)
Nov 3, 2015, 12:07 PM • Last activity: Jan 31, 2025, 07:25 PM
3 votes
1 answers
554 views
What shells does AOSP include by default?
As an example, I am certain that it includes `sh` in `$PATH` somewhere (presumably `/system/bin/sh`), but does it include any alternatives by default, too, like `bash` (even outside of `$PATH`)?
As an example, I am certain that it includes sh in $PATH somewhere (presumably /system/bin/sh), but does it include any alternatives by default, too, like bash (even outside of $PATH)?
RokeJulianLockhart (556 rep)
Jan 30, 2025, 10:24 PM • Last activity: Jan 31, 2025, 09:02 AM
0 votes
2 answers
4259 views
Is it possible to make multiple adb commands a one-liner command? (case change bootanimation.zip)
Is it possible to make the following commands a one-liner command ? to change bootanimation.zip quickly and gain some C:\Users\User\Desktop>adb push bootanimation /sdcard C:\Users\User\Desktop>adb shell $ su # mount -o rw,remount /system # cp /sdcard/bootanimation.zip /system/media/bootanimation.zip...
Is it possible to make the following commands a one-liner command ? to change bootanimation.zip quickly and gain some C:\Users\User\Desktop>adb push bootanimation /sdcard C:\Users\User\Desktop>adb shell $ su # mount -o rw,remount /system # cp /sdcard/bootanimation.zip /system/media/bootanimation.zip # chmod 644 /system/media/bootanimation.zip # reboot
M. A. (840 rep)
Jun 18, 2019, 02:28 PM • Last activity: Jan 25, 2025, 03:20 AM
0 votes
0 answers
30 views
How to find and download a specific APK (com.android.calculator2) from a FAW device?
Device in question is a FAW (Full Android Watch): a watch running a full Android OS, not WearOS. It is a LEMFO LEMP running Android 9.1, and I'd like to give the calculator I have to another member of the FAW community: https://discourse.fullandroidwatch.org/t/round-calculator-from-faw-app-store/732...
Device in question is a FAW (Full Android Watch): a watch running a full Android OS, not WearOS. It is a LEMFO LEMP running Android 9.1, and I'd like to give the calculator I have to another member of the FAW community: https://discourse.fullandroidwatch.org/t/round-calculator-from-faw-app-store/73203/11 I connected to the watch via USB tether. I started the calculator app and then I opened an adb shell and browsed a ps:
DMN_C16_TFT_PIX64:/data $ ps -A | grep calc                                                                                                                                                                                                 
u0_a52        4132   291 3957800 106124 0                   0 S com.android.calculator2
Based on this I'm hunting for the apk com.android.calculator2. I browsed the file system with Device Explorer in Android Studio. I've found this: enter image description here First, it looks like to be a directory. If I double click to step into that directory: enter image description here In any case if I try to download it, I get an error. enter image description here
DMN_C16_TFT_PIX64:/ $ pwd
/
DMN_C16_TFT_PIX64:/ $ cd data
DMN_C16_TFT_PIX64:/data $ ls -al
ls: .: Permission denied
Where is that apk and how can I download it?
Csaba Toth (161 rep)
Dec 28, 2024, 10:59 PM
1 votes
1 answers
205 views
Termux Running easyrsa as `sudo -u root` gives me No such file or directory
I'm trying to run a sh script (easyrsa) while being in `sudo -u root` environment. sudo -u root sh /data/data/com.termux/files/home/openvpn/easy-rsa/easyrsa3/easyrsa This gives me an error telling me that OpenSSL is not present (I assume because I'm running it in a different environment) And when I...
I'm trying to run a sh script (easyrsa) while being in sudo -u root environment. sudo -u root sh /data/data/com.termux/files/home/openvpn/easy-rsa/easyrsa3/easyrsa This gives me an error telling me that OpenSSL is not present (I assume because I'm running it in a different environment) And when I try sudo -u root /data/data/com.termux/files/home/openvpn/easy-rsa/easyrsa3/easyrsa It gives me "No such file or directory". I tried every possible combination of commands but just can't seem to get it right. The main issue is I'm trying to run easyrsa from a web dashboard for generating certificates, and this dashboard is running as sudo -u root and for some strange reason, it just can't find the files in termux home. /data/data/com.termux/files/home/openvpn/easy-rsa/easyrsa3/easyrsa is my location of the easyrsa shell file
xMidNight-. (21 rep)
Dec 18, 2024, 10:14 PM • Last activity: Dec 20, 2024, 03:38 AM
0 votes
1 answers
4788 views
`adb shell` returns with error: closed
I somehow bricked my OnePlus One phone badly. It only loads directly to the recovery. Pressing vol up + power button or rebooting it with `adb reboot bootloader` doesn't get me to the bootloader. I think I erased the bootloader partition or deleted my bootloader. Here comes the tricky part. I can't...
I somehow bricked my OnePlus One phone badly. It only loads directly to the recovery. Pressing vol up + power button or rebooting it with adb reboot bootloader doesn't get me to the bootloader. I think I erased the bootloader partition or deleted my bootloader. Here comes the tricky part. I can't even sideload any file or access my internal SD card because then I get either following error messages: - E: footer is wrong - E: signature verification failed - Error opening '/data/media' (no such file or directory) Right now I can either flash the OnePlusRestoreTool(64GB) recovery or the ColorOS recovery tool (both can't access the internal storage - button is not clickable). I thought I just have to mount my SD card new, but I can't enter a shell command, and most badly, I can't enter the bootloader. How to fix it?
user244972 (1 rep)
Nov 26, 2017, 06:28 PM • Last activity: Dec 19, 2024, 12:03 AM
0 votes
1 answers
3645 views
How to send SMS from terminal in background on Android?
I'm trying to send text message (SMS) from my Android terminal app in background (sim 1 or 2). I can send message in foreground using this command: ```bash am start -a android.intent.action.SENDTO -d sms:121 --es sms_body "test text" --ez exit_on_sent true; input keyevent 22; input keyevent 66; ```...
I'm trying to send text message (SMS) from my Android terminal app in background (sim 1 or 2). I can send message in foreground using this command:
am start -a android.intent.action.SENDTO -d sms:121 --es sms_body "test text" --ez exit_on_sent true;
input keyevent 22;
input keyevent 66;
But this command don't work in background. So, how can I send message in background from my terminal? **Note: Android version 6.0. Rooted device**
Rabib (1 rep)
Feb 9, 2020, 12:21 PM • Last activity: Dec 13, 2024, 03:02 AM
0 votes
0 answers
204 views
Can't mount anything on a rooted android device: not in /proc/mounts
I have a rooted Samsung Galaxy S23 with Android 14 and Magisk 27 installed. I ran ```adb root``` successfully and then proceeded to go into ```adb shell``` in which I obviously had root rights (#). Then I ran ```mount -o remount,rw /data/adb/service.d``` which gave me the error message ```mount: '/s...
I have a rooted Samsung Galaxy S23 with Android 14 and Magisk 27 installed. I ran
root
successfully and then proceeded to go into
shell
in which I obviously had root rights (#). Then I ran
-o remount,rw /data/adb/service.d
which gave me the error message
: '/service.d' not in /proc/mounts
. This always occurs whenever I try to mount/remount any root directory. How can this be fixed?
MLueh (1 rep)
Sep 30, 2024, 11:30 PM
0 votes
1 answers
202 views
Why does calling setuid() return "Bad system call"?
So actually, I have Android 13. The problem is in my C code (probably?). When I call `setuid(0)` or `setuid(getuid())` in my phone, I get this output: ``` Bad system call ``` Meanwhile on my laptop with Ubuntu, `setuid()` doesn't throw any error, and returns -1 (so that's how it should be). Then why...
So actually, I have Android 13. The problem is in my C code (probably?). When I call setuid(0) or setuid(getuid()) in my phone, I get this output:
Bad system call
Meanwhile on my laptop with Ubuntu, setuid() doesn't throw any error, and returns -1 (so that's how it should be). Then why does Android's setuid() throw that? And if Bad system call is normal for Android, then how can the Android system call setuid() for each Java application (uid 10000 and greater)?
BHms game Java (3 rep)
Sep 6, 2024, 03:09 PM • Last activity: Sep 9, 2024, 02:26 PM
2 votes
2 answers
15280 views
"Neither user 2000 nor current process has android.permission.GRANT_RUNTIME_PERMISSIONS" when using `adb shell pm grant` command
I have installed a clipboard manager, [Clip Stack][1] on my Android 11 phone. When the app is opened, the developer helpfully gives the message that background clipboard access has been blocked by Android 10 but he has found a workaround and to run the following ADB commands: > ``` > adb -d shell ap...
I have installed a clipboard manager, Clip Stack on my Android 11 phone. When the app is opened, the developer helpfully gives the message that background clipboard access has been blocked by Android 10 but he has found a workaround and to run the following ADB commands: >
> adb -d shell appops set com.catchingnow.tinyclipboardmanager SYSTEM_ALERT_WINDOW allow; 
> adb -d shell pm grant com.catchingnow.tinyclipboardmanager android.permission.READ_LOGS; 
> adb shell am force-stop com.catchingnow.tinyclipboardmanager;
>
I don't want to install Android Studio. I tried the following: 1. Enabled Developer Options on my phone and turned on USB debugging and Allow screen overlaps on settings 2. On my computer installed minimal_adb_fastboot_v1.4.3 3. Connected my phone to my computer via usb 4. Clicked on the desktop shortcut for Minimal ADB and Fastboot to open a cmd window 5. Ran adb -d shell appops set com.catchingnow.tinyclipboardmanager SYSTEM_ALERT_WINDOW allow; The daemon started. 6. Ran adb -d shell pm grant com.catchingnow.tinyclipboardmanager android.permission.READ_LOGS; It gave error:
Exception occurred while executing 'grant':
java.lang.SecurityException: grantRuntimePermission: Neither user 2000 nor current process has android.permission.GRANT_RUNTIME_PERMISSIONS.
        at android.app.ContextImpl.enforce(ContextImpl.java:2028)
        at android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:2056)
        at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermissionInternal(PermissionManagerService.java:1463)
        at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermission(PermissionManagerService.java:1444)
        at com.android.server.pm.PackageManagerShellCommand.runGrantRevokePermission(PackageManagerShellCommand.java:2300)
        at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:251)
        at android.os.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:98)
        at android.os.ShellCommand.exec(ShellCommand.java:44)
        at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:22307)
        at android.os.Binder.shellCommand(Binder.java:929)
        at android.os.Binder.onTransact(Binder.java:813)
        at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4687)
        at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4471)
        at android.os.Binder.execTransactInternal(Binder.java:1159)
        at android.os.Binder.execTransact(Binder.java:1123)
How can I proceed?
boardtc (176 rep)
Sep 14, 2021, 10:26 PM • Last activity: Sep 6, 2024, 02:41 PM
3 votes
0 answers
4625 views
Where are my files in the Explorer when I move them in the Secure Folder [SAMSUNG]
When I connect my phone (Samsung) to my computer, I see an image in DCIM\Screenshots. When I enable Secure Folder and move the image there, the image disappears in Windows Explorer. When I look at the path where the image is, it still says DCIM\Screenshots but it's not there. Does anyone know where...
When I connect my phone (Samsung) to my computer, I see an image in DCIM\Screenshots. When I enable Secure Folder and move the image there, the image disappears in Windows Explorer. When I look at the path where the image is, it still says DCIM\Screenshots but it's not there. Does anyone know where these files are stored then? Are they stored somewhere else at all, or are they simply invisible in Explorer? I already installed ADB and enabled USB debugging on the phone. I think it's the path I'm giving. I don't know how to specify the drive in the path, or does it not have to be done? I have already tried these commands: adb shell ls -la /phone/DCIM/Screenshots adb shell ls -la user/phone/DCIM/Screenshots adb shell ls -la "Dieser PC/user/phone/DCIM/Screenshots" Then I get the error twice that the path is not found. Is it because the path contains a space?
Goethe (31 rep)
Sep 21, 2022, 04:21 PM • Last activity: Aug 29, 2024, 08:10 AM
0 votes
0 answers
117 views
How do I bypass ADB Error Message and/or delete OEMs
I have a TCL Android phone. I keep getting error messages when attempting to use ADB to debloat my phone. I would love to know why my commands aren't working and what the correct ones to enter are. I was inputting the following commands First; adb shell pm list users Then these exact commands in any...
I have a TCL Android phone. I keep getting error messages when attempting to use ADB to debloat my phone. I would love to know why my commands aren't working and what the correct ones to enter are. I was inputting the following commands First; adb shell pm list users Then these exact commands in any given order as I have attempted this several times over now;
pm uninstall -k --user 0 com.facebook
pm uninstall -k --user 0 com.facebook.appmanager
pm uninstall -k --user 0 com.facebook.services
pm uninstall -k --user 0 com.facebook.system
These are the error messages which come up in return.
Exception occurred while executing 'uninstall':
java.lang.IllegalArgumentException: Bad user number: com.facebook
	at android.os.UserHandle.parseUserArg(UserHandle.java:489)
	at com.android.server.pm.PackageManagerShellCommand.runUninstall(PackageManagerShellCommand.java:2012)
	at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:234)
	at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
	at android.os.ShellCommand.exec(ShellCommand.java:38)
	at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:25476)
	at android.os.Binder.shellCommand(Binder.java:950)
	at android.os.Binder.onTransact(Binder.java:834)
	at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:5092)
	at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:8829)
	at android.os.Binder.execTransactInternal(Binder.java:1184)
	at android.os.Binder.execTransact(Binder.java:1143)
I hope my efforts in tracing down those error messages will prove helpful for you. I've found on another post on this website that a quick fix would be to uninstall secure folder. I haven't been able to find any trace of a secure folder on my TCL Android. Nor did I see "disable monitoring permissions" in my dev settings which I had seen written as a quick fix on another post on this website. Any help would be much appreciated I have 32GB to myself on my work and personal phone and the OEMs are taking up 15GBs of those.
TiredTechy (1 rep)
Jul 19, 2024, 06:46 PM • Last activity: Jul 21, 2024, 06:50 AM
68 votes
9 answers
193431 views
How can I run a script on boot?
I'm accustomed to running scripts on boot in Linux, but I'm not sure how to do this in Android. I'd like to start my SSH daemon on start, so I'll always be able to connect. How can I run an arbitrary script on Android boot? It'd be preferable to do this outside of Dalvik.
I'm accustomed to running scripts on boot in Linux, but I'm not sure how to do this in Android. I'd like to start my SSH daemon on start, so I'll always be able to connect. How can I run an arbitrary script on Android boot? It'd be preferable to do this outside of Dalvik.
Naftuli Kay (2652 rep)
Mar 2, 2011, 09:15 PM • Last activity: Jul 17, 2024, 04:27 AM
0 votes
0 answers
5084 views
Using the Cerberus shell to input commands
I'd like to use the Cerberus shell to input commands like taps, swipes, and text. I know how to do it using the command line and ADB shell, but I don't have USB debugging enabled on my Nexus6, so I'm trying to do it using Cerberus. I was under the impression that the same commands should work, but t...
I'd like to use the Cerberus shell to input commands like taps, swipes, and text. I know how to do it using the command line and ADB shell, but I don't have USB debugging enabled on my Nexus6, so I'm trying to do it using Cerberus. I was under the impression that the same commands should work, but they don't seem to be. I tried sending "input keyevent 26"; it sends, but nothing happens on my phone (the screen should turn on). I also tried "adb shell input keyevent 26", but it just says "error: device not found". Am I doing something wrong? Or is this something the Cerberus shell can't do? Background: I've got a Nexus 6 with a broken screen: no display and no touchscreen. My goal is to run the app SMS Backup and Restore so I can backup my texts before sending in my phone to be replaced. I don't seem to have USB debugging enabled (though I thought I did -- I reinstalled the OS a few months ago) -- when I type "adb devices," the result is blank. I can use the ADB shell to input taps, swipes, and text/numbers to my Nexus4. I think I could blindly use the SMS Backup app by inputting the proper sequence of commands into the Cerberus shell. (Or, maybe even easier, just use the shell to get my phone to cast to my tv or Chromecast; then I could use a OTG mouse.)
daunpunk (1 rep)
Oct 6, 2015, 01:06 AM • Last activity: Jun 25, 2024, 05:36 AM
1 votes
0 answers
156 views
How to access ADB shell on Samsung Galaxy S10 stuck in boot loop?
I have a Samsung Galaxy S10 that is rooted and the bootloader is unlocked. Recently, I disabled a series of system packages, and now my phone is stuck in a boot loop. I need to re-enable those packages to fix the boot loop, but I'm unable to access the ADB shell because the device shows as "unauthor...
I have a Samsung Galaxy S10 that is rooted and the bootloader is unlocked. Recently, I disabled a series of system packages, and now my phone is stuck in a boot loop. I need to re-enable those packages to fix the boot loop, but I'm unable to access the ADB shell because the device shows as "unauthorized." Here's what I have tried so far:
adb devices
List of devices attached
R38MB0CN1MA unauthorized
Attempting to open ADB shell:
adb shell
adb: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
I need to access the ADB shell to re-enable the packages and get my phone out of the boot loop. How can I achieve this on a Mac? Additional Information: Phone: Samsung Galaxy S10 Rooted: Yes Bootloader: Unlocked Current Mode: Stuck in boot loop Any help or guidance on how to fix this issue would be greatly appreciated!
Just A Question (111 rep)
May 22, 2024, 10:06 PM
Showing page 1 of 20 total questions