Hot answers tagged

16

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


15

Android System Info is a free app from the market which will tell you more details about your phone than you ever wanted to know. It has all the details you want about your CPU and Memory and much much more. Install it, start the app and check the System tab for all the information you are looking for.


13

These free apps in the Market claim to be able to display your logcat, and don't make any mention of root. Should only take you a few minutes to try them out: CatLog aLogcat LogViewer EDIT: Thanks to @mente for reminding me that these apps will only let you view the full logfile in older versions of Android. Android 4.1 brought in a new security model ...


11

Type su and your terminal prompt should change from $ to #. This is assuming that your device is already rooted.


10

Using adb, I believe it is possible: am [start|instrument] am start [-a <action>] [-d ] [-t <mime_type>] [-c <category> [-c <category>] ...] [-e <extra_key> <extra_value> [-e <extra_key> <extra_value> ...] [-n <component>] [-D] [<uri>] am instrument [-e <arg_name> ...


9

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


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


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


8

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


8

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


7

You may have a look at http://www.busybox.net/downloads/BusyBox.html for a description of busybox and the commands provided by it. And trust me, if you are going to do work in the console, you probably want to use busybox.


7

Run "Menu → DevTools → Terminal Emulator". Enter the folowing commands: cat /proc/cpuinfo cat /proc/meminfo free cat /proc/version


7

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 http://stackoverflow.com/questions/4967448/send-sms-in-android


7

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


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


5

Settings -> About Phone should tell you most of what you want to know. Failing that, it will at least tell you a model name which you can then search google for more info. My 'About Phone' lists Model, CPU info (i.e. what CPU) and Memory info among other things. But I am running CM7 with Gingerbread.


5

This seems like your terminal doesn't have root access. Is your phone rooted? and did you type su to get to the root user first? On my phone you can tell if you're using root privileges by checking the prompt, $ = no root, # = root.


5

Your best bet would be to use ADB and pull it off the emulator, or pull it from another rom. You will then have to put it on your device, but you will have to have root to put it in the directory with the other binaries. sqlite3 does not come on most of the devices, I think it only comes on the dev phones, like ADP1/ADP2, Nexus One/Nexus S. I know it is not ...


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

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


4

You don't need to root your phone to run adb logcat with the Android SDK, but I did just test it in my Terminal Emulator and I did have to be root (used the su command -- my phone is already rooted) to run logcat in the terminal on my phone. So yes: if you have root on your phone you can run logcat from a terminal on your phone.


4

Most of the terminal commands in android are the limited version of standard Linux/Unix/POSIX terminal commands, provided by the toolbox program. Notably absent from toolbox is the cp (file copy) command, you must use cat file1 > file2 instead. If you spend a lot of time in the shell, you may want to install busybox, which provides a richer set of ...


4

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


4

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


4

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


4

Native binaries (as the mkfs.* tools are) need to be compiled for the platform they should run on. So if you take the mkfs.ext3 from your Ubuntu workstation, which probably is either x86 or x86-64, it will not work on your Android device, which most likely uses ARM architecure.


4

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


4

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


3

This is a known design problem when using statically linked libresolv and glibc. You have 2 options: Use Google Android's native libc Bionic library instead of glibc. Build busybox to search libraries in /system/lib (or make the necessary links e.g. /usr/lib -> /system/lib ). Place ld-linux.so.3, libc.so.6, libresolv.so.2, libnss_dns.so.2 in your ...



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