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


21

Vol Down + C is functionally equivalent to Ctrl + C.


15

From within Termux itself, you can change the current directory to the internal storage, by means of cd /storage/emulated/0 or cd /sdcard followed by enter. After that, create a new directory by using mkdir Directory and replace Directory with a name of your choice. You'll then have a new directory in your device's internal storage, whose data you'll ...


14

I assume that you used adb push for uploading your executable to the sd-card. Unfortunately the sd-card is always mounted with "noexec" which means that you can't execute anything from here. Therefore you have to copy the executable to the local filesystem, e.g. to /data/local. In case the device is not rooted or you don't have BusyBox installed there will ...


14

You can use Android Debug Bridge (ADB) shell to issue basic Linux commands on your phone, just like you would in a terminal emulator app. To install you'll need to do the following: On the phone go to Settings -> About phone, and tap on "Build number" seven times. This enabled Developer tools. Go back to the main Settings screen and you should now see ...


13

The default su from Termux is simple. When run it brings /system/bin/sh for you instead of Termux's shell (typically bash). To solve this issue, you can install the custom su wrapper for Termux by apt install tsu And then you can run tsu so that your bash and everything is now under root privilege. Further information: Use an editor (like vim) to see /...


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

For Android 6.0 To Enable use : For GPS : adb shell settings put secure location_providers_allowed +gps For Network : adb shell settings put secure location_providers_allowed +network To Disable : GPS : adb shell settings put secure location_providers_allowed -gps For Network : adb shell settings put secure location_providers_allowed -network


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

Termux does provide the openssh package, which contains both the ssh client and the sshd server. Install the package with: apt install openssh, then start the server with sshd - it will run on port 8022 by default, so connect to it with ssh -p 8022 DEVICE_IP, and you can find the device wifi ip using ip addr list wlan0. Password authentication is not ...


11

As I wrote in my comment, there are some special characters needing extra care when working at the shell prompt (or in shell scripts). One of them is the $ sign, which usually indicates a variable. If that should be taken literally, you need to escape it (or enclose the entire string by single quotes). Similar rules for quotation marks. How your command ...


10

The following terminal command should enable Bluetooth via adb shell or Terminal Emulator app: su am start -a android.bluetooth.adapter.action.REQUEST_ENABLE On most versions of Android, this command will present a pop-up window to the user asking to confirm request to enable BT. I believe this was done for security purposes whenever an app that is not ...


10

Is it possible to enable Location Services(GPS or Google NetworkLocation) via ADB or Terminal Emulator? The command is: adb shell settings put secure location_providers_allowed gps where, settings would makes changes into settings.db (part of com.android.providers.settings) put is to update key location_providers_allowed with value gps in table secure. ...


9

You should be able to call the messaging intent with am start -a android.intent.action.VIEW "sms:numberhere" -e "sms_body" "hello" Using the intent command as described here: http://learnandroid.blogspot.com/2008/01/run-android-application-from-command.html https://stackoverflow.com/questions/4967448/send-sms-in-android


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

Addressing Revision 4 You're still doing things incorrectly even though I noted in revision 1 of my answer that you would need adb in PC for once and once alone as long as no reboot or disabling of USB debugging occurs. Regarding your attempt: u0_a192@klimtwifi:/ $ adb connect localhost:9999 * daemon not running. starting it now on port 5038 * * ...


9

Following the Termux wiki to run termux-setup-storage fixed it for me, as suggested by fornwall.


8

The su binary works just like it does on Linux; it runs all commands that follow as root until you type exit (or terminate the process, etc.). sudo <command> essentially does: su <command> exit Android doesn't normally include sudo, so If you wish to launch commands like you would with sudo, the syntax is as follows: su -c "[command_1;...


8

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


8

First, you have to push it into a directory, such as /data/local/tmp. Then, you have to set permission for that using chmod 755 executable. After that, you can run it as ./executable. Complete steps are as follows: adb push executable /data/local/tmp adb shell cd /data/local/tmp chmod 755 executable ./executable Alternatively, if you want to run it from ...


8

See the Termux help page for how to input arrow keys using the VolumeUp button, VolumeDown for Ctrl and some additional shortcuts! Volume Up+W → Up arrow key


7

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


7

From the terminal, you can use svc to control several elements of your device. For mobile data, it would be: To disable: svc data disable To enable: svc data enable You can simply type svc help for a list of available commands, or svc help [command] for a list of subcommands. For example: To get the list of subcommands for controlling mobile data: svc ...


6

As eldarerathis already mentioned: On many (if not most) devices supporting an SD card, this card is mounted with the noexec option -- which means as the name suggests: "no exec from here", i.e. you cannot execute anything from the sdcard. Again, one solution was already mentioned by eldarerathis: Try a different storage. You've got the power, your device ...


6

You don't need root. You also don't need a terminal, for an app to use its own private utilities. But if you want vim, Terminal IDE provides that, a number of other utilities (git, ssh, tmux), the ability to use bash or Java as a 'scripting language' at the terminal, and the ability to create and install Android apps on-device. I use Terminal IDE and vim ...


6

in android.bluetooth.IBluetoothManager, there some parameters TRANSACTION_registerAdapter = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); TRANSACTION_unregisterAdapter = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); TRANSACTION_registerStateChangeCallback = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2); ...


5

There are native programs available on Android for creating file systems, and in most cases they reside in a directory below /system (my Motorola Droid 2 e.g. has them in /system/xbin. Depending on the file system you want to create, you can chose between: mkfs.ext2 mkfs.minix (unlikely you want that -- and it might even be not available with your ROM) mkfs....


5

Escape the $ in the sub-class name and it should work: shell@android:/ # am start -S com.android.settings/.Settings\$PowerUsageSummaryActivity Starting: Intent { cmp=com.android.settings/.Settings$PowerUsageSummaryActivity } shell@android:/ # Another option is to instead send the intent that the Power Usage screen listens for: shell@android:/ # am start -...


5

Try reboot recovery, though it doesn't work on all devices. You might also need root for this, so first try su.


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