25

am start -a android.intent.action.MAIN -c android.intent.category.HOME More info about shell commands: an archived version of the AndroidWiki page


22

Yes there is. When the community discovered this feature in android 4.1 (the code was exist but has not been declared yet so Google did not open the feature in Settings), I remember playing with this in my Nexus 4. So, here are some commands that I remember for the android Terminal: Create new user: pm create-user User_Name To switch between users: am ...


20

In order to assign a drive letter to a removable device, that device must support UMS (USB Mass Storage) protocol. Unfortunately most newer Android phones, especially those without a removable SD Card, do not support UMS. Instead, they support MTP (Media Transfer Protocol) and PTP (Picture Transfer Protocol) protocols. In such devices it's not possible to ...


17

Running the following command as root should enable USB tethering: service call connectivity 32 i32 1 on Ice Cream Sandwich (4.0) service call connectivity 33 i32 1 on Jelly Bean (4.1 to 4.3) service call connectivity 34 i32 1 on KitKat (4.4) service call connectivity 30 i32 1 on Lollipop (5.0) service call connectivity 31 i32 1 on Lollipop (5.1) according ...


14

From here: You might need to activate adb root from the developer settings menu. If you run adb root from the cmd line you can get: root access is disabled by system setting - enable in settings -> development options root access is disabled by system setting - enable in settings -> development options Once you activate the root option (ADB only or Apps ...


14

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 doesn't offer reboot). It appears that ShutdownActivity is called upon when you long press Power button. Anyhow, this is what you can try, remotely or locally, but ...


13

Have a look at simulating keyevents on Android and search for "KEYCODE_VOLUME_UP" and "KEYCODE_VOLUME_DOWN". Events can be generated by executing "input": #local shell: input keyevent 24 #vol up input keyevent 25 #vol down #remotely using ssh ssh your-phone input keyevent 24 #vol up ssh your-phone input keyevent 25 #vol down # 'su -c command' to make it ...


13

Simple, really: Android is safely shutting down vital parts of the runtime. The OS is also broadcasting intents to tell apps and services to gracefully close. These, in turn, flush their caches of all data and shared preferences, save what-nots to the sqlite database, et cetera. In other words, apps and services are given a chance to do their cleanup ...


12

Use this: am start -a android.intent.action.MAIN -n <package_name>/<full_class_name> To control an app, you'll have to put correct values of <package_name> and <full_class_name> in the command. For example, you can use com.google.gmail/com.google.gmail.check_mail (Hypothetical names) as last part of command. Obtaining package name ...


12

Use one of those: cat /proc/mounts mount # free disk space of mounted fs' df # this shows you available devices cat /proc/partitions ps: Lines containing asec are moved-to-sdcard apps (it's each an encrypted volume per app for security reasons)


12

Summing up from the comments: First you need to understand that updating apps works different on Android than it does on a "normal" Linux distro: There is no such thing as "apt". Though Android has its own package manager (listening to the pm command), installs/updates are usually dealt with by services/apps like google-play-store or other alternative-...


12

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 be installed. This requires adb to be installed and debugging mode enabled. The file has to be located on the PC. In adb shell or a terminal on the device: ...


11

killall zygote This will kill the root zygote process and cause a Android system refresh. This does not restart your phone's hardware, only the Android processes. By default (in Linux), the kill/killall commands do give the processes a graceful way to shut down, though it depends on the zygote implementation whether this in turn gracefully shuts down your ...


11

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 AVD. The avdmanager tool is provided in the Android SDK Tools package (25.3.0 and higher) and is located in android_sdk/tools/bin/ To read more about cmdline ...


10

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 depends of your phone storage. So you can try to know in which folder you have to search. ls /dev/block/platform/ Last way to know it, if you have the parted ...


10

Most shell commands in Android are not GNU versions or a POSIX-compliant implementation, they are either from Toolbox or Busybox and mostly stripped down versions. A lot of commands in /system/bin are symlinks to /system/toolbox. I haven't found much documentation about it, just the source at https://android.googlesource.com/platform/system/core/+/jb-mr1-...


10

Alas, the UsbStorageActivity doesn't use an intent to enable and disable USB mass storage, so there's no way to achieve this using am. It instead calls the functions StorageManager.enableUsbMassStorage and `StorageManager.disableUsbMassStorage to do its work. As these functions are hidden in the framework, it's not possible to write an app to do this, either....


10

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 need to echo "mtp,adb" > /data/property/persist.sys.usb.config If you want to do this without touching your phone Then I'm feeling interesting because in ...


9

Like Sachin Shekhar said, you must use the following command : am start -a android.intent.action.MAIN -n <package_name>/<full_class_name> See a concrete example : getting the apk file from your Android device or any Market places running this command : aapt dump xmltree com.android.settings*.apk AndroidManifest.xml I would like to start "...


9

Actually you can just push the "home" button adb shell input keyevent KEYCODE_HOME


9

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 (Click image to enlarge) I've tested successfully on stock Android 5.x and 6.x. Since wm tool comes with Android 4.3.x and 4.4.x as well, the solution may ...


9

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 it (just google 'apk downloder' and find one suitable for you): adb install com.myapp.apk B. open playstore app from adb and point it to your package, this ...


9

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/local/tmp/copyme exit exit adb pull /data/local/tmp/copyme /destination/copyme This works for me every time.


9

Activity Manager among other things manage Screen pinning. You can invoke the am command to pin an app regardless of the Screen pinning being activated under Settings. However, know that the pinning wouldn't be fully automated this way i.e. you still would have to confirm on the screen whether to pin the app or not, although I provided a way to interact ...


8

I installed the Disk Info app and in the options, I enabled Expert mode and Unmounted partitions. It doesn't say "swap", but it shows clearly that it's the only other partition on the SD card and it's the right size, so /dev/block/mmcblk1p2 must be the one: Swapper 2 is configured to use /dev/block/mmcblk0p3 by default, so I'm glad I didn't go with the ...


8

fdisk -l works if you pass the whole disk device name explicitly (e.g., fdisk -l /dev/block/mmcblk1); what does not work is automatic discovery of block devices (apparently because Android places block device files under the /dev/block directory, but fdisk expects to see those files directly in /dev). Therefore one option is to collect the list of whole disk ...


8

You can enter getprop to get info about device. Or, you can do cat /system/build.prop If you've root access then you can enter su and then dumpsys | less to get the name of the services which can give more info about some specific things such as battery. See this answer to know more. On a non-rooted device, you can do adb shell dumpsys | less provided ...


7

Consider taking at look at the following link: http://developer.android.com/reference/android/view/KeyEvent.html input keyevent KEYCODE_HOME


7

There is a pretty bad method using adb shell input tap, Get the coordinates for enable tethering and substitute adb shell input tap <x> <y> Or navigate to enable radio using adb shell input keyevent. Just have a look at, adb shell input Again this confines to a particular device.


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