Tag Info

Hot answers tagged

18

Where an app is stored very much depends on several criteria: System apps / pre-installed-bloatware-apps are stored in /system/app (which is mounted read-only to prevent any changes) normal apps in internal memory go to /data/app some apps (encrypted on internal storage?) go to /data/app-private Apps stored on external memory go to an encrypted container ...


10

If you have a wireless network set up I can recommend to connect via SSH. It allows you to access and fully manage your Android in a few minutes. For Linux or Putty users there is no difference to a standard terminal using SSH besides some specific Android commands. Moreover, some file managers such as Nautilus support the SSH protocol so you will have the ...


10

Recently I had similar requirement, and I found 'busybox' utility. The terminal emulator apps are useful however those support very few commands. However 'busybox' gave me access to most of the generally used Linux commands. Here is how I used it.


10

While looking around my Android filesystem, I found that it did, in fact have a /etc/init.d/ directory. After peeking around in there, I found /etc/init.d/20userinit with the following lines: if [ -e /data/local/userinit.sh ]; then log -p -i -t userinit "Executing /data/local/userinit.sh"; busybux chmod +x /data/local/userinit.sh; logwrapper ...


9

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

I found sort of a workaround for this (at least for a rooted phone). If a phone is rooted, busybox is most probably installed. stty is part of busybox. stty intr ^x Redefines Ctrl+X to act as a break command, e.g. what was previously Ctrl+C.


6

It appears to be defined in /init.rc, at least on my device: export PATH /sbin:/system/sbin:/system/bin:/system/xbin I don't think you can edit this file directly though, even with root access, because it is part of the read-only boot image, not the /system partition. If you want to edit it then I guess you would have to unpack, edit and re-pack the boot ...


6

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


6

/data/init.sh runs at boot, if you have root you can edit it as you like. Be careful ;) Edit: Apparently you might need to shoehorn the edited script into the boot image as well. Info on how to do that here: http://forum.xda-developers.com/showthread.php?t=443994


6

If I'm interpreting "on the computer" correctly to mean "I want to use the command line on my computer to read an .apk file's permissions" then you can do that with aapt on a local file like so: C:\>aapt d permissions "MyApp.apk" package: com.app.myapp uses-permission: android.permission.ACCESS_NETWORK_STATE uses-permission: android.permission.INTERNET ...


6

Another way is to simply go to Settings→About phone, where you should see (depending on your CyanogenMod version) an item "CyanogenMod updates", and (with all CM versions) "CyanogenMod-Version":


5

On a typical Linux system the cache is cleared by running /etc/init.d/nscd restart, but at least my ROM doesn't use nscd to cache DNS. You can check if yours does, but I doubt it. I've seen suggestions that clearing the brower cache would clear DNS cache too, but one sure way is to do a hard reboot (shutdown, remove battery for 30s, reattach battery and ...


5

In Android, the DNS Cache is not on the OS level (Linux), but on the Java level (managed by java.net.InetAddress). Therefore, it is not possible to list the cache contents from the shell, however you can access it from the Java code. Please see Java DNS cache viewer question on StackOverflow, one of the answers has a sample Java code that prints the ...


5

Addresses are cached for 600 seconds (10 minutes) by default. Failed lookups are cached for 10 seconds. From everything I've seen, there's nothing built in to flush the cache. This is apparently a reported bug in Android because of the way it stores DNS cache. Clearing the browser cache doesn't touch the DNS, the "hard reset" clears it because it simply ...


5

This is due to 2 things: The file does not have execute permissions [AND] The file cannot gain executable permissions as it is on the SD Card. The SD Card's filesystem can accept file permissions, however it is mounted with the noexec flag, as stated in a comment. This stops files being executed. Solution: Copy the net-snmp-5.7.2 directory to the ...


5

As explained by the comments and Liam's answer, this is due to the noexec flag used by the system when mounting the sdcard. If your configure file is a shell script (as it usually is), you can still trick it to be executed: cd to the directory as you described above, and then execute sh configure. sh is the Shell interpreter, and that binary should be ...


5

From http://stackoverflow.com/users/119895/macarse: 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 ...


4

The only way to do this in Android is to do a hard reboot. The necessary command-line tools are not normally available, however in my tests a hard reboot has always done the trick for me (Galaxy Nexus, and HTC Desire, various ROMs). This is a pain, but it is quicker than the 10min cache timeout.


4

If you use mv on a directory containing files and subdirectories, it will move all of them. But in this case you may not want to move the amazonmp3 directory itself, so the command would be mv internalmemory/amazonmp3/* /sdcard/music/, assuming the internalmemory directory is correct. The actual names for the internal memory and sd-card depend on the ...


4

Simple, really: Android is safely shutting down vital parts of the run-time, broadcasting intents to notify apps/services to gracefully shut down, which in turn flush their caches for data and shared-preferences, save what-nots to the sqlite database, etc. In other words, apps and services are given a chance to do their clean up systematically. The ...


4

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


4

There are two ways. The simpler one is to use a legacy market://details?id=com.shadowburst.showr URL instead of https://play.google.com/store/apps/details?id=com.shadowburst.showr. No browser will offer to open a market:// URL, but it's still possible that another installed app will do so. The more complex way is to explicitly specify what activity you ...


3

There is some documentation on the AOSP site: getevent Plus several Howtos like e.g. Android, writing events low level touch screen automated shell Turning the output from getevent into something something that can be used How to emulate key presses adb shell sendevent, sending touch like events Android, low level shell click on screen However, the ...


3

You cannot execute either binary or shell script that resides on the external sdcard due to the execute permission bit being blocked. Either move the script temporarily to a location other than sdcard (if you're not rooted - you're in a bit of a spot there...) After reading the posting on xda, it would appear that something is amiss, notify the developer ...


3

i was able to stop the top process and still stay in shell by typing the following in this order: C CTRL+Z CTRL+M if I did not type all 3 of those combos it would not stop and I would have to CTRL+C to exit the shell. I found this by just trying different combinations of keys and found it by accident. YMMV


3

On my Android 4.0.4 (ICS) Xperia ray, they are stored in /mnt/asec/XXX-1/pkg.apk. XXX is the Google Play ID of the application. For example, Firefox is found at /mnt/asec/org.mozilla.firefox-1/pkg.apk and Skype is found at /mnt/asec/com.skype.raider-1/pkg.apk. Following zuul's comment I took these screenshots from my phone to confirm my answer. ...


3

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


3

I tried to do uname -a on my CM10.1 (Samsung Galaxy S2) on the built-in Terminal app. It returns: Linux localhost 3.0.31-CM-g17c7b6e #1 SMP PREEMPT Tue Feb 19 01:11:17 PST 2013 armv71 GNU/Linux Kernel version: 3.0.31-CM-g17c7b6e SMP: Symmetric Multi-Processor support PREEMPT: kernel preemption is enabled Kernel date: Tue Feb 19 01:11:17 PST 2013 ...


3

It sounds like you want the extremely common ls -l For reference, the complete busybox help for ls: BusyBox v1.21.0-Stericson (2013-01-28 21:49:55 GMT) multi-call binary. Usage: ls [-1AaCxdLHRFplinsehrSXvctu] [-w WIDTH] [FILE]... List directory contents -1 One column output -a Include entries which start with . -A ...


2

Since I stumbled over the same problem as you did I started to compile a list of useful commands in the Android Shell including examples. A German version is on my blog.



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