25

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 ...


23

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 ...


18

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 ...


16

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 ...


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

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


14

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 ...


14

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 ...


14

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: ...


13

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-...


13

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 Coommand-line Tools" package and is located in android-sdk\cmdline-tools\latest\bin\...


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

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 ...


11

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 ...


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

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

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 ...


9

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 ...


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 ...


7

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


7

As existing answers already show, there seems to be no "unique way" to achieve that. So I started combining ideas from allover, joining them into a script (or rather a "script library") to have them checked sequentially (until a good hit was made), and integrated that into my "Device Documentation Tool" named Adebar. Those interested can find it in the lib/...


7

Use of android tool is deprecated; instead use sdkmanager: androidsdk/tools/bin/sdkmanager --update https://developer.android.com/studio/command-line/sdkmanager.html


7

There is no Fastboot Command that does this. However you could try holding the power button down until the screen goes blank and then letting go off the power button before the device starts to boot (before the vibrate). This is the only viable way... The list of available Fastboot commands are: usage: fastboot [ <option> ] <command>   ...


6

If display service isn't available in dumpsys, you may look for line ro.sf.lcd_density= into /system/build.prop. To get it from phone: adb pull /system/build.prop


6

The real problem with service call is that transaction codes are not only undocumented, but also not guaranteed to be stable — they can be silently changed between Android versions. Because of this, service call commands should never be used except for private debugging, when you know what Android version is used. Example: ITelephony transaction codes for ...


6

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


6

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 dump the status of the disk. Looking into the java code of DiskStatsService.java for various Android releases, I noticed that the information you are looking ...


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