Android :: Run Shell Commands On Droid Programmatically?
Jul 28, 2010Is there any way to run terminal commands on my application and then access the data on my UI? Specifically top.
View 4 RepliesIs there any way to run terminal commands on my application and then access the data on my UI? Specifically top.
View 4 RepliesIs there a complete list, or there is no guarantee the list won't change with every release?
View 4 Replies View RelatedCan't find information on how to print out documentation on android shell commands while in the shell. Something along the lines of.
View 4 Replies View RelatedI need to execute following command in my app.
command: echo "1" > /sys/manager0/enable
I tried this with following code in my app.
Process p = Runtime.getRuntime().exec("su");
DataOutputStream stdin = new DataOutputStream(p.getOutputStream());
String cmd = "echo "1" /sys/manager0/enable";
stdin.writeBytes(cmd+"
");
There is no error and app executed perfectly but there is no change in the /sys/manager0/enable
How do I use adb to perform some automated tasks on my android phone? I need to find commands that I can issue from the command line (ideally, using a .bat file) that will be capable of more than simply opening an application or sending an input keyevent (button press).
For instance, I want to toggle Airplane Mode on or off from the command line. Currently, the best I can do is launch the Wireless & network settings menu and then use input keyevents to click Airplane mode:
CODE:.................
There are quite a few drawbacks to this method, primarily that the screen has to be on and unlocked. Also, the tasks I want to do are much broader than this simple example. Other things I'd like to do if possible:
1.Play an mp3 and set it on repeat. Current solution:
CODE:..................
2.Play a video. (current solution: open MediaGallery, send keyevents, similar to above)
3.Change the volume (current solution: send volume-up button keyevents)
4.Change the display timeout (current solution: open sound & display settings, send keyevents)
As before, these all require the screen to be on and unlocked. The other major drawback to using keyevents is if the UI of the application is changed, the keyevents will no longer perform the correct function. If there is no easier way to do these sort of things, is there at least a way to turn the screen on (using adb) when it is off? Or to have keyevents still work when the screen is off?
I'm not very familiar with java. That said, I've seen code like the following (source: http://yenliangl.blogspot.com/2009/12/toggle-airplane-mode.html) to change a setting on the phone:
Settings.System.putInt(Settings.System.AIRPLANE_MODE_ON, 1 /* 1 or 0 */);
How do I translate something like the above into an adb shell command? Is this possible, or the wrong way to think about it?
I have a samsung moment that I seem to have inadverntantly disabled diagnostic usb access - if I have USB plugged in and then enable dial up networking in settings , USB disconnects - as soon as I disable DUN usb comes back up - I modified the setting in NV for scm from 3a to 2a and caused this, but I can't find a way to access non volatile memory any other way than through usb diagnostic mode
View 1 Replies View RelatedI am trying to create a tasker automated thing, which would show a scene which will have a button to execute a shell command (The command should be executed as root). how to do it?
Code:
reboot recovery
Once I start up monkey from the shell like:
adb shell monkey --port 1080
Then, If I write normal java code to establish a connection to 127.0.0.1:1080 (on the device itself) and then issue monkey commands from there?
I have tried this and I am able to create a socket, but to get the response, I wait for an awfully long time and nothing happens. Why this behavior?
i have made a kinda theme installer (for stockrom)..
so.. first of all i extract needed file from assets to sdcard
n on button click i add this line of code..
the code is work n sometimes not...
when execute the code, my phone hang for several time
"here is the line of execution code :
Code:
Process ppush;
try {
ppush = Runtime.getRuntime().exec("su");
DataOutputStream os = new DataOutputStream(ppush.getOutputStream());
os.writeBytes("mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system
");
os.writeBytes("cp /mnt/sdcard/dys/SystemUI.apk /system/app
");
[code].....
I want to send AT commands in my Android application, but I could not find the right syntax. How can I do this?
View 1 Replies View RelatedI am trying to write an android app for root users that runs a series of shell commands, or a shell script if that is preferable, and displays the output... can anyone point me in the right direction?
View 1 Replies View RelatedI use a headset with a microphone for Pandora. It has a media button on it that when pushed, will pause or play the Pandora app or accept a phone call in which case Pandora is paused. However, pushing the button with the X brings up the voice command window. Is there anyway to disable or remove this app altogether? If it can be removed, I want to be sure that this app is not associated with the talk to text feature, which I use and like. is there any way to disable or remove this application from the X?
View 2 Replies View Relatedi uninstalled voice commands with titanium back up and now my phone says it can't update to 2.2 because voice commands is missing. how can i get this back
View 4 Replies View RelatedI am configuring wifi on my android based board using shell script. Now I want to execute the same script from android application. For that, I had used following code, but it didn't give any success till now,
I had executed same script from "adb shell" prompt and it works nicely.
Process exeCommands = Runtime.getRuntime().exec("/data/busybox/ board_script.sh");
is there anything else required than this?
I've got a question about android and GPS coordinates.
I've got a script done in python, which opens a socket and sends a bunch of coordinates to an emulator. On the emulator I have an application running where I've registered an OnLocationListener.
The idea is to capture the coordinates and animate the map towards those positions.
The problem is that android gets the first position, animates the map towards it and then ignores the rest. This has become a pain in the neck and is killing me and my developer team.
I was watching TV, and playing with my phone, and saw a commercial that mentioned how you can launch certain apps and do certain actions via voice commands. I had forgotten about that frankly, and have only used it to navigate before. So I tried to launch a song. No go.
So, after a very brief google search, I found this:
Just speak it: introducing Voice Actions for Android - Official Google Mobile Blog
I updated the voice search app (even though it didn't show up in market without the direct link), and tried again to launch a song. Again, no go.
Apparently it only works with online radio apps like Pandora. It doesn't work with the Music player that comes with the damn phone! I mean seriously, how stupid is it that you can't tell it to play a song from your SD card but you can call up a radio channel (and not actually get to hear that song)?
Anyone know any other ones besides "Navigate To" and "Call"?
View 11 Replies View RelatedIs there a way to remove the voice commands or shut it off?
View 2 Replies View RelatedI am trying to execute a shell script from application using
java.lang.Process API.
The script file is executing properly as i am able to get logs but the line
*$SETPROP net.if.default rmnet0* * * is not getting executed.
has anyone able to execute .sh file from application succesfully.
Code Snippet: *//* *str={"/system/bin/sh","/sdcard/test.sh"};* *Process p = Runtime.getRuntime().exec(str);* * * *//* * * test.sh: LOG=/system/bin/log SETPROP=/system/bin/setprop $LOG -t test"++Setting up default iface"
$SETPROP net.if.default rmnet0 $LOG -t test"++Setting done "
I found some hidden programs for Moto Droid. Open Voice Dialer (Not Voice Search) and say
1. Open APN
opens APN settings
2. Open SIM Card Lock
opens sim card lock settings.
3. Open Battery Info
opens detail battery information
(Note I'm referring to the google Voice Search utility, not the Voice Dialer utlity)
So far: I've confirmed that 3 special voice commands work on my Droid X:
CODE:............
However, there are supposed to be more (from my research), but none of the following is working:
"Call <contact> mobile/work/home/etc" to call that contact
"Dial <number> " to dial the number
Has anyone discovered any other working voice commands?
This has been an issue since the first day after I installed all my apps via appbrain (roughly 300). It takes ~36 seconds for it to open. I am starting to think I am the only one experiencing this. Does anyone have any ideas?
View 2 Replies View RelatedI've downloaded adb for a mac and cannot get adb to launch from the mac shell. I've followed the instructions on developer.android, adding the path to the .bash_profile, but still no luck.
View 4 Replies View RelatedI've been playing around with the new voice commands in Froyo (Sending Txts, Calls, etc.), and I've noticed that while the feature is cool in theory, it seems to fail in practice. To be more specific, the Voice software can't seem to recognize any name that isn't John Smith, David Samuels, etc.
As an example, I have repeated tried to use it to text a friend of mine who's name is Ryanna (pronounced like the singer). I have tried using "Ree-ahna", "Ree-anna", "Rye-anna", "Rye-ahna", and other methods of pronouncing it, but all of them fail. The software doesn't even bother to take a guess!
Is there any way to "train" the software to better recognize names?
I have 2.2 installed and rooted. I want to overclock. I have searched the Internet on how but the guides don't make sense to me. I don't know what .img I should use and I don't understand the adb shell.
View 10 Replies View RelatedI have the Sedio case and I love it - but I need something I can throw the whole phone into for when I go mountain biking. I want to carry my droid to have a phone in case of emergency but I need to know that if I fall on my pack (and therefore the phone) I'm not going to shatter the screen.
View 3 Replies View Relatedway the shell/holster combo fits? Top right hand corner of the shell won't snap on
View 49 Replies View RelatedTried to search but couldn't find anything on this. I'm trying to use 'adb shell' to begin blocking OTA updates, and encountered this error message.
View 3 Replies View RelatedFor those who have this case please vote! After you have put on your case for awhile and taken off the top part of the case, has it loosened the left side of the screen? I feel like this case might be responsible for slightly spreading out the space between the screen and keyboard on the left hand side! This has caused a clicking issue whenever pressing anywhere on the left hand side of the case!
View 10 Replies View RelatedLooking for anyone who has the shell/holster combo on their Motorola Droid. I would love to hear your reviews and would especially appreciate photos of it from all angles, both in the holster and apart from it.
View 5 Replies View Related