Questions tagged [command-line]

A "command line" is a text interface to enter commands interactively. In our context, it usually means a "Unix Shell" in a terminal app, or the ADB shell on a computer to interact with an Android device.

Filter by
Sorted by
Tagged with
1 vote
0 answers
22 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 ...
HippoMan's user avatar
  • 715
2 votes
1 answer
450 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 ...
HippoMan's user avatar
  • 715
0 votes
0 answers
181 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
1 vote
1 answer
103 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
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
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
207 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 ...
user1856470's user avatar
0 votes
0 answers
60 views

Run avdmanager with sudo

I am running avdmanager create avd from my python script that I start with sudo -E to make my script be able to do priveldged stuff. But for some reason avdmanager created AVD inside /root/.android/...
Euler-Maskerony's user avatar
1 vote
0 answers
113 views

How to download all Android SDK platforms using sdkmanager from terminal without Android Studio?

Need to automate downloading of all available Android SDK Platforms using the sdkmanager from terminal. For example, an Android SDK Platform 19 can be installed using sdkmanager "platforms;...
Fr0stM0urne's user avatar
0 votes
0 answers
51 views

How to know apps which boots with system using commands in Android terminal?

I need commands for Android 4-6. How to know via Android terminal and command which apps loading on the system's start? While I tried 2nd command from here.
Paul K.'s user avatar
  • 11
0 votes
0 answers
28 views

How to get titles of installed apps on device? [duplicate]

I connected Android device to desktop with Windows using USB. I need to get titles of installed apps. What command for Windows command line to complete the task? I used ADB for other tasks, but while ...
Paul K.'s user avatar
  • 11
2 votes
0 answers
298 views

Force USB tethering on an Android

I am using a Windows system and I want to add my old tablet (Acer Iconia A1-810 without LTE) as a second monitor. It is running Android 4.4.2 Kitkat, and I found an app for Android called spacedesk to ...
Pressy 03's user avatar
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
0 votes
1 answer
863 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
1 vote
1 answer
442 views

What is the official Android repository containing APKSIGNER?

