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
-2 votes
1 answers
1274 views
Navigate through device's folders via ADB
I have connected and verified ADB on my phone: ```bash adb start-server adb devices ``` And then I wanted to go to _DCIM_ folder in my storage to see, if there are any pictures to fetch. However this has failed: ```bash adb shell ls adb shell cd /storage adb shell pwd adb shell ls ``` The second `ls...
I have connected and verified ADB on my phone:
adb start-server
adb devices
And then I wanted to go to _DCIM_ folder in my storage to see, if there are any pictures to fetch. However this has failed:
adb shell ls
adb shell cd /storage
adb shell pwd
adb shell ls
The second ls again shows root and pwd responds with /, not with /storage. Tried storage and /storage, tried /sdcard and sdcard, assuming that _storage_ might not be accessible for me. Tried /sdcard/DCIM and others, all for nothing. I have _Realme 50 GT_ with _Android 14_. What am I missing?
trejder (2633 rep)
Nov 14, 2024, 09:19 AM • Last activity: Mar 27, 2025, 10:37 PM
1 votes
0 answers
233 views
How can I launch a camera app from the command line, and have it stored somewhere predictable on android?
Basically... I am writing a script on Termux and I need to take and store a photography. I tried to start "android.media.action.IMAGE_CAPTURE" via am supplying it with the uri of both a non existent and empty file for that sake, but I was unable to get it to work consistently... More details [Here][...
Basically... I am writing a script on Termux and I need to take and store a photography. I tried to start "android.media.action.IMAGE_CAPTURE" via am supplying it with the uri of both a non existent and empty file for that sake, but I was unable to get it to work consistently... More details Here . So I am reconsidering my approach... Do you guys know some way (built-in way, third party app or library, Termux specific command, idk) to be able to launch some camera app in order to be able to point the camera and take the photo, and then return to the terminal in order to handle it. It would be nice to write it directly into Termux's storage, but it's fine if I can write it literally anywhere.
Lucastegano X (11 rep)
Feb 4, 2025, 05:49 PM • Last activity: Feb 6, 2025, 01:14 PM
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
2 votes
1 answers
291 views
Termux: am command - start intent without activity class
I'm trying to launch an intent to a shortcut of a flow on Automate (by Llamalabs) using the am command supplied by Termux, but the am command needs the Activity Class parameter to run the shortcut and I can't find it. Automate was able to run it fine without an activity class, but I just can't figur...
I'm trying to launch an intent to a shortcut of a flow on Automate (by Llamalabs) using the am command supplied by Termux, but the am command needs the Activity Class parameter to run the shortcut and I can't find it. Automate was able to run it fine without an activity class, but I just can't figure out how to do it with the am command. **How can I accomplish running a intent without an Activity class on the am command?** I did try running commands like this: `am start -a com.llamalab.automate.intent.action.START_FLOW -d content://com.llamalab.automate.provider/flows/58/statements/ -c android.intent.category.DEFAULT` But it resulted in this output
Starting: Intent { act=com.llamalab.automate.intent.action.START_FLOW cat=[android.intent.category.DEFAULT] dat=content://com.llamalab.automate.provider/... }

Error: Activity not started, unable to resolve Intent { act=com.llamalab.automate.intent.action.START_FLOW cat=[android.intent.category.DEFAULT] dat=content://com.llamalab.automate.provider/... flg=0x10000000 }
And I tried researching more on the am command, but still with no luck. I did find the monkey command built into the Android shell, but that doesn't work as it keeps saying that the window manager isn't running. Parameters I have on the shortcut for the intent:
Data URI: content://com.llamalab.automate.provider/flows/58/statements/1

Action: com.llamalab.automate.intent.action.START_FLOW

Package: com.llamalab.automate
LilData777 (161 rep)
Dec 4, 2024, 04:34 PM • Last activity: Dec 12, 2024, 05:17 PM
2 votes
1 answers
3835 views
Does using brightness dimmer (screen filter) really save battery?
We know that the lower the scree light/brightness, the lower the battery consumption. There are some applications which provide ability (without root) to lower the brightness beyond the (default) limit. So, I want to know does it really save battery? In other words, does it affect battery consumptio...
We know that the lower the scree light/brightness, the lower the battery consumption. There are some applications which provide ability (without root) to lower the brightness beyond the (default) limit. So, I want to know does it really save battery? In other words, does it affect battery consumption comparatively to default minimum limit? Btw, I'm also interested to know *how does such application do this task if going beyond limit?* And is there any command-tool related to settings brightness level?
Pandya (477 rep)
Nov 24, 2016, 12:32 PM • Last activity: Sep 9, 2024, 06:05 PM
11 votes
6 answers
60351 views
Need one-line adb shell su push & pull to access /data from Windows batch file
I wrote a Windows batch file that replaces Amazon lockscreen ads with user images on _rooted_ kindle fire hd 7", 2013 (kfsowi). Just learned I botched the adb commands because I was running "adb insecure" so was getting su access without writing it into the adb commands. **What I need:** To run in b...
I wrote a Windows batch file that replaces Amazon lockscreen ads with user images on _rooted_ kindle fire hd 7", 2013 (kfsowi). Just learned I botched the adb commands because I was running "adb insecure" so was getting su access without writing it into the adb commands. **What I need:** To run in batch file, I need one-line adb shell su commands to pull from/push to /data on this device. (Or I could use adb -d shell su -c "mount -o remount rw, /data on one line followed by the pull or push) I have fixed an ls command like this: - this worked with adb insecure: adb ls "/data/securedStorageLocation" - what I needed was: adb shell su -c "ls ./data/securedStorageLocation" Now I need same for pull and push. The problem: - With adb insecure, this works fine: adb pull "/data/securedStorageLocation" "C:/destination" - Without adb insecure I get: remote object '/data/securedStorageLocation/' does not exist Above happens even if I first run: adb -d shell su -c "mount -o remount rw, /data Can someone tell me how to do the pull and push with adb shell and su? EDIT: adb root command doesn't gain root on this device
sjoy (211 rep)
Oct 23, 2014, 05:05 AM • Last activity: Jul 28, 2024, 05:37 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
0 votes
0 answers
167 views
What does the "sm forget" command do?
What does the `forget` subcommand of the `sm` command do? For reference, here's the help output for `sm`: usage: sm list-disks [adoptable] sm list-volumes [public|private|emulated|stub|all] sm has-adoptable sm get-primary-storage-uuid sm set-force-adoptable [on|off|default] sm set-virtual-disk [true...
What does the forget subcommand of the sm command do? For reference, here's the help output for sm: usage: sm list-disks [adoptable] sm list-volumes [public|private|emulated|stub|all] sm has-adoptable sm get-primary-storage-uuid sm set-force-adoptable [on|off|default] sm set-virtual-disk [true|false] sm partition DISK [public|private|mixed] [ratio] sm mount VOLUME sm unmount VOLUME sm format VOLUME sm benchmark VOLUME sm idle-maint [run|abort] sm fstrim sm forget [UUID|all] sm set-emulate-fbe [true|false] sm start-checkpoint sm supports-checkpoint sm unmount-app-data-dirs PACKAGE_NAME PID USER_ID
JanKanis (221 rep)
Jun 13, 2024, 02:56 PM
4 votes
3 answers
16953 views
Why Android x86 9.0 boots in command line and not in GUI?
I just installed Android x86 9.0c and I don't know why it doesn't boot on GUI mode and it boots only in the command line. Then, after some seconds, I can only see just a dash appearing and disappearing. Below you can see that it has booted into command line, after some seconds it becomes black and a...
I just installed Android x86 9.0c and I don't know why it doesn't boot on GUI mode and it boots only in the command line. Then, after some seconds, I can only see just a dash appearing and disappearing. Below you can see that it has booted into command line, after some seconds it becomes black and all I can see is just a dash appearing and disappearing: > Image I have tried to put my graphics settings to VBox/VGA and disabled 3D acceleration, but it still doesn't work. What else can I do to fix this problem?
Albi Dajti
Jan 16, 2020, 05:49 PM • Last activity: May 10, 2024, 05:49 PM
3 votes
3 answers
12999 views
Enable OTG with a shell command
I'm running Android Pie on a rooted OnePlus 6, and I wanted to know how I can enable OTG with a shell command. I need this in order to automate some tasks. There is a setting that can toggle OTG, found in `settings > system > OTG storage`, so I figured something like this would work: settings put gl...
I'm running Android Pie on a rooted OnePlus 6, and I wanted to know how I can enable OTG with a shell command. I need this in order to automate some tasks. There is a setting that can toggle OTG, found in settings > system > OTG storage, so I figured something like this would work: settings put global otg_enabled 1 However I'm unsure what the setting for OTG is actually called; I tried a bunch of possibilities but none seemed to work. Also tried googling it, but found nothing. Anyone able to help me out here?
Abraham Murciano Benzadon (195 rep)
Aug 28, 2019, 11:08 AM • Last activity: Apr 10, 2024, 02:40 PM
1 votes
0 answers
110 views
The jq utility for Android, or some other command-line-based JSON parser?
We are writing some scripts to be run from the command line in Android, and JSON parsing is necessary. In Linux and other non-Android OS's, there's the `jq` utility, and we're trying to find something like this for Android. We know that Java and Kotlin can do JSON parsing, but our work -- including...
We are writing some scripts to be run from the command line in Android, and JSON parsing is necessary. In Linux and other non-Android OS's, there's the jq utility, and we're trying to find something like this for Android. We know that Java and Kotlin can do JSON parsing, but our work -- including the JSON parsing -- must be done solely via a command-line utility that's runnable within the Android shell processor through which we can pipe the JSON to be parsed. We haven't been able to find anything like this, which is why we're posting this message here, in case someone can point us to this kind of JSON parser that we can use. Thank you very much in advance.
HippoMan (955 rep)
Apr 6, 2024, 12:47 AM
6 votes
3 answers
8939 views
Disable touchscreen input via console
I'm looking for a way to disable and enable the phone's touchscreen via console, and possibly the physical buttons, so to prevent finger touches from being processed. The phone is a Samsung Galaxy Fame, Android 4.1.x. **Background:** I'm configuring an old Galaxy Fame to serve as a sat navigator fix...
I'm looking for a way to disable and enable the phone's touchscreen via console, and possibly the physical buttons, so to prevent finger touches from being processed. The phone is a Samsung Galaxy Fame, Android 4.1.x. **Background:** I'm configuring an old Galaxy Fame to serve as a sat navigator fixed on my car dashboard, aiming at using the up-to-date and free OpenStreetMap. When I turn the key, the phone's USB is powered at 5V, when I turn off the car, the USB has no power. The phone is able to detect these events and I scripted some actions upon them, aiming at providing an instant-on and instant-off navigator service. The phone remains always on and just switches to a power-save status when the car is off. The navigator app – OsmAnd – starts automatically at boot, but the boot does not occur between a car-on / car-off cycle, because the phone remains on to detect the mentioned USB changes. Currently, what happens when I start the car and the USB gets powered: - Display is lit (echo 200 >/sys/class/backlight/panel/brightness) - Sat receiver is activated - CPU frequency set to max What happens when I turn off the car and USB loses power: - Display's backlight off - The sat receiver goes off, along with WiFi and Bluetooth, in case they might have been active - CPU frequency set to minimum Up to this point, everything is working. My problem now is that, when the car goes off and the phone enters this quasi-standby mode, the touchscreen still accepts input and, if the phone is handled or touched for whatever reason, it will stealthily react to those touches while the screen is unlit.
davide (211 rep)
Aug 15, 2015, 11:44 AM • Last activity: Feb 27, 2024, 03:34 PM
1 votes
1 answers
3264 views
Download file from Android shell
I am making a shell script for Android to run on ADB, however, the script should download a file. Commands like `wget` and `curl` aren't available in `/system/bin`. Here are a few possibble solutions that I thought of, each with its cons: 1. Rooting and installing BusyBox (my target systems are root...
I am making a shell script for Android to run on ADB, however, the script should download a file. Commands like wget and curl aren't available in /system/bin. Here are a few possibble solutions that I thought of, each with its cons: 1. Rooting and installing BusyBox (my target systems are rootless) 2. Downloading file in computer using wget or curl then transferring the file to Android with adb push (the script should be ran on Android, not the computer connected to it) 3. Downloading wget or curl in Android (how can I download a binary without them in first place???) 4. Termux (nope, my script sets some settings in Android which Termux can't) Is it even possile? If yes, how?
sudoer (159 rep)
Jan 8, 2023, 11:54 AM • Last activity: Feb 8, 2024, 10:05 PM
2 votes
2 answers
33936 views
Error "Function not implemented" when creating symbolic link
I'm trying to execute this command `busybox ln -s "mydir/" "$PWD"/mylink` in order to create a symbolic link from mydir; that, I am receiving the following error `ln: /mnt/shell/emulated/0/mylink: Function not implemented`! I've tried this in both `adb shell` and Android Terminal Emulator but to no...
I'm trying to execute this command busybox ln -s "mydir/" "$PWD"/mylink in order to create a symbolic link from mydir; that, I am receiving the following error ln: /mnt/shell/emulated/0/mylink: Function not implemented! I've tried this in both adb shell and Android Terminal Emulator but to no avail. **Update:** Filesystem 1K-blocks Used Available Use% Mounted on tmpfs 496976 64 496912 0% /dev devpts 0 0 0 0% /dev/pts proc 0 0 0 0% /proc sysfs 0 0 0 0% /sys selinuxfs 0 0 0 0% /sys/fs/selinux debugfs 0 0 0 0% /sys/kernel/debug none 0 0 0 0% /acct tmpfs 496976 0 496976 0% /mnt/secure tmpfs 496976 0 496976 0% /mnt/asec tmpfs 496976 0 496976 0% /mnt/obb tmpfs 496976 0 496976 0% /mnt/fuse none 0 0 0 0% /dev/cpuctl /dev/block/mmcblk0p1 774064 420392 353672 54% /system /dev/block/mmcblk0p2 431368 94172 337196 22% /cache /dev/block/mmcblk0p8 59034284 5817516 53216768 10% /data /dev/fuse 59034284 5817516 53216768 10% /mnt/shell/emulated /dev/block/vold/179:49 31632380 25335912 6296468 80% /storage/sdcard1 //192.168.0.1/sdcard 30584780 23082428 7502352 75% /mnt/routersd //192.168.0.1/sdcard 30584780 23082428 7502352 75% /mnt/shell/emulated/0/routersd
David (386 rep)
Jan 21, 2016, 12:55 PM • Last activity: Jan 16, 2024, 01:10 AM
1 votes
1 answers
1608 views
Why does Terminal Emulator for Android has completely different commands comparing to GNU/Linux?
I installed Terminal Emulator for Android hoping I could easily get root access, install apps via terminal, etc. So, thinking Android is a Linux distribution, I felt that it must have a terminal emulator (to really feel I'm using Linux), but when I tried some commands, none of them worked! Why? What...
I installed Terminal Emulator for Android hoping I could easily get root access, install apps via terminal, etc. So, thinking Android is a Linux distribution, I felt that it must have a terminal emulator (to really feel I'm using Linux), but when I tried some commands, none of them worked! Why? What commands are used on Android?
VIPaul (23 rep)
Dec 28, 2014, 04:32 PM • Last activity: Dec 25, 2023, 04:32 AM
2 votes
1 answers
1464 views
Clearing an app's *cache* and not the app's *data* via pm (or other CLI utility)?
I'm running Android 13 in a rooted environment, and I want to use `pm` or some other Android command-line utility to clear an app's cache. If I do `pm clear package.name`, it clears the app's data, and that's not what I want ... I only want cache clearing with the app's data remaining intact. This n...
I'm running Android 13 in a rooted environment, and I want to use pm or some other Android command-line utility to clear an app's cache. If I do pm clear package.name, it clears the app's data, and that's not what I want ... I only want cache clearing with the app's data remaining intact. This needs to be a command-line utility, because I want to run it within a Tasker task. It could also be a shell script that runs multiple CLI commands. I know that I can do pm trim-caches [... args ...] to clear all caches of all apps, but that's not what I want, either. I want to clear the cache of one and only one app at a time. Thank you in advance for any suggestions.
HippoMan (955 rep)
Nov 12, 2023, 06:44 PM • Last activity: Nov 12, 2023, 06:53 PM
1 votes
1 answers
291 views
How to auto switch on/off precise location automatically, programmatically for Google Maps?
Is there an `am` command line or similar that permits do turn off/on Google Maps precise location? Ideally, could be a wrapper script in shell to enable precise mode, then when quitting maps, setting back to disabled mode. Or maybe an `am` command to save settings states before/after use. Any hint p...
Is there an am command line or similar that permits do turn off/on Google Maps precise location? Ideally, could be a wrapper script in shell to enable precise mode, then when quitting maps, setting back to disabled mode. Or maybe an am command to save settings states before/after use. Any hint please? Open to alternatives way. Searched web + here with no good answer.
Gilles Quénot (735 rep)
Oct 28, 2023, 12:50 PM • Last activity: Oct 30, 2023, 12:48 AM
1 votes
0 answers
241 views
Find `MainActivity` for `com.google.android.dialer`
I have a Xiaomi POCO X5 5G, running MIUI Global 14.0.4. There is a problem where (in the Global ROM) the Google Phone app (as a system app) seems to be killed, even with MIUI Battery Optimization disabled. There is no option for Autostart in settings. If someone knows how to force enable Autostart f...
I have a Xiaomi POCO X5 5G, running MIUI Global 14.0.4. There is a problem where (in the Global ROM) the Google Phone app (as a system app) seems to be killed, even with MIUI Battery Optimization disabled. There is no option for Autostart in settings. If someone knows how to force enable Autostart for a system app (when the option is not present) please let me know, but for now, let's look at the Y of this X/Y problem. I am trying to resolve this issue using Tasker. I have a profile that triggers on Display Off event. The task it should run is to start the phone app in the background. I have found the following command, which I've put in Run Shell: - am startservice -n com.google.android.dialer/.MainActivity - am startservice -n com.google.android.dialer/.main.impl.MainActivity - am startservice -n com.android.dialer/.MainActivity - am startservice -n com.android.dialer/.main.impl.MainActivity - am startservice -n com.android.dialer.Dialer_Application/.MainActivity And many, many other attempts. I am running these commands in Termux as root to try to find one that works. I am looking at AndroidManifest.xml to see what all the possible activities are. I can't figure it out, I always see:
Starting service: Intent { cmp=com.google.android/.MainActivity }
Error: Not found: no services started.
I have even used an app to create a shortcut to start that activity, and then copied the settings from that app. Nothing seems to work. How can I start the dialer in the background using Tasker?
Jacob Birkett (135 rep)
Aug 17, 2023, 12:34 AM
0 votes
0 answers
436 views
How to find the RAM type in command prompt in Android?
I am trying to find out what the memory type of my Android phone is, i.e. if the device is LP4 or LP5 type. On Windows PC, there is `wmic` command to get this system information. However, I can't find the equivalent for Android. Is there any way from the command line that we can find out if the devi...
I am trying to find out what the memory type of my Android phone is, i.e. if the device is LP4 or LP5 type. On Windows PC, there is wmic command to get this system information. However, I can't find the equivalent for Android. Is there any way from the command line that we can find out if the device is LP4 or LP5? Like accessing the shell and finding out the memory type.
user1856470 (1 rep)
Jul 4, 2023, 08:17 AM • Last activity: Jul 5, 2023, 04:40 PM
Showing page 1 of 20 total questions