23
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 ...
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 ...
17
votes
Installing an app from Play Store using the command line
I was looking for the same answer, i can't find a single command to do this, but i found few options that could be useful in such cases:
A. download the .apk to your computer and install the apk from ...
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 ...
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 ...
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
...
11
votes
Command to list partitions?
You can see names and partitions at same time.
If you have an eMMC internal storage :
ls -l /dev/block/platform/msm_sdcc.1/by-name/
or for me :
ls -l /dev/block/platform/7824900.sdhci/by-name
It ...
11
votes
Need one-line adb shell su push & pull to access /data from Windows batch file
Well, you have to do a few commands, as I don't believe it will work in one.
You need to do:
adb shell
su
cd /data/path/of/file
cp /data/path/of/file/copyme /data/local/tmp
chown shell.shell /data/...
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 ...
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 ...
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
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 <...
6
votes
Accepted
How do I install missing command line tools onto an Android device?
For rooted Android devices
You can consider installing BusyBox app by Stephen. Per Play Store, the minimum Android version supported by app is Android 1.6 and it is a well-updated app. In essence, it ...
6
votes
Error "Function not implemented" when creating symbolic link
The filesystem you're trying to create the symbolic link on doesn't support symbolic links. All the native Linux filesystems (ext2-4) support symlinks, but the DOS filesystem used on SD cards doesn't, ...
6
votes
Trigger Setup Wizard at next boot using command-line
Note: This solution:
requires a rooted Android;
is tested on Android 4.4.2, Vanir (Android 5.1.1) and on an unofficial CM13 build;
requires adb setup in PC.
Following are some screenshots serving ...
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 ...
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
5
votes
Accepted
How can I find which apps/packages reference a given permission using command line?
The first section is ideally supposed to be OS (on PC) independent. The solution heavily depends upon the output of package service. It has been successfully tested on Android 4.2.1, 5.0.2 and 5.1.1 - ...
5
votes
Accepted
Use of the -i argument in fastboot command-line?
-i <vendor id> is used to specify a custom USB vendor id
according to the fastboot --help page
usage: fastboot [ <option> ] <command>
commands:
update <filename> ...
5
votes
Where should I install Toybox?
Where should I install Toybox?
Would it make more sense to install Toybox to my system partition, or to my data partition?
Depends. If you don't plan to factory reset the phone ever again, you can ...
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 -...
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 ...
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 ...
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 ...
4
votes
Allow "unknown sources" from Terminal without going to Settings App?
For newer android software use:
adb shell settings put secure install_non_market_apps 1
4
votes
Accepted
Acquire Android image using flash drive OTG
Is there any specific command or script to be put on the flash drive, to acquire image of Android smartphone and store the acquired image to the flash drive On-The-Go?
Nope. No special command or ...
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 ...
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
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
command-line × 236adb × 59
shell × 41
terminal × 40
linux × 21
root-access × 19
applications × 15
installation × 11
termux × 8
5.0-lollipop × 7
android-sdk × 7
scripts × 7
networking × 6
apk × 6
android-emulator × 6
mount × 6
ssh × 6
wi-fi × 5
4.4-kitkat × 5
usb × 5
file-system × 5
fastboot × 4
bluetooth × 4
boot × 4
permissions × 4