Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs
25 votes

How to return to the home screen with a terminal command?

Actually you can just push the "home" button adb shell input keyevent KEYCODE_HOME KEYCODE_HOME Key code constant: Home key. This key is handled by the framework and is never delivered to ...
Ilya Gazman's user avatar
17 votes

What's the best way to restart Android via command line (remotely)?

What is the device doing exactly when I'm pushing the (hardware) power button? I guess that's the most friendly way. You get to see a dialog with an option to power off the device (stock Android ...
Firelord's user avatar
  • 25.1k
15 votes
Accepted

How to install app from command line (terminal)?

Given enough privileges (ADB, root, system application) you can use simple terminal commands to install apps: On a PC: Run the simple command adb install <path to .apk file> and the app will ...
GiantTree's user avatar
  • 4,062
15 votes

Launch AVD manager from command line

There is no way to launch AVD manager from cmdline (It is deprecated) There is no way to launch AVD from cmd line. But you can use avdmanager cmdline tool to create, delete, move, list & edit your ...
Rajendran Nadar's user avatar
13 votes

A way to get the current resolution size and DPI from the command line/terminal/adb?

In Android versions equipped with wm tool, you can use the commands: adb shell wm size # shows the real size and current size adb shell wm density # shows the real density and current density ...
Firelord's user avatar
  • 25.1k
11 votes
Accepted

Turn on USB debugging using command-line

If the question is simply "using the command-line" Let it be simple (root possibly[1] required): settings put global development_settings_enabled 1 settings put global adb_enabled 1 And then you ...
iBug's user avatar
  • 7,767
10 votes
Accepted

Obtaining app storage details via ADB

My first instinct to dig out such information which is often available via programming route is to go through dumps of various system services. One such service is diskstats whose only purpose is to ...
Firelord's user avatar
  • 25.1k
8 votes

Update Android SDK Platform Tools via Command line

Use of android tool is deprecated; instead use sdkmanager: androidsdk/tools/bin/sdkmanager --update https://developer.android.com/studio/command-line/sdkmanager.html
Peter Tran's user avatar
7 votes
Accepted

Where to find description of all "/system/bin/service" calls?

In Short Code related to service call command are just the arguments of the function and order at which the function occur in the aidl file of that service.Here is a syntax service call <...
royatirek's user avatar
  • 188
6 votes

Trigger Setup Wizard at next boot using command-line

In addition to Christopher's answer settings put global device_provisioned 0 Will disable some of the functionalities of the phone and will be unlocked after setup wizard. adb shell settings put ...
william ho's user avatar
6 votes
Accepted

How to store 'adb devices -l' output to a text file?

You can use > after any command followed by file name or file path where you want to save the file. It would look like this: adb devices -l > FILE_NAME
Firelord's user avatar
  • 25.1k
5 votes
Accepted

Wget using Termux download directory

To quote Izzy, wget usually downloads to where you called it from – unless told otherwise using the -O parameter. So you either first cd to the desired directory – or try something like wget -...
Grimoire's user avatar
  • 2,959
5 votes
Accepted

Backup boot.img via terminal one-line command

Fortunately, there's a static path available for you: /dev/block/bootdevice/by-name/boot ^^^^^^^^^^ Problem solved 😊 dd if=/dev/block/bootdevice/by-name/boot of=boot.img Stay away from ...
iBug's user avatar
  • 7,767
5 votes

How to do GREP text searching without root?

You are mixing up two things: Installing a binary like busybox system wide from within an app (which includes grep) Running a binary The default app based installers for busybox require root access ...
Robert's user avatar
  • 20.4k
5 votes

Why Android x86 9.0 boots in command line and not in GUI?

This is a semi permanent fix. It will stay fixed until you open settings. Then you can just do it again. 1. On the main VBox screen in the display section click on what ever follows Graphics ...
redwdc's user avatar
  • 51
4 votes

Trigger Setup Wizard at next boot using command-line

The following shell script will trigger the Google Setup Wizard: #!/bin/bash adb root adb remount adb shell settings put global setup_wizard_has_run 0 adb shell settings put secure ...
Christopher's user avatar
4 votes

Need one-line adb shell su push & pull to access /data from Windows batch file

adb root; adb push /local/file /distant/root/owner/file "adb root" will restart adbd as root then your push is accepted
jo_'s user avatar
  • 141
4 votes

Trigger Setup Wizard at next boot using command-line

The following command worked for me without root access: adb shell am start -a android.intent.action.MAIN -n com.google.android.setupwizard/.deferred.DeferredSetupWizardActivity
Jared Rummler's user avatar
4 votes
Accepted

How to pass commands to ADB shell?

The adb interactive shell only starts if you simply run adb shell. If you add a command at the end it will be executed on the device shell and then adb returns (non-interactive mode): adb shell ls /...
Robert's user avatar
  • 20.4k
4 votes
Accepted

Does Xposed Framework require to be buillt specifically for the device or just the Android version?

Built for the Android version, plus the device architecture (arm/arm64/x86). See the Xposed Framework download page (e.g. Android 8.1 (SDK27) here). The reason behind this is that part of Xposed ...
Andy Yan's user avatar
  • 9,539
4 votes

Manually trigger MediaScanner to scan files on Internal Storage on Nougat/Oreo

Note: It is possible the following commands do not work out for you with just USB debugging / shell (uID 2000) user. In that case, you must have root access to make them work. Before KitKat, this ...
Firelord's user avatar
  • 25.1k
4 votes
Accepted

How can run native executables compiled for ARM on unrooted Android devices?

In addition to noexec mount option, /sdcard is emulated filesystem with fixed file permissions. So files can't be set executable. But some file explorers like MiXplorer support executing binaries/...
Irfan Latif's user avatar
  • 20.6k
4 votes
Accepted

Enable OTG with a shell command

Note: the solution is tested on a rooted OnePlus 6 running OxygenOS (Android 8, 9, 10). The command I use is: adb shell su -c 'setprop persist.sys.oem.otg_support true' Some folks on some forums ...
Firelord's user avatar
  • 25.1k
4 votes
Accepted

How to get 2nd IMEI number using adb?

Which code to use with service call depends on Android release. On Android 9 IPhoneSubInfo method 1 returns first IMEI while methods 3 and 4 return both IMEIs: ~$ service call iphonesubinfo 3 i32 1 | ...
Irfan Latif's user avatar
  • 20.6k
4 votes

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

Most device will prompt an Yes/No UI, and the user can press Volume Up/Down to choose an option, and press power to comfirm. "fastboot oem unlock-go" will skip the prompt. But no all device ...
Yong's user avatar
  • 151
4 votes
Accepted

Verifying a (custom) ROM signature

In order to verify the signature of a ROM ZIP file on a PC, two things are required: The public key from the ROM creator (can be extracted from /system/etc/security/otacerts.zip if the creator is the ...
Irfan Latif's user avatar
  • 20.6k
3 votes

pm hide VS pm disable -- the identity crisis

I don't have enough points to comment yet.. This is not an answer... more like... information: pm hide does this pm disable does this and if it can find the component name then this. I can see how ...
Jeff Luyet's user avatar
3 votes

Disable touchscreen input via console

I found a solution from https://android.stackexchange.com/a/193667 rm -rf /dev/input/event0 Does "delete" my touchscreen input. The other events disable/delete my other hardware buttons ...
AusGutemGrund's user avatar
3 votes

How can I find which apps/packages reference a given permission using command line?

This worked for me (Android 8): cmd appops query-op RUN_IN_BACKGROUND allow | sort It shows which packages have RUN_IN_BACKGROUND mode enabled.
VasyaNovikov's user avatar
3 votes

A Real Terminal (Root or No-Root)

There is a terminal app which uses "apt" to install packages. Its awesome and has lots of packages ported for arm devices -- Termux & Playstore Link
Xplore's user avatar
  • 131

Only top scored, non community-wiki answers of a minimum length are eligible