General :: How To Send Email From Command Line Shell

Nov 14, 2012

I am looking for a way to send an email, preferably with an attachment, from a command line shell script (bourn/ash/whatever-it-is). No user interaction is a requirement.

It looks like an "am start" command might be able to do it via launching another app, and I've seen some examples out there, but nothing that I've had success with.

I have a big rsync backup script that I run to back up my device to my server, but I want to be able to email myself a notification if the backup fails, along with a copy of a log file. This script runs on a regular basis via a scheduler without any user interaction, but I have noticed that rsync has been failing recently and I've needed to re-run it manually later.

I am a pro Linux sysadmin but don't know jack about Java. I do bash, python, perl, and some C. My current script is just a sh shell script.

FYI my device is a Nexus One on Cyanogen 7.2. FYI I own the mail server here. I use k9mail as my primary mail app but the gmail app could be used as well.

If there was just a "mail" command.

General :: How to send email from command line shell


Android :: Command Line - Access Bash Shell?

Apr 17, 2010

I have a netbook with Android installed. Is it possible to access the bash shell?

View 5 Replies View Related

Samsung Galaxy S :: Set Host Name / Start Command Line Shell?

Oct 31, 2010

Have just got a Galaxy S and this is my first experience with Android.
a. How do I set the host name for my phone?
b. How do I start a command line shell?

View 1 Replies View Related

Android :: Send Intent From Command Line?

Jun 4, 2009

I am trying to test how my activity responds to an intent. I can write a test activity and send my intent. I am wondering if there is a command line tool to just send an intent. I looked at "am" tool. When I use "am -D INTENT", I get "your application is waiting for debugger connection" popup. Is there any way to skip this popup?

View 3 Replies View Related

General :: Installing App From CWM Via Shell Command

Nov 8, 2012

The latest version of Google Now (2.1) doesn't like being flashed. If you flash it via CWM it seems to break voice search functionality, causing a force close.

Playing with the adb shell, I discovered that the pm install command works nicely:

Code:
pm install [APKNAME].apk

So, I thought this would be perfect to execute in a shell script via CWM/Edify.

