Questions tagged [shell]

The shell is a piece of software that provides a command-line interface to the operating system. Use this tag for shell-specific issues; general command-line issues should use the 'command-line' tag instead. See the full tag wiki for other related tags.

Filter by
Sorted by
Tagged with
1 vote
0 answers
18 views

Programatically query port # for Wireless ADB?

Every time Wireless Debugging is enabled, its listening port is randomized. Is there an way to programatically identify the current listening port for Wireless ADB connections, such as via a system ...
ETL's user avatar
  • 141
1 vote
1 answer
58 views

Running VLC from the shell in Android and also passing in a subtitles file?

I know how to launch a video in VLC from the shell under Android as follows: am start -n org.videolan.vlc/org.videolan.vlc.gui.video.VideoPlayerActivity -a android.intent.action.VIEW -d file:////...
HippoMan's user avatar
  • 715
0 votes
0 answers
37 views

How to disable or eject virtual sdcard by adb on emulator memu player 7

I'm trying to unmount the sdcard or virtually eject it, because not allowing me to run an APK that is presenting an issue. After a deep research even with app developers, they told me that disabling ...
backendcodez's user avatar
2 votes
1 answer
88 views

`adb shell mv` moves files but app doesn't work anymore, while it works if I move the same files via file manager

I try to move account-related files/directories of an app (for account changing purposes) via adb shell mv. Moving the files works great, but the app hangs while loading/login. If I move the files ...
Frinch87's user avatar
2 votes
1 answer
103 views

Why does Samsung not allow making more than 1 user?

I would like to add more users via pm on adb shell. Unfortunatly my S20 FE is set to only allow 1 user, 1 work profile and one secure folder user. I tried to add more with pm add-user gab1 but it said ...
CreaGab's user avatar
  • 21
0 votes
0 answers
47 views

Termux PostgreSQL initdb: wrong directory ownership

Recently, I installed PostgreSQL pkg on Termux. But when I wanted to use the initdb postgre command to initialize postgre directory, I had the wrong ownership: $ initdb postgres The files belonging to ...
C9_HP's user avatar
  • 21
0 votes
0 answers
179 views

ADB shell "vi" file and command issue

I don't know how to fix the following issue, please help me (My OS is Win 10): After I use adb shell to enter the device-> When I use "tab", it shows some symbols (it may related to the ...
Ghost's user avatar
  • 1
2 votes
0 answers
14 views

Need to replug USB device after reboot of Samsung s5e

Im using a Samsung tabs5e rooted as the media center in my car. I've connected it as follows: TabS5e - USB Hub USB Hub - DAC/Amp (via USB) Dac/Amp - Car via aux Now, my issue is that when I initially ...
Philip Schmid's user avatar
1 vote
1 answer
101 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 ...
Gilles Quénot's user avatar
0 votes
0 answers
47 views

adb fails with exit code 15

I run a console app (built with NDK) on an Android phone with the following command from my Windows machine: adb push MyApp /data/local/tmp adb shell "cd /data/local/tmp && chmod a+x ...
Alexey Starinsky's user avatar
0 votes
0 answers
49 views

Accept allow contact sync and messaging via command line

I would like to know if there is a way to "Allow Contact Sync" and "Allow access to Messages" on Android phone using command line. When the notification is received on my phone, it ...
lifelong_student's user avatar
0 votes
0 answers
268 views

Howto get ONLY uninstalled packages list with associated apk (if any)?

(rooted galaxy j5 7.1.1) As pm list packages -u shows ALL packages including uninstalled (at least on my system), what should be the right command to show ONLY uninstalled apps? Or is this an ...
martinist's user avatar
1 vote
0 answers
109 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 ...
Jacob Birkett's user avatar
0 votes
0 answers
46 views

Run script when android off

My alarm was ringing while my android device was off. I'm wondering if I can run a shell script while my android device is off. Assume I have rooted android.
Muhammad Ikhwan Perwira's user avatar
0 votes
0 answers
417 views

Run a root script using Magisk mount space

There are many questions on this site about running a root script but none using Magisk mount space. I have a Pixel 6a and came across this post (65) in a thread dedicated to improve the speaker ...
beeshyams's user avatar
  • 40.7k
1 vote
1 answer
261 views

How can I find CID from ADB shell?

I need to know the CID of an HTC 10 but, adb shell getprop ro.cid is unresponsive. Also $ fastboot devices FA********** fastboot $ fastboot oem readcid FAILED (remote: 'unknown command') fastboot:...
maxemilian's user avatar
2 votes
0 answers
409 views

How to enumerate all possible `adb shell input keyevent` codes for a device?

I have a damaged screen and touch digitizer on an automotive head unit. I am trying to access the diagnostics menu for the unit (Honda Clarity 2018 PHEV non-touring), but the touch input keys are not ...
Arctiic's user avatar
  • 861
3 votes
1 answer
1k views

Stock Android always using 100% physical memory. How to free it up with ADB?

I have a non-rooted phone. I just realized why Android is bad at memory management. I'm monitoring running progress in ADB shell with top. I can see the memory is about 100% used. Image resized. ...
Muhammad Ikhwan Perwira's user avatar
1 vote
0 answers
544 views

`connect-network` API not working on Android 13

I was using the connect-network API in my automation scripts on Nothing Phone (1). After updating my Android version to 13, it was not working and throwing the below error. Spacewar:/ $ cmd -w wifi ...
Bharath Reddy's user avatar
1 vote
1 answer
318 views

Is there a way to permanently delete specific (phantom) alarms using adb shell?

My phone has mysteriously created a phantom alarm meaning that no GUI app or widget shows this alarm on my phone and thus nothing allows me to see to set, delete, or view this alarm. Using adb dumpsys ...
Jim's user avatar
  • 121
1 vote
0 answers
367 views

Offset screen to non-broken area

My android tv is broken and about half the display is invisible. I followed this answer and tried to offset the display using adb shell wm overscan 960,540,0,0 This is supposed to move display to ...
LifeH2O's user avatar
  • 780
1 vote
1 answer
1k 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 ...
sudoer's user avatar
  • 149
3 votes
0 answers
294 views

Using "locksettings" to manage a 4x4 lock pattern?

I'm running Android 11 on a Pixel 5. I know about the locksettings --set-pattern ... shell command, but that command only seems to work in a 3x3 pattern space. For example, if the pattern is to start ...
HippoMan's user avatar
  • 715
1 vote
0 answers
62 views

Check 32 and 64 bit support individually on Termux [duplicate]

With Google Pixel 7 lineup ditching 32 bit support, I think it is now necessary to check for 32 and 64 bit support individually. From what I interpret, the Google Pixel 7 series will not be able to ...
sudoer's user avatar
  • 149
1 vote
1 answer
238 views

On Android 12+, how do I disable mobile internet without disabling MMS?

My good old phone from 2013 is dying. I have been satisfied with it, but even if it was still sold nowadays, I would not buy more of the same since it’s becoming increasingly difficult to not have ...
NovHak's user avatar
  • 146
1 vote
0 answers
420 views

/sys/class/net on Android 12

Recently, I bought a new phone with Android 12. This command worked on Android 10 (just Termux, no ADB, no root): cat /sys/class/net/wlan0/statistics/rx_bytes but failed on Android 12. Any work ...
sudoer's user avatar
  • 149
1 vote
0 answers
473 views

Storage manager (SM) Partitioned Micro sd card but how to mount the extended partition and use it as internal storage.?

Question:- Storage manager (SM) Partitioned Micro sd card but how to mount the extended partition and use it as internal storage.? I purchased 6 months before, Samsung Galaxy s20 Fe with android 12 ...
Androidquery's user avatar
2 votes
0 answers
108 views

Truncate a file inside Android filesystem

I have a large (1.3GB) binary file on internal/emulated storage of an Android device running KitKat (4.4.2, API 19); I want to truncate this file to a slightly smaller size (1.2GB), without copying/...
Janaka Bandara's user avatar
0 votes
0 answers
598 views

ADB root shell always waits for background job before exit

I want to run a process in background and close the terminal, so the process remains active. I need to run the process as root. Since adb root doesn't work for me, I use adb shell; $ su to gain root ...
g00dds's user avatar
  • 111
1 vote
0 answers
166 views

How to run device into repeater mode with shell script?

Currently my device on LineageOS 18.1 (Android 11) with root access and supported managed mode and AP mode at the same time. root@localhost:~# uname -a Linux localhost 4.9.326-Mi8937 #1 SMP PREEMPT ...
Zievfik's user avatar
  • 11
1 vote
0 answers
2k views

How to enable ethernet tethering via shell (android 12) [for a start-up script]

I've read numerous threads on doing it with USB Tethering, and I feel confident I could do that. However, I need it for ethernet. I can use Magisk + shell script at /data/adb/service.d. Any other ...
mwk's user avatar
  • 11
0 votes
0 answers
277 views

Encrypt files using Android shell tools

I want to encrypt and decrypt some files (symmetrically and asymmetrically) on the Android command line, including the one in the TWRP recovery. Is there a program which can do this? I've tried ...
Kippi's user avatar
  • 65
0 votes
0 answers
247 views

The calllog.db file remains the same even after changing

As you know on android call history in /data/data/com.android.providers.contacts/databases/calllog.db path as sqlite file. I change this file with adb push command then I will check on Dialer Call ...
F.Penb's user avatar
  • 1
0 votes
1 answer
857 views

Clear Data of Package for Single User

I am trying to clear the data for a few apps on a work profile without clearing the data on the main user account for my android phone. What I'm trying for example is : pm clear com.Microsoft.teams ...
Kayracer's user avatar
3 votes
0 answers
3k views

How to enable/disable VPN via adb/termux/terminal?

I have a VPN configured on my android device running Lineage OS 18.1 (Android 11). I'm not using any third party apps, I'm simply using the standard Android settings to specify my VPN login data etc. ...
Forivin's user avatar
  • 337
3 votes
1 answer
1k views

Is there a way to call/invoke a (private) Java function in an app?

Is there some tool that can be used in ADB shell or something similar (without root possibly) that can invoke a function in the app, while it is running?
hiddenhospitalresearch's user avatar
1 vote
0 answers
68 views

XPrivacy showing Kiwi Browser calling `shell/start` and `shell/exec`, what is this?

According to the XPrivacy app, shortly after starting the Kiwi Browser app, the app executes the following: It's a shell command with /system/bin/cmd package compile -r shared com.kiwibrowser.browser ...
ciltaderzo's user avatar
3 votes
0 answers
177 views

chmod and chown silently fail in shell for TwinApps media directory

I think I have a similar issue to Can't use chmod to alter permissions on emulated phone but the emulation is happening on the android device itself via the TwinApps feature, which allows you to ...
Ignat's user avatar
  • 131
3 votes
1 answer
2k views

Who is the "shell" user during ADB session?

In the Android environment, who is this "shell" user that I'm SSH-ing through ADB, as I attempt to see how much I could do with my Amazon Fire 10 tablet? Said user's level seems very, very ...
Dehbop's user avatar
  • 149
2 votes
1 answer
664 views

Alternative way to obtain Android screenshot in shell?

Ok, so first, I realized that one of my screen capturing apps on an Android 7 tablet, did not work (gave me a black screen capture), and then I realized this app not have the "Screen capture"...
sdaau's user avatar
  • 251
0 votes
1 answer
268 views

adb glob expansion

I'd like to be able to issue: adb pull storage/self/primary/Documents/*20220204* . Right now doing that gives: zsh: no matches found: storage/self/primary/Documents/*20220204*
mcp's user avatar
  • 161
2 votes
1 answer
9k 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 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 ...
boardtc's user avatar
  • 176
1 vote
0 answers
1k views

How can one list all large files?

One can list all directories on /mnt using: adb shell ls /mnt How can one list all files which are larger than 100M in the directory /mnt? adb shell find -size +10M ; sudo adb shell find -size +10M ...
showkey's user avatar
  • 141
1 vote
0 answers
918 views

adb shell input key event : perform a toggle button on off action

Questions How do I in Android 10 toggle on /off the hotspot using adb Su switch on / off for shell- How do I turn on Magisk manager && goto security options && there turn on / ...
user1874594's user avatar
1 vote
1 answer
2k views

LineageOS Recovery command line interface?

Is there an adb shell command line interface for LineageOS recovery? Alternatively, which adb commands will work when booted into lineage recovery? I want to factory reset my device as part of an ...
nohatsatthetable's user avatar
2 votes
1 answer
2k views

adb shell svc power stayon multiple device

When there is multiple Android-devices connected with Linux computer (using Linux Mint 20.2 Cinnamon, which is based on appropriate Ubuntu 20.04 LTS version) and scrcpy v1.12 then how to keep multiple ...
zeroconf's user avatar
0 votes
0 answers
246 views

🤔❓APK components - services, activities, broadcast & content receivers where's their data Stored?

As I understand Every APK install is associated with these components. Trying to figure out precisely where they are stored. Services Activities Broadcast receivers Content receivers For most apps ...
user1874594's user avatar
1 vote
0 answers
100 views

Why would Android list some files that are not accessible (I/O error)?

For background, trying to resolve a problem with a Android 4.x tablet Denver TAC-97032 (Tablet battery replacement and alloc_device_open fail?). The device cannot boot fully, but I can connect to it ...
sdaau's user avatar
  • 251
0 votes
0 answers
453 views

Run oneliner shell command in Tasker does not work

When using Tasker as a clipboard manager I made a shell script which reads the last clipping (also successfully captured by Tasker, in /storage/emulated/0/clipper/clip.txt). This I append to a file ...
php and js's user avatar
1 vote
0 answers
687 views

Pass extra data into `am start` command

Nougat Android (7.1.2) What I use actually (it works), the app starts with the last know location: am start com.location.provider What I'm looking for like: am start com.location.provider -e ...
VeilleurDEsAbyss's user avatar

1
2 3 4 5
9