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.

77 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8 votes
0 answers
2k views

How to get to know via command-line/adb where boot process hangs?

Question: (How) is it possible to get to know via adb where exactly a booting-up android device is hanging? My problem/ background information: I recently did changes on the automatic display ...
Golar Ramblar's user avatar
6 votes
0 answers
8k views

Install Split APK Manually

Recently I got to know a thing called split apks, and found the slices as invalid apk files, only the base is. Unfortunately, this means the usual default package installer is unable to handle this, ...
404 Name Not Found's user avatar
6 votes
0 answers
16k views

How to restart a system app from the command line?

After deploying a new APK for a system app, is there a way to restart the app process without rebooting the device? Non-system apps are managed with the Activity Manager through the am command. There ...
Eric Platon's user avatar
5 votes
1 answer
5k views

FFMpeg stream to FFServer from Back Camera

I'm looking for a way to stream my camera video from my Android phone to an FFServer, like I would with FFMpeg from the command line in Linux: ffmpeg -f video4linux2 -i /dev/video0 http://IP:8090/...
jfreak53's user avatar
  • 240
4 votes
2 answers
2k views

Invoke /system/bin/sdcard manually via terminal

I am trying to mount an EXT4 formatted SD card under Cyanogenmod 13.1 (Android 6.0.1). So far, I have setup scripts to mount the card at /mnt/ext_sdcard during boot. My current understanding is that ...
Jake's user avatar
  • 41
4 votes
0 answers
664 views

Enable bluetooth tethering via command line

Is there a way to activate the bluetooth tethering mode in Lollipop using the command line? You can do it for usb tethering by running the command service call connectivity 30 i32 1 Is there a similar ...
jojolepirate's user avatar
3 votes
1 answer
2k views

Can I run a Linux executable on Android?

I wondered if it is possible to run a Linux executable on Android so I made a simple console application in Code::Blocks in C++ (I am using Ubuntu Linux), built it in release mode and copied it into a ...
xuwenbuwer's user avatar
3 votes
0 answers
1k views

Cause and solution of "Error: Unknown operation string: <OP>"

First of all, the following command works perfectly fine on Android 5.1.1 (CM, PA and Tesla ROM builds): adb shell su -c 'appops set android SYSTEM_ALERT_WINDOW deny' The said command blocks Android ...
Firelord's user avatar
  • 25.1k
3 votes
0 answers
3k views

How can I change preferred network type through a script (or terminal command)

I'm currently attempting to create a workaround for a problem that is plaguing a ROM that I'm using. While my phone and ROM are capable of using LTE, and use it perfectly fine, the "preferred network ...
projectisaac's user avatar
2 votes
0 answers
270 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
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
2 votes
0 answers
462 views

Shutdown/Reboot Process Hangs Device

Is there any reason a programmatic or command-line shutdown (or reboot) process in Android 7.1 might randomly result in a hard freeze-up, requiring a long (~8 second) press of the power button to ...
csr19us's user avatar
  • 21
2 votes
0 answers
8k views

Package installation in Termux

I'm reading this guide that describes how to install the statistical language R on Termux. My installation journey is briefly outlined below. I need to determine why nothing happens at Step #2 ...
stackinator's user avatar
2 votes
1 answer
1k views

How to make adb shell commands wrap single line to multiple lines by default?

Let's say I have this long one-liner command: am force-stop com.example.foo; am force-stop com.example.bar; am force-stop com.example.foo2 am force-stop com.example.bar2; am force-stop com.example....
林果皞's user avatar
  • 253
2 votes
0 answers
40 views

is it possable to install a linux distro ie:- nethunter on a android device

I have been trying to work out how to use my old Android tablet as a stand alone Linux tool for pen-testing and network monitoring and logging. I have it boot straight into the OS without having to ...
Chrisso's user avatar
  • 21
2 votes
0 answers
337 views

Why does every adb command take several minutes?

I've run adb devices and adb push some-stuff /sdcard, and both commands take several minutes. Once adb push gets started though, it races through the file, so the throughput is fine. It just takes an ...
l0b0's user avatar
  • 421
2 votes
0 answers
414 views

Ngrok (compiled for Arm5) crash on android: can't find core dump files!

I downloaded Ngrok which I want to install on a old HTC Hero [the project is to transform the phone in a ipcam, reachable behind a NAT network], so I chose the version compiled for Arm5. You can find ...
J. A.'s user avatar
  • 21
2 votes
0 answers
2k views

How can I easily copy files from an Android device to a computer wirelessly via command line?

I need to copy jpegs from an Android phone's sdcard to a computer, ideally through command line (/storage/sdcard1/*.jpg to a remote location) I've tried Izzy's solution from this post like so: scp -...
George Profenza's user avatar
1 vote
0 answers
95 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
1 vote
0 answers
101 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
1 vote
0 answers
350 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
57 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
1 vote
0 answers
434 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
0 answers
319 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
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
1 vote
1 answer
115 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 vote
0 answers
104 views

Installing a homebrew/linuxbrew formula on an Android device

How would one go about installing a simple homebrew/linuxbrew formula on an Android device via adb? Specifically, I want to install this formula which contains a cli tool called aamath that translates ...
pre-kidney's user avatar
1 vote
1 answer
916 views

Can't chown or chmod files on android phone

Hi there i got some files on my android phone and want to make them executable. Permissions are root:sdcard_rw. I cant remove tha sdcard_rw with chown, and cant make the files executable with chmod.
seyo -IV's user avatar
1 vote
0 answers
1k views

Why using ADB command 'settings put global preferred_network_mode' doesn't reflect the changes in Test Settings?

I've been trying to search about changing network mode programmatically which was already answered, but I noticed that when using: settings put global preferred_network_mode x settings put global ...
threeFatCat's user avatar
1 vote
0 answers
486 views

Is there a command in /system/bin to wipe cache?

Is there a command in /system/bin to perform cache clearing?
A frustrated nerd's user avatar
1 vote
0 answers
417 views

Running commands operating on files always results in permission denied errors

When I try executing commands operating on files, they always fail. I can't check permissions on the terminal because I'd have to run a command that operates on a file (directory) in order to do so. ...
UTF-8's user avatar
  • 245
1 vote
0 answers
466 views

How to assess what apps or settings are causing high CPU usage from system_server process on Android Nougat?

I am running root Android Nougat on a Nexus 6P. My battery is draining in <3hrs. When I run su -c htop it shows system_server is using >400% CPU. I have now factory reset 3 times and each time this ...
rjdang's user avatar
  • 11
1 vote
1 answer
4k 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) ...
Pandya's user avatar
  • 457
1 vote
0 answers
127 views

Arduino heart rate sensor bluetooth terminal upon event command

I have an Arduino uno r3 set up as a pulse/heart rate monitor, I have a HC 05 bluetooth module set up so i can connect with my android phone, i get the reading on my android phone in a "heart rate is ...
Steveo's user avatar
  • 11
1 vote
0 answers
2k views

I can't remount /system as rw. I get an error message: mount: Read-only file system

I'm using a rooted Huawei G7 and i'm trying to install BusyBox, but I keep getting an error. I'm 100% sure this error is because there is some weird write protection on /system. I know this because ...
Sjoerd Arts's user avatar
1 vote
0 answers
129 views

Run Android on Android?

We know it is possible to use chroot to run full Linux on android, also support Xserver (GUI).So, it should also be possible run another android on an exist android ? for example, using chroot to run ...
Hunter Han's user avatar
1 vote
0 answers
1k views

adb devices -l not showing USB qualifiers?

I've read in several places that calling adb devices -l will return the both the serial numbers and USB qualifiers for the attached devices. However, when I issue the command I only get the ...
AcFreeman's user avatar
  • 111
1 vote
0 answers
3k views

Get package name of an app given its displayed name using ADB commands

I'm trying to: Get the package names of all apps on my device (none of them are mine so sadly I can't get it from the Manifest) and put it into a file to save for a class project. I also want to get ...
Vel's user avatar
  • 21
1 vote
1 answer
1k views

ERRORLEVELs in adb push and pull

I need to execute adb commands from DOS batch files, but I need to know if the push and pull commands were successful. Do these commands return an ERRORLEVEL, or some other environment variable to ...
user3516774's user avatar
1 vote
1 answer
3k views

Get common name of an app given its package name

I'm interested in a way to go from the package name (e.g. com.android.providers.telephony) to its common name (Phone). I'd like to know if there's ADB/shell command (from the phone), or any system/...
Robert Siemer's user avatar
1 vote
0 answers
204 views

netcat listening on nexus 4 doesn't seem to respond

I have a Nexus 4 on my wifi network along with a laptop. I would like to establish a connection using netcat from my laptop to my phone. On my phone, I can run uname -a | nc <LAPTOP IP> <...
tlehman's user avatar
  • 111
1 vote
0 answers
703 views

AVD Manager runs but android.bat does not

I can create virtual devices using AVD manager. I can run the emulator and create AVDs. But i cannot do the same using "android.bat". I get the following error- ERROR: No suitable Java found. In ...
Alap's user avatar
  • 11
1 vote
0 answers
3k views

Toogle 3G, Bluetooth, and WiFi with Android Linux or ADB commands

Since I have not found an Android command reference list (with meaning and usage of the command), I have some questions: Can I disable/enable 3G? Can I disable/enable bluetooth? Can I switch from one ...
user avatar
1 vote
1 answer
8k views

How do I investigate the memory Usage?

I've a Micromax A74 with (rooted) Android 4.2.2. Recently I've faced the crashing of some application and started to analyze the usage of RAM. Settings>Apps>Running is not helpful: Sometimes I found ...
Pandya's user avatar
  • 457
0 votes
0 answers
119 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
0 votes
0 answers
46 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
176 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
57 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
0 votes
0 answers
49 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