So far I've tried all manner of commands. First I was trying the above command in a install.sh file, before I realised that "pm" wasn't present anywhere in /sbin/ (the header of my shell script is #!/sbin/sh").

So, I've tried this:

Code:
#!/sbin/sh
exec /system/bin/pm install data/media/install/Velvet.apk

Here is the update script:

Code:
ui_print("Mounting system...");
run_program("/sbin/busybox", "mount", "/system");
ui_print("Mounting data...");
run_program("/sbin/busybox", "mount", "/data");
[Code] .....

Which, copies the files correctly. This also isn't my first time running scripts in my installer, but this is the first time I've attempted this. To no avail. This same command works in the adb shell, though.

Also, is there another way of flashing that may work? I heard about putting the original file ("Velvet.apk") in /system/app and then putting the updated version in /data/appcom.google.andorid.googlequicksearch-1.apk but this doesn't work either.

Running the above script in Busybox installer's script running function also works perfectly. The only thing it won't do is install from CWM.

View 2 Replies View Related

General :: Shell Command To List Files In APK?

Jun 17, 2013

I'm trying to unzip an apk using the device shell. I need to see the package name of the app contained in the apk. I tried using unzip -l but I just get output that says "zip flags 1 and 8 not supported". How can I unzip an apk? For that matter, am I using the right tool for this job? I just want to view the manifest of the apk, really. I have busybox.

View 4 Replies View Related

General :: ADB Shell Command - Wipe Data

Jun 2, 2014

I pushed + and power the red triangle pops i went to adb devices it showed the devices on recovery mode. Is there a command that i can put to wipe data? Such as adb shell command.

View 1 Replies View Related

General :: How To Execute Command Shell Programmatically

Apr 11, 2012

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

View 4 Replies View Related

General :: ADB Shell / Is Command - List Of Files Not Sorted By Name

Jun 8, 2012

When I start the ADB shell from the Windows command line, and type the command "ls", the list of files I get is not sorted by name. Also, if I enter "ls -r" which should reverse sort, I get the error message "no such file". If I type "busybox ls -l", I get the expected sorted list. Also, other commands like "busybox ls -la" work.

My Phone is a Samsung Captivate i897, rooted from Gingerbread with Corn Kernel v7.06 with Superuser and BusyBox installed.

How can I get the Busybox version of the shell commands to run without having to type "busybox" all the time?

View 1 Replies View Related

General :: Android Shell Command To Check If Process Is Cached

Sep 9, 2012

I am wondering what terminal command I can use to check if a process has been cached. On my Sprint Galaxy Nexus, rooted, with the latest build of the Paranoid Android jelly bean rom, I can go to my settings, click on apps, swipe to the "Running Apps" list, and click on the button at the top of the screen that says "Show Cached Processes," and that displays the list that I am trying to access. My reasoning for doing this, is to use "Secure Settings" in conjunction with "Tasker" to check if my "Groove IP" application is running. Initially, I was trying to use "pgrep -l com.*" and check that list for "com.gvoip" too see if "Groove IP" is running in the tray (pull down menu), but if the process is cached, it still shows up in that list. How to get a list of cached processes from terminal.

View 4 Replies View Related

General :: How To Install APK From ADB Command Line

Feb 15, 2012

How do install a *.apk from adb command line?

First I tried to cp the *.apk from /sdcard/backups/apps to /system/app (after rw mounting the file system of course)

I did successfully move it to /system/app but the *apk was not "installed"

then I rm it and tried:

install /sdcard/backups/appa/<package>.apk /system/app

and it copied the *apk to /system/app but still was not "installed"

I also tried:

install /system/app/<package>*apk but got the error dialog:

Code:

BusyBox v1.19.0.git.adrynalyne (2010-12-21 22:03:30 MST) multi-call binary.

Usage: install [-cdDsp] [-o USER] [-g GRP] [-m MODE] [SOURCE]... DEST

Copy files and set attributes

Options:
-cJust copy (default)
-dCreate directories
-DCreate leading target directories
-sStrip symbol table
-pPreserve date
-o USERSet ownership
-g GRPSet group ownership
-m MODESet permissions

My goal is to figure out how to use adb command line and also I want to install an app as if it were a pre-installed app. For example pre-installed apps don't show up as a removable app and stay installed after a factory reset.

View 9 Replies View Related

General :: Play Sound (WAV / MP3) From Command Line?

Sep 13, 2012

Is it possible to play sound on Android device from terminal command line? How to do it?

View 1 Replies View Related

General :: Creating Zip Files In Android Command Line

Jun 27, 2011

I noticed in the newer releases of busybox there's no 'zip' command anymore. I'm running busybox 1.19 on my Incredible.

I have been using this command to create different bootanimation.zip files from my phone but am wondering if there is an alternative command I can use from within Android. I've tried tar -cvzf but I believe tar archives/compresses the files differently and renaming the extensions to .zip does not work.

View 8 Replies View Related

General :: Application Shortcut With Command Line Parameters?

Nov 6, 2011

I always had windows mobile devices in the past, and like you must know, the old good windows mobile no longer exist... Microsoft killed it.

So I switched to Android. I really like android, The way it works is pretty the same than windows mobile with file browser, files system(Not like the Iphone without any way to deal with a file at all), .APK install like the .CAB on WM...

One think that I loved on WM is how easy it was to make shortcut by yourself, even with parameters. As example, it was easy to create a shortcut to Coreplayer to play an HTTP stream when simply clicking on it.

Like: "coreplayer.exe my_teststreamDOTcom : portNumber"

View 5 Replies View Related

General :: Emerson EM543 Tablet - Call Lockscreen From Linux Command Line?

Dec 1, 2012

Running Android 4.0.4 on Emerson EM543 Tablet. Could not install Google Play so had to install Android Market. Market apparently somehow disables the Android system LockScreen. So, now trying to get lockscreen back on boot (downloadable apps, as far as I can see, don't lock screen at system boot, which is what I want). I got a terminal emulator and was wondering if there was a Linux command line argument I could use to start Droid lockscreen at system startup.

I thought I was getting close with this solution, [URL] ....., but it is for an HTC Amaze 4G, and I can locate the AdroidManifest.xml files in the apk files on my system (using ROM Toolbox Pro Root Browser). But, even if I could figure out how to do it there, that file would be changed in the very next update. I am looking for a something similar, just need to know the xml filename or a command line argument that could be used in a startup script.

View 3 Replies View Related

General :: (SL4A) Importing PHP Or Python Script From Github To Execute From Command Line

Jun 1, 2013

What I am trying to do is get either nest-api in PHP or pynest in python to run out of SL4A in order to control my Nest thermostat ultimately out of Tasker. Both are found on github, but I can't link to them as I apparently need ten posts to do so. So a google search for "nest-api github" and "pynest github" will have to do I suppose.

I have absolutely no issues getting either to run out of Terminal on my MacBook Air, but for whatever reading the SL4A shell seems to escape my understanding. I would rather have the PHP script work, as it has more options for things I can set, which I like. Where to put the nest.class.php on my phone in order for the PHP shell to reference it when running the example.php or any script I write myself. When I put both files in the sdcard/sl4a/scripts folder and try to run either from within either sl4a or sl4a's shell I get a call to undefined function error.

For the python script, I'm not sure how I need to import the module so that I can call it with nest.py at the beginning of my command line prompt and follow it up with the user name and password and so on. I've done everything including trying to create an .egg file, which I've since been told is not necessary, and that I simply have to put it in the /sl4a/scripts folder. That doesn't make sense to me though, as I needed to run the setup.py command on my computer in order to start using it, and the .egg file should be the equivalent of that on the phone, no?

So what I am looking for is the foolproof way to get either a php or python script running through the shell that isn't actually hooking into the Android environment at all, which is what all the writeups I have found in my searching seems to pertain to. Then eventually make sure that they are available in a way that Tasker can call them. I should also note that all this has been done in an emulator through eclipse until this point, as I didn't want to go screwing around with my brand new Nexus 4's file structure until I had the best practice perfected.

View 2 Replies View Related

Android :: How To Use Shell Command In App

Aug 28, 2009

I 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?

View 6 Replies View Related

General :: Send SMS Via ADB Shell From PC To Android Phone?

Oct 26, 2011

is it possible to send sms via adb shell from pc to android phone (via usb) ??

View 4 Replies View Related

Android :: Possible To Run ADB Shell Command From Inside An App

Jan 29, 2009

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

View 5 Replies View Related

Android :: Run A Shell Command From Within Code

Jun 16, 2010

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.

View 5 Replies View Related

Android :: Possible To Run ADB Shell Hello.c Command From Inside An App

Nov 13, 2009

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.

View 2 Replies View Related

Android :: ADB Rejected Shell Command - Ls -l /data

Feb 10, 2010

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.

View 1 Replies View Related

Android :: Not Able To Connect Device Using Adb -d Shell Command From Vista

Oct 23, 2009

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

View 5 Replies View Related

Android :: How To Dump The Content Of Sqlite Via Adb Shell Command

Apr 16, 2009

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

View 4 Replies View Related

Android :: Execute Adb Shell Command At Runtime From Application

Apr 12, 2010

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

View 1 Replies View Related

Android :: Getting Result Of Executed Shell Command Fails / Hangs

Sep 15, 2010

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]

View 1 Replies View Related

Android :: Deliver Test Params Using Adb Shell Am Start Command

Jul 29, 2010

I wish to know how in java I should receive these parameters. I do know how to deliver parameters via adb shell am start command but I still have a problem to get them in java (android) code.

My class extends InstrumentationTestCase and not Activity class!

So I cannot perform: this.getIntent().

I anderstand that I need to create intent doing: Intent intent = new Intent(Intent.someAction);

Can you help me to find out what action should I use here.

I also read that there are secondary attributes: category, type, component, extras. I know that I also need to update the manifest file accordingly. Sorry for so many q/a.

View 1 Replies View Related

Android :: Why Does Sqlite3 Command Using The Adb Shell Return Permission Denied

Sep 5, 2010

Specifically, I was trying to use the sqlite3 command with the adb shell to run some queries on the database of the Android application I'm building. I kept getting "sqlite3: permission denied". I'm developing on a Nexus One that I purchased from Google. Does my phone need to be rooted or something?

View 1 Replies View Related

Android :: Specify Command Line Parameter?

Dec 7, 2009

How can i specify command-line parameter when I launch an android application? 1- With Eclipse 2- Directly from the phone

View 2 Replies View Related

Android :: How To Access Command Line?

Apr 14, 2009

So i am wanting to fiddle around with the new sdk but I never learned how to use command line in any IDE. Anyways I need to create an AVD with the command line can someone please tell me the steps or tell me somewhere I can read up on this. I have tried google searching command line eclipse, but the only results I get are nifty commands I can use once I actually find out how to get a command line. I am using windows.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved