Android : How To Add Adb Shell Startup Script?
Sep 4, 2009i 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?

i 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?
I know there are apps like Autostarts that do this, but I'm looking for a way to do it via the shell. Is there a directory or file within Android that stores startup stuff? For example in Windows, I'd look in All Programs/Startup or something.
View 7 Replies View RelatedEvery time I start my phone it seems that every program in the app catalog starts up. Until I activate the Advanced Task Killer and shut them all down, the thing runs like a hog. I have quite a few programs installed, but I dont use them all all of the time. Why do they all start up and is there any way beside the ATK to stop them? Is there any way to modify the startup files?
View 4 Replies View RelatedI 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 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 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.
Is there any way to get an app to run at startup? There is a volume control app (ladybug icon) that I use to keep my ringer volume always at vibrate. When I accidentally hit the volume rocker, the app returns the ringer to vibrate. However, I must remember to run the app when I restart the Droid. So, is there anyway to have it run when the Droid powers on? Or is that something that would have to involve rooting?
View 9 Replies View RelatedI 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 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 RelatedOther than downloading a 3rd party application that auto-starts apps on boot, is there a way within the OS itself to autostart programs when the phone reboots? I have a few apps I use for work and would be nice if they autostarted on my Droid without having to launch each one independently.
View 2 Replies View RelatedHow do I go about getting my app to play an mp3 (in my res) on startup? Or how how about if I wanted this to happen when a button is clicked?
View 1 Replies View RelatedI've been modifying/editing parts of the Android platform, but have run into a problem when trying to test my edits. After making my changes to the platform source, I was able to successfully compile the source - thus creating system.img, ramdisk.img, and userdata.img. When I go to test this in the emulator, the emulator just hangs on the "ANDROID_" screen, with the underscore blinking, but never seems to load. Any suggestions? The command I used to run the emulator is as follows:
./emulator -system $HOME/android/platform/out/target/product/generic/system.img -ramdisk $HOME/android/platform/out/target/product/generic/ramdisk.img -data $HOME/android/platform/out/target/product/generic/userdata.img
I have Listpreferences in my app. They don't appear to be setting to their defaults right after installation - they appear to be null. I'm trying to figure out why my default preferences are not being set right after installation.
In my main code I have:
CODE:......
Right after the above code executes, each variable contains "defValue" instead of the actual values I have assigned in my ListPreference below.
My preference xml file is called, "settings.xml". Here's what one of the ListPreferences there looks like:
CODE:.............
Here's what some of my strings.xml file looks like:
CODE:.................
When I go to menu, and then settings, I can see my defaults checked (radiobuttoned). Then when I go back from the settings menu to my main screen - all is well - for life! ...then each var above is assigned the proper default value.
This only happens when I first install my app on the phone. After I go to the settings screen once and then right out of it, the app is fine and accepts any setting changes.
By the way, as you can see, "List1" is the android:key within a file called settings.xml in my res/xml folder.