What is the official source for apksigner as referenced e.g. in this answer? People are citing Android Studio, Android SDK Build Tools/Platform Tools/Command Line Tools etc. (as well as some shady ...
srhslvmn's user avatar
  • 289
0 votes
1 answer
974 views

How to list suspended apps?

You can "suspend" user apps via cmd package suspend <packageName> (which acts kind of like pm disable; the differences are explained in this answer by @Firelord), and later unsuspend ...
Izzy's user avatar
  • 91.2k
0 votes
0 answers
59 views

Why can't I get similar performance degradation with Monkey in different experiments?

I have configured experiments to test which among 10 launched apps impacts performance the most. But I can't make an objective comparison, because if I launch the experiment twice with the same ...
Luigi's user avatar
  • 101
0 votes
0 answers
100 views

Why doesn't Monkey generate the same sequence of events?

I'm running stress tests on Android using Monkey to generate the workload. For the type of analysis I have to do, I need to generate the same sequence of events for each experiment. So, in every ...
Luigi's user avatar
  • 101
0 votes
0 answers
1k views

What does the -g global flag do when using pm install -g

I'm trying to get google play store to work on a proprietary custom ROM. I was given a hack to do this with my device. It's very hit or miss but I can get it working sometimes. When I install Google ...
silencedogood's user avatar
0 votes
0 answers
200 views

Create and edit a bash script in an USB connected smartphone

The question explains it all. I am using Ubuntu 20.04 LTS. I have connected an android smartphone to pc using USB. Changed directory to internal storage using: cd /run/user/*/gvfs/*/'Internal Shared ...
SuperNoob's user avatar
1 vote
0 answers
372 views

Read input from stdin when using `pm install`

I would like to install an application using pm install but not provide the APK path and rather provide application data using stdin as shown in the documentation below: install [-rtfdgw] [-i PACKAGE] ...
synti-chocolate's user avatar
1 vote
0 answers
62 views

Command line to remontly shutdown the display and power on

I'm using a digital signage CMS and app to control an Android tablet with root access. I can "reboot" it with this simple command, but I haven't found a command line to put the display to ...
Alin's user avatar
  • 11
5 votes
1 answer
5k views

Verifying a (custom) ROM signature

Android ROMs and also Android custom ROMs are typically cryptographically signed. Most users will only recognize this if they try to install a ROM and the signature verification on-device fails. For ...
Robert's user avatar
  • 20.3k
1 vote
1 answer
9k views

adb sideload lineage.zip yields adb: failed to read command: No error

TL;DR Trying to sideload Lineage, I hit a brick wall getting the following error: D:\Setups\XXXXX\Lineage FP3\platform-tools_28.0.2(ADB_1.0.41)> adb sideload lineage-17.1-20210104-nightly-FP3-...
Cadoiz's user avatar
  • 201
3 votes
3 answers
13k views

ADB server version (40) doesn't match this client (41) {Not using Genymotion}

Disclaimer: this is not a duplicate to this SO question as the source of the question is different and the answers don't apply.* I hope, it is correctly placed in AE and that the note about not using ...
Cadoiz's user avatar
  • 201
1 vote
0 answers
443 views

Cant' mount loop device

After I format the loop.img (formatted as ext4) I can mount it no problem. But when I'm trying to remount loop.img from external sdcard to /data/data/com.termux/home/ubuntu20-fs/ always throw invalid ...
Jtnqr's user avatar
  • 161
1 vote
2 answers
2k views

Termux (Terminal) tsu is adding "(unreachable)" to my current working path

When I run tsu (which is Termux's version of su), my current working directory gets prefixed with "(unreachable)", as you can see from the transcript of my session. [u0_a116 …/~]$ tsu [root …...
user avatar
2 votes
1 answer
1k views

Stop ActivityManager killing background Termux processes

I've been trying to run a ssh and a http server on my non-rooted Android phone using Termux. I've installed Termux:Boot and termux-services to run them. The server processes run for a while after I ...
MJ Walsh's user avatar
  • 221
1 vote
0 answers
334 views

Bind command on ADB to Android Emulator problem

im sorry.. im new here.. i don't know where to start. i want to run some command in emulator (android). im running certain apps, and i need it to run and not to be detectable in emulator instead as ...
HazeRiff Technician's user avatar
2 votes
1 answer
2k views

Is it possible to disable USB tethering from command line?

I try to be able to stop USB tethering. I tried: adb shell am stop com.android.settings/.TetherSettings # Unknown command: stop adb shell am kill com.android.settings/.TetherSettings # nothing adb ...
Gilles Quénot's user avatar
4 votes
1 answer
4k views

What is the difference between fastboot oem unlock and fastboot oem unlock-go?

I'm having issues unlocking my Nexus 7 2013 WiFi's bootloader, and it was suggested that I try fastboot oem unlock-go instead of fastboot oem unlock. Both seem to act the same on my device, however ...
Newbyte's user avatar
  • 151
0 votes
0 answers
54 views

How to make phone say something from commandline

I want to send a command which makes the phone say something. Is there any way I can install such a command, or is there one that I don't know about? The phone is rooted so I have full access to it ...
user avatar
0 votes
0 answers
549 views

How to disable user input (touchscreen) from command line without root

In the android command line, I need to disable the touchscreen user inputs. I do not want to use root because I want it to be universal instead of device-specific (root is obviously not as widespread ...
user avatar
1 vote
0 answers
2k views

please explain the: >"adb shell sm partition disk:179,64 mixed 80" command

it is taken from I want to split one MicroSD card into two parts: part adoptable storage, and part normal storage. How can I do this? what is 80 at the end? 80%? I ran that on an Adoptable Storage ...
London's user avatar
  • 11
0 votes
0 answers
793 views

Disabling data for specific apps on android

My device is rooted with magisk, and I prefer cli options over apps. My device have android version 10 with stock android. All the firewall apps connect to a vpn (which i don't trust at all) to ...
knoftrix's user avatar
  • 109
1 vote
1 answer
3k views

how to connect and disconnect from WiFi using ADB (not a root user)?

I found this project which allows me to connect to a WiFi through ADB commands not being a root user. I was wondering if anyone knows how to disconnect also from ADB and not being a root user. ...
Natiya's user avatar
  • 57
0 votes
1 answer
165 views

How to launch a pdf from a terminal?

I gain precious time by launching pdf from the terminal in Linux evince ~/mypdf.pdf What is the exact command that allows me to do that on android? This post gives the following template: am start ...
user123456's user avatar
0 votes
1 answer
3k 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: am start -a android.intent.action.SENDTO -d sms:121 -...
Rabib's user avatar
  • 1
9 votes
2 answers
9k views

Obtaining app storage details via ADB

TL;DR: On-device, we can navigate to Settings › Apps, and for each app separately can call up details on storage used: by the app itself, by its data, by its cache. Is it possible to obtain those ...
Izzy's user avatar
  • 91.2k
3 votes
3 answers
15k 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 commandline then after some seconds i can only see just a dash appearing and disappearing. I ...
user avatar
2 votes
1 answer
5k views

How to get 2nd IMEI number using adb?

I am currently using this command adb shell "service call iphonesubinfo 1" to get IMEI number, but it only returns 1st one. Does anyone know how I can get the 2nd IMEI number?
Muhammad Yahya's user avatar
2 votes
1 answer
1k views

How to stream an encrypted backup of the entire device to remote host?

I have an Android device that has no free space and no SD-card that I can replace (thanks to OnePlus policy). I also have no free space on PC to accommodate the backup so I wanted to upload it to the ...
beppe9000's user avatar
  • 155
2 votes
1 answer
3k views

Read GPS location from command line via SSH

I am wondering if there's a way to read the current GPS coordinates via SSH using SSHelper as SSH server. I came accross some similar threads: How to detect GPS status through adb shell? A way to ...
soelderer's user avatar
2 votes
1 answer
11k views

How to set Wi-Fi HTTPS proxy, not HTTP, via adb shell?

For HTTP I found a link: How to set WIFI proxy via adb shell? But I want to setup HTTPS proxy via adb shell.
Manish's user avatar
  • 21
0 votes
0 answers
4k views

Enable and disable system overlays with shell command

I'm trying to create an automatic Dark Mode using Tasker, which would work disabling overlays (to get a default light theme) and enabling others (to get a dark mode). For the light theme I run cmd ...
Psycoguana's user avatar
2 votes
1 answer
3k views

How can I run chroot on Android?

I have my chroot environment setup (Alpine Linux) in /sdcard/alpine. I try running my chroot with the following commands: su chroot alpine /bin/busybox (busybox is the cli of Alpine) I get the ...
HolyCow's user avatar
  • 21
1 vote
2 answers
18k views

is it possible to activate usb debugging using adb command line?

i have xiaomi phone and forget mi account. so i try to restore it using factory reset. i try to enabling USB debuging then. but it says "developer option is not avaiable for this user". adb is active. ...
Dimas Prasetya's user avatar
3 votes
3 answers
8k 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, ...
Abraham Murciano Benzadon's user avatar
1 vote
1 answer
118 views

“agrep” for Android Terminal?

How can I do this (agrep) in the Android Terminal? This program allows elastic text searching, which means that searchqwery would match searchquery, and searching Android would also match Anfroid or ...
neverMind9's user avatar
1 vote
0 answers
1k views

How to switch between APNs using adb?

Is there any adb or shell command available to switch between different APNs?
Neeraj's user avatar
  • 111

1
2 3 4 5