Android :: How To Traceroute In Adb Shell
Oct 19, 2010I have a rooted device, I type "su" in adb shell, then I try to traceroute. It says "traceroute: not found". I can't find traceroute in any bin folders.
View 1 RepliesI have a rooted device, I type "su" in adb shell, then I try to traceroute. It says "traceroute: not found". I can't find traceroute in any bin folders.
View 1 RepliesI want to use command like "ls","mkdir","cd","./"..etc, in the app, somebody says use Runtime class,
Runtime.getRuntime().exec("ls");
but there is nothing happen.. I also use logcat to observe, but have the same result.
so could app use (linux) command?
The only thing I found is to cross compile bash. Is there another way to have tab completion in the Android shell?
View 2 Replies View RelatedI would like to be able to send an actual SMS message from a shell using just the command line and not relying on any apk to do so. I am interested in sending this message between phones, not from the emulator to the phone. For example, by running the command: service call phone 2 s16 "1234567890"
I can place a call from phone to phone using the command line. The 'service list' command shows an isms service, which I can't seem to provide the correct arguments for. I would assume that one of the args should be a PDU string but haven't had any luck so far.
I find that when I am running 2 android devices connected to 1 linux machine, I find I can get ADB shell to exit abnormally. If I start a shell on Device 1, then on Device 2 start a shell and type reboot. Device 2 resets like expected, but the shell on device 1 will exit. I find that functionality of running controlling multiple devices with ADB very useful for testing. My question is can anyone reproduce this? Has this been fixed upstream? Is ADB planning on first class support for multiple devices, or was this an after thought feature? Any help debugging this, or possible just a little information in the right direction so I can make a patch myself.
View 5 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 am trying to run an ADB shell command from inside an android app using the JAVA's Runtime.getRunTime.exec API. I am getting an error "ERROR/ProcessManager(1041): Error running adb: Permission denied". Wanted to check if there is any permission that I need to request to get it working or that running the adb shell command would not be allowed from with in the Android app.
I am able to execute other linux commands like 'ls' from the android app though.
I am trying to execute a command from within my code, the command is "echo 125 > /sys/devices/platform/flashlight.0/leds/flashlight/brightness" and I can run it without problems from adb shell
I am using Runtime class to execute it : Runtime.getRuntime().exec("echo 125 > /sys/devices/platform/flashlight.0/leds/flashlight/brightness");
However I get a permissions error since I am not supposed to access the sys directory. I have also tried to place the command in a String[] just in case spaces caused a problem but it didn't make much differense.
I have copied a file named hello(compiled form hello.c) in android data folder and using command like "adb shell datahello" in android machine terminal. and it give fine output.
Actual Question is that is there is any way that in button click listener, i initiate the same command like "adb shell datahello" (or any other appropriate way to execute adb shell commands) and gets its output in TextView.
Can an Update.zip be installed through ADB Shell?
View 3 Replies View RelatedNow that we can Examining sqlite3 Databases from a Remote Shell, is it possible to examine SharedPreferences from adb shell? Since it would be much more convenient to examine and manipulate SharedPreferences from command line when debugging. Or put in another way, in what files SharedPreferences are saved, and how to view and modify these files?
View 1 Replies View Relatedi would like to add some commands to be executed every time I run "adb shell" (for example "alias ls="ls -l""). is there a .bashrc or a .sh that i could add that to?
View 3 Replies View RelatedI took some photos with my G1. How can I pull all the photos from a G1 via 'adb shell'?
View 6 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
I have an Amazon Kindle and the SGS2 which I take out and about with me.
I want to be able to transfer documents to and from the phone and Kindle (already got SSH access to the Kindle over WiFi) while out and about.
My phone is rooted and I've installed dropbear SSH. I can use connectbot to SSH into the phone locally but the shell I'm presented with doesn't see `scp`. I believe this is supposed to be included with dropbear? How do I get scp from this shell?
The reason I'm looking to do it all from a root shell on the phone is becuase I believe this is the only way to get access to the clients connected to the virtual access point. Hence I'll be able to:
be in the middle of the desert, create a WiFi tethering hotspot with the phone (though it has no signal), connect the Kindle to the phone via this access point, get a root shell on the phone and scp documents from the phone to the Kindle.
I believe I am as far as this final step but need an extra kick to get me there. Perhaps I need to install another shell?
My program creates a sqlite3 database. With the emulator I have been able to use adb shell and get to the file in /data/data/<package>/ databases/<database> to inspect data. But with a real phone, I just cant seem to find that file. I get some permission even doing an ls on the data directory. Any idea what I need to set up to navigate the filesystem?
$ Mac-202: adb shell $ cd data $ ls opendir failed, Permission denied $
I keep getting
ADB rejected shell command (ls -l /data):
And the command prompt when running adb shell tells me error: device not found although the emulator is open.
I 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 RelatedIs there any way to run terminal commands on my application and then access the data on my UI? Specifically top.
View 4 Replies View RelatedThis used to work:
adb shell am start -a android.intent.action.CALL tel:1234
However, now I get this error:
CODE:.................
CODE:....
Is there a way to get around this?
I wrote a simple hello c program. I pushed the program to either Android Emulator or a device. When I run it, however, I got "./hello: not found" message. I ls-ed it and it's right there. Is this purposely disabled?
View 4 Replies View Relatedis it possible to send sms via adb shell from pc to android phone (via usb) ??
View 4 Replies View RelatedI have a netbook with Android installed. Is it possible to access the bash shell?
View 5 Replies View RelatedI am trying to use "adb -d shell" command to start a shell on device (android dev 1 phone ) from my vista command line. But whenever I try giving such command it does not open any shell or interaction on the phone device. But instead it goes to the next line in the cmd as '$'. any help would really appreciable. I have installed adb_usb_windows.
Previously I used work well with the emulator. Using adb command never troubled me. But now with new device, I am not able to open a shell using adb -d shell command on the phone.
I am trying to dump the content of sqlite via adb shell command.
Here is what i did:
CODE:...........
My questions I try both 'tables' command and dump the schema for 'main', I can't find my table. Can you please tell me what am I doing wrong?
In my java code, I am able to insert value to DB like this:
CODE:.................
In my application I want to create a directory xyz in sdcard at the runtime from the my Application. But it doesn't work.
Here is my code...............
I 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 try to execute shell commands, this does work as it should. Even the result comes back (as is see on LogCat). The problem ist the last line of the result. Every time a readLine() on the last line occurs (which shouldn't occur, temp should be null), the app hangs forever and doesn't come back from the readLine call. Maybe you find the error. I tried readUTF and standart read(), all the same problem. And yes, the app got su-rights.
try {
Process process = Runtime.getRuntime().exec("su");
DataOutputStream os = new DataOutputStream(process.getOutputStream());
DataInputStream osRes = new DataInputStream(process.getInputStream());
for (String single : commands) { os.writeBytes(single + " ");
os.flush(); String temp = new String();
while( (temp = osRes.readLine()) != null) { Log.v("NITRO", temp);
result2 += temp + " ";
} } os.writeBytes("exit");
os.flush(); process.waitFor();
} catch (IOException e) { Toast.makeText(Main.this, "Error", Toast.LENGTH_LONG);
} catch (InterruptedException e){ Toast.makeText(Main.this, "Error", Toast.LENGTH_LONG);
}
That is the StackTrace where it hangs when I stop debugger when hanging:
OSFileSystem.readImpl(int, byte[], int, int) line: not available [native method]
OSFileSystem.read(int, byte[], int, int) line: 118
ProcessManager$ProcessInputStream(FileInputStream).read(byte[], int, int) line: 312
ProcessManager$ProcessInputStream(FileInputStream).read() line: 250
DataInputStream.readLine() line: 309
Main$2$1.run() line: 84
ViewRoot(Handler).handleCallback(Message) line: 587
ViewRoot(Handler).dispatchMessage(Message) line: 92
Looper.loop() line: 123
ActivityThread.main(String[]) line: 4627
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 521
ZygoteInit$MethodAndArgsCaller.run() line: 868
ZygoteInit.main(String[]) line: 626
NativeStart.main(String[]) line: not available [native method]