[Q] Method to -automate- the upload of a file? [Solved] - Droid Incredible Q&A, Help & Troubleshooting

I have Tasker set up to periodically record certain data to log files on my phone. Moving these log files to a PC/FTP Server/Etc is done easily enough manually, but I'm looking for an automated solution that works on a schedule without any manual intervention.
Any suggestions? I would prefer a solution that can use the regular data network rather than requiring a cord or wifi.
Thanks

Have you looked at the SL4A plugin for tasker? You might be able to write a Ruby, Perl, etc script to do this and execute it on a schedule using tasker.
Sent from my ADR6300 using XDA App

Hi sl0wd0wn,
I have both the SL4A and Locale Execute plugins, but I am not an experienced coder. I wouldn't know where to start to write a script that uploaded a file somewhere.
My script writing knowledge is limited to little kid stuff: variable manipulation, if/then, etc. If someone can give me a relevant script, there's a good chance I could figure out how to adapt it to my needs, but I don't have the knowledge to start from scratch.
Thanks though

I'm trying the following. It doesn't give me any errors, but it's not actually uploading the file either.
Any thoughts? Or any suggestions on an alternate script?
Code:
#!/bin/sh
# FTP variables
FTP_HOST=ftp.*****.com
FTP_USER=*****
FTP_PASS=*****
FTP_REMOTE_DIR=/
ftp -inv $FTP_HOST <<EOF
user $FTP_USER $FTP_PASS
binary
put *****.log
quit
EOF
exit 0

What you provided is an example of a linux shell script. You can still run it from s4la, but it's different from a perl/ruby script. It will work, but you have to be rooted. If you're rooted, take a look at the ftpput command in your system\xbin directory. Here's some documentation on the command. .
http://www.busybox.net/downloads/BusyBox.html
It looks fairly straightforward. The most difficult part will probably be dealing with file names

Awesome! Thanks so much for the help - perfect.
Of course I seem to have run into another speedbump... I have a working .sh script: it runs perfectly from within the SL4A GUI. But if I use the SL4A plug-in from Tasker to execute it, I get a Force Close from SL4A
Guess I'll have to keep experimenting.

OK - instead of using the SL4A plugin in Tasker, I used the Execute plugin to run the sh file. Same thing, sure, but the latter solution doesn't cause Force Close (for whatever reason)
niiiiice

I don't know if the forum is acting up or my computer is acting up, but I got email notification of a reply that doesn't actually seem to be in this thread. Still, let me give an answer in case anyone else finds it useful...
So you're good to go?
Click to expand...
Click to collapse
Yes, indeed.
Your prediction that file names would be the biggest issue was correct. For some reason (which is probably common knowledge to others, but wasn't to me), commands behaved differently from the adb shell than from the SL4A shell.
From adb, I was able to simply type:
Code:
ftpput -v -u username -p password 11.22.33.44 ./remotedir /sdcard/localdir/file.log
and it worked properly. Running this same exact command from the SL4A shell (and/or script) resulted in complaints of the file/directory not being found. Changing to this format for the sh script worked, however:
Code:
cd sdcard
cd localdir
ftpput -v -u username -p password 11.22.33.44 file.log
Then, running this script worked from SL4A GUI, but caused Force Close issues when I tried to execute through Tasker's SL4A plug-in. Using the Locale Execute, plug-in, however, I was able to execute the sh file by using:
Code:
@! sh /sdcard/sl4a/scripts/MyScriptBlaBla.sh
Now Tasker just executes this on a regular schedule.

Awesome. Glad to hear you were able to figure it out.

Wow thats great! This is exactly what i am looking for a long _Time.
I am a noob in Tasker and programming
Can you please explain how I can set this up?
Thank you very much!

gronph said:
Can you please explain how I can set this up?
Click to expand...
Click to collapse
Sure, gladly. My described method may not be the most efficient, but it has worked perfectly for me.
You will need:
Tasker
SL4A and
Locale Execute
Go into SL4A and click Menu > Add > Shell
This will open a new .sh script for you to edit.
In the top window, type the name of the script (let's call it Synch.sh)
In the bottom part of the window, use the following code:
Code:
cd sdcard
cd localdir
ftpput -v -u username -p password 11.22.33.44 file.log
In case it's not apparent, replace "localdir" with the directory that contains the file, "username" should be the FTP username, "password" should be the FTP password, "11.22.33.44" should be the IP address of your FTP server, and "file.log" is the item you want to upload. Adjust the script as needed.
Now click Menu > Save & Run
Wait a minute or two, then check that your FTP server did indeed get the file. Assuming you typed everything correctly, your script should have worked.
Delete the file from your FTP server (so we can run another test later)
Now go into Tasker and create a new Task
Within the new Task, the action you want to add is under "Plugin" and should say "Execute"
When the Execute action comes up for configuration, hit the Edit button on it.
You will get a free text box in which you will want to type the following:
Code:
@ sh /sdcard/sl4a/scripts/Synch.sh
Now just click the back key to exit the text input box. Click "Done" on the Execute window, returning you to the Task itself. Now click "Test." Wait a minute or two and check your FTP server. The file should be there again.
Assuming everything worked out properly, you can now just choose how Tasker executes the Task. You could make it time based (every x hours, for example), or context based, etc.
It's worth noting that this method will overwrite the file if it already exists on the FTP server... so keep that in mind.
(There is also a SL4A plugin for Tasker that should theoretically be easier as you would just select which script you want it to run. I've encountered bugs and crashes with that plugin, however, which is why I choose to use the described Execute method above)

Thank you!!!
But it is not working here...
When I click "Save and Run" nothing is transfered. Can I activate logging so that I can see what is going wrong? I saw a logfile in the sl4a Folder but it is empty
EDIT: I am still trying... seems to be my Webspace

I'm not sure about logging.
Should have asked before, but are you rooted? And does your device have busybox installed?
Try this:
From SL4A, when you are just looking at the list of scripts that you have, drag your finger from the right side of the screen to the left. This should take you to a screen that says "Interpreters" up top. Click on "shell" which will open a terminal window. Now try typing the commands directly into the terminal (the same commands you put into that script). This should allow you visibility of what is happening. For example, below I've just opened the terminal window and typed "ftpput" without any parameters:

Thank you again! Now it works perfect!

ftpput doesn't want to work for me for some reason, I do exactly as you do and I don't get any errors but the file doesn't upload to the ftp server.

Just to add to the list of possible solutions, the app sync4android (android.kowalczuk.eu/rsync4android)(*) allows you to use the unix rsync command to copy/sync files and/or directories over networks. This doesn't require root, and the developer has provided locale/Tasker support, so it's easy to automate.
Rsync is a very cool protocol for managing backups, since it will compare the source and destination files/directories and only send the differences. I use the above app with Tasker to automatically upload any photos I take with my phone to my home server.
* just a note that I've included the pertinent parts of the URL to the app in those parenthesis since I can't post links here 'till my post count gets higher than some arbitrary number.

Thanks for the heads up on that program, wildland. I'll have to check it out.
zzzooo10 said:
ftpput doesn't want to work for me for some reason, I do exactly as you do and I don't get any errors but the file doesn't upload to the ftp server.
Click to expand...
Click to collapse
What is returned when you run the command in the shell interpreter as described above?
byrong said:
Try this:
From SL4A, when you are just looking at the list of scripts that you have, drag your finger from the right side of the screen to the left. This should take you to a screen that says "Interpreters" up top. Click on "shell" which will open a terminal window. Now try typing the commands directly into the terminal (the same commands you put into that script). This should allow you visibility of what is happening.
Click to expand...
Click to collapse

byrong said:
Sure, gladly. My described method may not be the most efficient, but it has worked perfectly for me....
Click to expand...
Click to collapse
byrong, Just wanted to say thanks a lot for all the info you provided here. Thanks to your posts, I learned about SL4A, finally understood the point of installing BusyBox (had it installed before with Titanium Backup, but didn't really know what it did), learned about the ftpput command and how to configure its parameters to meet my needs, etc.!
My Tasker script is set up so that if the phone receives a txt containing a certain keyword, it takes a photo and uploads it to my website, grabs the date, time, battery level, cell-based (and gps-based, if possible) position and location accuracy and txts all that back to the txt sender. Now I just need to find a good way to use that info to quickly track the coordinates, but that's another matter...
Taking a photo is admittedly not that useful (unless whoever stole my phone happens to be looking at the back of it at that moment), but I have an EVO (which has a front-facing camera), so I mostly just wanted the photo part in place so I can add the front-facing camera stuff if Pent ever adds support for it.
Anyway, thanks again!

anyway to automatically upload camera shots to dropbox?
I do it manually now, but if it could be automated that would be so much easier

illflux said:
Anyway, thanks again!
Click to expand...
Click to collapse
No problem! Glad it helped.
For what it's worth, I have similar "gotcha" type tasks for the same reasons you mention: in case someone gets a hold of my phone. Like you, I have location-reply text functions built.
I also have one that will immediately reboot the phone. I use a pattern lock, but have it set to a 10 minute delay. On the off chance that someone got a hold of my phone while it was unlocked, I could send the reboot command to it, which would at least activate the pattern lock screen.
spangenberg said:
anyway to automatically upload camera shots to dropbox?
Click to expand...
Click to collapse
I don't really use Dropbox, so I'm not sure what kinds of functionality exists. If they offer users an FTP interface of some sort, you can use my described methods. If not, you'd have to research an alternate solution. Perhaps Dropbox has action intents that can be fired by Tasker? I'm not sure.

Related

Unlock NAND on MAC anyone?

tryin to get mac to adb to device, but cannot get it to work.
anyone have success? would like to test these nice roms out.
thanks
nitty917 said:
tryin to get mac to adb to device, but cannot get it to work.
anyone have success? would like to test these nice roms out.
thanks
Click to expand...
Click to collapse
I did it on my MBP. What problems are you having?
I did it on my macbook..
I also did it on my Mac. Like someone else said what specifically is the issue you're encountering?
there is a post in about using Terminal app from the market to do this and it works!
brianb7590 said:
I did it on my MBP. What problems are you having?
Click to expand...
Click to collapse
thanks, I cant get it to communicate in terminal,
i have no idea. i dloaded the sdk, dragged the adb from tools folder,
onto the terminal, it opens up all the adb commands but after that i cant type
nothing.
nitty917 said:
thanks, I cant get it to communicate in terminal,
i have no idea. i dloaded the sdk, dragged the adb from tools folder,
onto the terminal, it opens up all the adb commands but after that i cant type
nothing.
Click to expand...
Click to collapse
Don't drag it to the terminal.
I would navigate to the directory where you stored the SDK and go to the tools folder and run it that way or you search up how to set your PATH to include the tools folder.
nitty917 said:
tryin to get mac to adb to device, but cannot get it to work.
anyone have success? would like to test these nice roms out.
thanks
Click to expand...
Click to collapse
Like the others who have already replied, I also did it on my mac and was a complete noob. It was only through much trial, error, YouTube, and 3 other sites that I figured it out. Needless to say I'm now fluent in adb and would be happy to answer any questions you have since I was in exactly the same shoes as you last weekend. Below are the biggest things you need to know when you start:
1. When you plug the phone into your computer make sure you select "Charge Only." If you select "Use Phone as Disk Drive" you won't be able to write to the phone, only read. I ran in circles for a long time getting "Read-Only File System" errors and it was all due to having the phone mounted as drive.
2. Make sure you have USB Debugging turned on. After that, you should be able to communicate with the phone fine.
3. ADB - The instructions are nearly identical regardless of operating system but on a mac you need to add "./" (without the quotes) before adb commands. For example, lets say I have a file on my desktop called "Test_File.img" that I want to push to the root of the sdcard. On my Mac I would type "./adb push /Users/Bryan/Desktop/Test_File.img /sdcard/" (without the quotes of course) & (Bryan is my Username)
4. To avoid any issues make sure none of the folders or file names you are working with have spaces in the name.
Hopefully all this helps and does no lead to more confusion than when you started. Again, if there are any specific errors you are seeing post them here and either I or someone else would be happy to answer them.
Bryan
okolowicz said:
Like the others who have already replied, I also did it on my mac and was a complete noob. It was only through much trial, error, YouTube, and 3 other sites that I figured it out. Needless to say I'm now fluent in adb and would be happy to answer any questions you have since I was in exactly the same shoes as you last weekend. Below are the biggest things you need to know when you start:
1. When you plug the phone into your computer make sure you select "Charge Only." If you select "Use Phone as Disk Drive" you won't be able to write to the phone, only read. I ran in circles for a long time getting "Read-Only File System" errors and it was all due to having the phone mounted as drive.
2. Make sure you have USB Debugging turned on. After that, you should be able to communicate with the phone fine.
3. ADB - The instructions are nearly identical regardless of operating system but on a mac you need to add "./" (without the quotes) before adb commands. For example, lets say I have a file on my desktop called "Test_File.img" that I want to push to the root of the sdcard. On my Mac I would type "./adb push /Users/Bryan/Desktop/Test_File.img /sdcard/" (without the quotes of course) & (Bryan is my Username)
4. To avoid any issues make sure none of the folders or file names you are working with have spaces in the name.
Hopefully all this helps and does no lead to more confusion than when you started. Again, if there are any specific errors you are seeing post them here and either I or someone else would be happy to answer them.
Bryan
Click to expand...
Click to collapse
If you're going to be using adb on a regular basis, and want to avoid typing "./" before each command, you can add the android sdk tools path to your .bash_profile file in your home directory. Something along the lines of:
export PATH=${PATH}:/path_for_ur_sdk_folder_location/android-sdk-mac_86/tools
mocalve said:
If you're going to be using adb on a regular basis, and want to avoid typing "./" before each command, you can add the android sdk tools path to your .bash_profile file in your home directory. Something along the lines of:
export PATH=${PATH}:/path_for_ur_sdk_folder_location/android-sdk-mac_86/tools
Click to expand...
Click to collapse
That wont be saved. It goes away after every reboot.
Fixter said:
That wont be saved. It goes away after every reboot.
Click to expand...
Click to collapse
True, if you enter it from the command line. But if you add it to the .bash_profile file , it will stick... at least on my Mac Pro it does...
mocalve said:
True, if you enter it from the command line. But if you add it to the .bash_profile file , it will stick... at least on my Mac Pro it does...
Click to expand...
Click to collapse
If I add those entering nano .bash_profile and enter that command and the pressing Ctrl X and Yes it will stick?
Fixter said:
If I add those entering nano .bash_profile and enter that command and the pressing Ctrl X and Yes it will stick?
Click to expand...
Click to collapse
It should... although I use vi instead of nano. Regardless, after saving the .bash_profile, you'll have to fully exit the terminal application and restart for the path setting to take effect. After that, it'll be in effect every time you start terminal.
mocalve said:
It should... although I use vi instead of nano. Regardless, after saving the .bash_profile, you'll have to fully exit the terminal application and restart for the path setting to take effect. After that, it'll be in effect every time you start terminal.
Click to expand...
Click to collapse
Nano is way cleaner. And yeah. It got applied.

[Q] Access system folder on PC?

What do you guys use to access the system folder on your PC?
Basically, I want to have a play with a few of the files etc, but how do I get them (eg. Rosie.apk) onto the PC?
Is there software to do this, or do I have to use command line?
Many Thanks
You can pull the files from the phone by using the "adb pull [FILE]" command from the command line.
You'll have to have HTC Sync drivers and ADB on your system before that.
Is this the only way/easiest way? I'm asumming to send back I would use "adb push"?
Ease is a relative term so I cant judge on that basis.. Personally I find using the command line rather easy and fun.
Another possible way would be to use an app like Root Explorer on the phone to copy the system files on to the sdcard and then access the card via PC. (More cumbersome I think)
And you're right.. "adb push [FILE] [PATH]" is the command to send the file back to the phone. Try typing just "adb" and hit enter to see a list of commands and their usages.
Stuck at the first hurdle....
I've got the ADB on C:\ root
I open command prompt, type cd c:\adb
This puts me into the abd directory OK.
I type adb, and it adb is not a recognised command???
You sure you've got adb.exe and the dlls in that same directory?
I've attached a zip for you. Extract it and double-click on StartHere.bat, you'll get a command window and you can start using adb right away.
Cheers, I must have had a missing .dll
download Samba app: http://forum.xda-developers.com/showpost.php?p=8239139&postcount=128
this gives you access to the sdcard only, so to get access to system follow the instructions in this thread: http://forum.xda-developers.com/showthread.php?p=18722729#post18722729
it works a treat! and is very easy! just be careful what you play with, using adb pull and push is safer
I agree that command line is the best way, but if you really want a GUI, then QtADB is pretty good:
http://qtadb.wordpress.com/
http://forum.xda-developers.com/showthread.php?t=683223
It's really just a graphical front end to adb.exe, but makes it easy to push or pull files to or from the phone. The only thing I haven't spotted is how to adjust permissions on files on the phone.
preacher65 said:
I agree that command line is the best way, but if you really want a GUI, then QtADB is pretty good:
http://qtadb.wordpress.com/
http://forum.xda-developers.com/showthread.php?t=683223
It's really just a graphical front end to adb.exe, but makes it easy to push or pull files to or from the phone. The only thing I haven't spotted is how to adjust permissions on files on the phone.
Click to expand...
Click to collapse
I didn't know about that.. I'll try that too. (Although I still think I'll end up to command line usage again)
Btw, APK Manager is quite useful if you're planning to mod some apk files like framework-res etc.. I use to make minor image changes to my ROMs..
if4ct0r said:
I didn't know about that.. I'll try that too. (Although I still think I'll end up to command line usage again)
Btw, APK Manager is quite useful if you're planning to mod some apk files like framework-res etc.. I use to make minor image changes to my ROMs..
Click to expand...
Click to collapse
Yep, I use the command line for 95% of stuff too - but then I'm old school and like the level of control command line gives.
But QtADB is useful if you want to move lots of files about, and as a bonus it has good logcat functions. Plus the support in the thread is pretty good as well. The guy really cares about his app, so I like to let people know about it.
APK Manager is awesome as well, though lately I've been going hardcore and doing everything apktool related from the command line as well!
I need some help accesing the system folder
Hey guys I am pretty new to android, I had been dealing with WebOS devices, I recently gotten a irulu a20 (all winner device) android 4.2.2 and wanted to improve the gaming performance and followed this instructions http://forum.xda-developers.com/showthread.php?t=2329080 and now my tablet does not stop popping a message saying "unfortunately System UI has stopped" and does not let me do anything or select anything. One of my friends did a wipe data/hard reset on it and still giving me the same issue with the same message, and what is worst I don't see the root browser icon (I guess due to the hard reset) so I don't know if my tablet still rooted or it is bricked. Please help and thank you to those who reply

[GUIDE][17 JAN]Debian shell, LXDE, and more, all on /data partition

Please rate this thread whether good or bad, I like feedback as this is my first in depth guide I have written. Thanks!
I know there are apps that make it as easy as a download and a button press to install linux on an Android phone, but I had hardly any room on my 8GB SD card, and I wanted to have a safe, reliable, and fast installation (my cards class 4). Also, this creates a lightweight and customisable installation, as all you start off with is the Debian shell, which is a 50MB download.
This guide will take you through downloading the app, to installing Debian in the loop file on your phone, to installing a VNC server and getting a GUI (in this case LXDE) up and running. So, without further ado....
PREREQUISITES
Your phone
Free space on /data/ , I would recommend at least 768MB for this. Unfortunately....
No apps to sd script... I'm not sure on this, prior to setting this up, I installed an a2sd script and my Debian shell would not work. Coincidence? You try it. I don't know.
I would have thought a lightweight ROM would help. This works fine for me, and I'm running Andromadus CM10.1 build 10. I don't know how Sense (which imo is pretty heavy) compares to Android 4.2.1, but I reckon AOSP is a good bet for any version of Android.
Terminal Emulator
Your brain. Of course, don't be afraid to ask questions, I'm sure I'll miss something
The recognition that I take NO RESPONSIBILITY AT ALL for cracked screens, disappearing keyboards, or gravitational collapses of the Vision's awesomeness creating a black hole and / or supernova which obliterates Earth and the Milky Way, although would look spectacular. Please bear in mind that this could genuinely mess up your device pretty bad, although only really badly if you try... yes, you can brick your phone or wipe EVERYTHING. So make a Nandroid. But once again, I'm the one that's laughing.
Click to expand...
Click to collapse
INSTALLING AND SETTING UP THE APP
Download Linux Installer STANDARD from the Play Store, or the ADVANCED version if you wish to contribute to the devs/ although you only need the STANDARD version for this.
I would suggest reading through their own guide first, although be aware this only covers getting a Debian shell up and running. Especially the bit towards the end which tells you how to muck up your device.
Anyway, the bit where you install the shell is here. I'll take you through what I suggest now, though.
Open the app
Menu > Setup
Install in a block device = [TICK]
Use loop file = [TICK]
Preferred distribution = Debian (Ubuntu doesn't work, according to the devs.)
Distribution version = I use Stable, I would've thought any Squeeze variant will do.
CPU architecture = armel by default, Don't change this.
Hostname = This is used for VNC. Default is fine.
Domain name = This is used for VNC. Default is fine.
Chroot point = /data/local/mnt/Linux . DO NOT USE /data/data/ EVER.
Name of chroot launcher script = linuxchroot . This is the command used to start the Debian shell
Server = blank by default. Don't know what this is used for, but is not important to us.
IP Version = IPv4 by default. I don't see any need to change this.
Loop file = /data/local/tmp/Linux.loop . DO NOT USE /data/data/ EVER.
File Size = 768MB . This is what I use, it's enough for VNC server, LXDE, C++ compiler, but not much else. I would not recommend any less.
Maximum loop dev = errrm. I don't know what this does. I've seen people use 32. Default is 8. I've tried both, and can't tell the difference. Stick to 8 to be safe.
Ext version = Default. This is checked automagically
Console refresh latency = Default (10). I don't know what this does.
Choose start panel = Default (Installer). This is just the screen the app starts on. Installer is easier.
Bind Android = [TICK] if needed, [BLANK] for safety. This means you can access your whole phone, that is, all the directories, root, sd card, of your phone, from your Linux installation. Could be useful, but probablyt not worth risking if you won't use it.
Send debug logs = [TICK] Default
Screen always on = [TICK] Default
Use embedded Busybox = [TICK] Default
Allow write to /system = [TICK] I suggest using this, I got problems with this disabled
Allow remount with dev/exec = [TICK] Once again, I'm not sure, I've seen people use it, but it's not essential
Click to expand...
Click to collapse
CREATING AND MOUNTING YOUR LINUX.LOOP, AND INSTALLING DEBIAN INTO IT
I think the original instructions are fine for this. I'll quote them here just in case you can't find them (red text is my input)
click create target loop (takes 2mn to write 500M on class 4 card)
click format target loop (50s)
click mount loop
click install distribution in loop. Installation should take between 15 and 50 mn depending on your Internet connection speed, and phone specifications (Flash and CPU speed). Installation process will temporally disable screen saver so that the phone will stay awake, and Internet connection will not be automatically disabled or put in sleep mode.
click Update launcher script.
You can now connect to your phone using any local console, via ConnectBot or adb shell You won't do this, instead open up Terminal emulator.
type su into the console
type linuxchroot in this console
you are now in a standard GNU/Debian environment, created via debootstrap. Network is already configured; you shall type aptitude update, then you can install any package you want.
Read messages carefully, and read the full tutorial on our website. URL is given in the About pop-up
Well done, you're running Debian shell on your Vision yay!
Click to expand...
Click to collapse
INSTALLING A VNC SERVER, X.ORG AND LXDE
This is the fun bit. We can now get LXDE up and running and access it via VNC (Don't worry, still on the phone... you'll see )
First, install android-vnc-viewer
Open up terminal emulator
Type su to be superuser
Type linuxchroot
This is what got me confused. I couldn't use apt-get, I got all sorts of errors. In order to fix these, WHENEVER YOU WANT TO INSTALL ANYTHING, type the following:
Code:
export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin
Now you can install your vnc server:
Code:
apt-get install tightvncserver
and now the X Windows System (this is needed for the GUI)
Code:
apt-get install xorg
and now LXDE.
The minimum set of elements, without recommended apps like file manager (this is lightest, but not particularly useful:
Code:
aptitude install --without-recommends lxde-core
The minimum set of elements (I suggest using this):
Code:
apt-get install lxde-core
A complete set of elements:
Code:
apt-get install lxde
A complete Debian LXDE desktop environment (Don't use this, it'll be heavy and you'll use up all your space (unless you had much more than 768MB))
Code:
apt-get install task-lxde-desktop
Unfortunately, you cannot use the LXDE desktop just yet. We need to set up the VNC server.
Code:
vncserver
This will start up an X-Windows session and create a vnc startup file. Type in your password (if you're a n00b, be aware that you won't be able to see stars or anything). You don't need the second password it asks for.
Now kill the VNC session:
Code:
vncserver -kill :1
Now we need to set up the VNC startup file:
Code:
cd /root/.vnc/
nano xstartup
Use the trackpad to navigate, type as normal.
Comment out etc/X11/xsession :
Code:
#etc/X11/xsession
At the bottom, add the lines to start up LXDE:
Code:
startlxde &
lxsession
Now save the file: Hold down vol-down, then y, then o .
Exit nano: Hold down vol-down, then y, then x .
Now we need to edit the .bashrc file:
Code:
cd /root
nano .bashrc
After all the comments, add the following lines:
Code:
export USER=root
cd /
rm -r -f tmp
mkdir tmp
cd /
vncserver -geometry 800x480
If you know how to use VNC on a tablet, just change vncserver -geometry to that resolution:
Code:
vncserver -geometry heightxwidth
Now save the file: Hold down vol-down, then y, then o .
Exit nano: Hold down vol-down, then y, then x .
Type exit to exit the Debian Shell. Close terminal emulator, and reboot.
Click to expand...
Click to collapse
RUNNING OUR NEWLY INSTALLED LXDE GUI
Now we've rebooted, open terminal emulator and run the Debian shell as normal (linuxchroot).
This time, you'll see some text about the X server running. If not, something's gone wrong.
Leave terminal emulator running, and go and open android-vnc-server from your app drawer.
Set up the app as follows:
Nickname = whateveryouwant
Remeber the password you entered before, when we were running the shell? No? D'oh!
Address = localhost
Port = 5901
Click connect... yay ! You should have LXDE up and running, if not, go over this guide, and if you think you've done everything, either hate on me or send me a useful PM outlining your problem.
Click to expand...
Click to collapse
SETTING UP TERMINAL EMULATOR
I've written a really quick script which asks you whether yo want to start linuxchroot upon opening Terminal Emulator. It's really small and quick, I've attached the actual script, here's how you set it up:
Download the attached "startup.txt" script, and put it on the root of your SD card ( /sdcard/startup )
Rename it to "startup" (without the quotes, and no extension, basically just get rid of the ".txt" bit on the end)
Open Terminal Emulator, and type the following:
Code:
su
mount -o rw,remount /system
cp /sdcard/startup /system/xbin/
chmod 700 /system/xbin/startup
chown root.root /system/xbin/startup
Now open Terminal Emulator preferences, scroll down to "Initial command" and set it as follows:
Code:
su
startup
Restart Terminal Emulator
You should be greeted with "Start linuxchroot?" and some options, Yes or No
Type 1 to say yes, this executes linuxchroot, starting the Debian shell
Type 2 to say no, this exits the script and does not mount Debian, allowing you to use Terminal Emulator as normal
I like this arrangement, as it means I don't have to type "linuxchroot" to start it every time or to auto start it and have to exit when I don't want to use it. It's especially quick if you use SuperSU, I find this generally faster than ChainsDD's "normal" Superuser, so su is executed instantly and you can quickly type "1" or "2" and you're off!
Click to expand...
Click to collapse
OTHER IDEAS
compile C++ programs:
Code:
export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin
apt-get install g++
Write your program, save as program.cc
Code:
g++ -o program program.cc
./program
Click to expand...
Click to collapse
Thanks for reading, I hope this helped !
Very nice. I will be trying this later.
About how much memory is being used (with and without LXDE session started)?
Thanks for your efforts.
pepar0 said:
Very nice. I will be trying this later.
About how much memory is being used (with and without LXDE session started)?
Thanks for your efforts.
Click to expand...
Click to collapse
Hi, sorry for the late reply.
TBH I don't think much memory is used at all really, to put it into perspective I've still got 140MB of RAM free whilst running this.
I haven't actually tested memory usage, but I expect you'd need over 100MB free RAM if you're planning on running LXDE. I have tried this in various situations however, and I would not recommend running zeppelinrox's V6 SUpercharger, or any other memory management script. This is because they meddle with VM heap sizes and minfrees and other RAM stuff, and ideally you should use the default 128MMB VM Heap size. This means you can use up a whole 128MB of RAM just for Linux (I don't know how processes are spread though, so you may be using more).
If you're running Sense, I'd be interested to know which version and how well this runs. If your using AOSP (CyanogenMod, AOKP, anything like that) you should be fine, as this works perfectly on Andromadus CM10.1 build 11, which is JB4.2, and presumably the heaviest version of Android.
Hope this helps, and I'd encourage you to try this, it's really cool once it's set up, even if it's not particularly useful to you
It's stuck for me right after I create the loop file. It asks me to tap the "format loop target" button but it's nowhere to be found. I'm only presented with the create target loop one.
crestofawave said:
It's stuck for me right after I create the loop file. It asks me to tap the "format loop target" button but it's nowhere to be found. I'm only presented with the create target loop one.
Click to expand...
Click to collapse
That sounds odd. Not to sound patronising, but this is all I can think of:
Have you got enough space on /data ?
Did you enable write to /system ?
Perhaps there was a Superuser error?
Have you left it long enough to finish? If it says "please wait" at the top, it's still doing it's thing. I expect this is the most likely cause, as the app doesn't make it very clear when it's finished an operation.
D'you mind sending a screenshot before and after creating the loop file, if the problem persists? Thanks, hope you sort it out
Maybe we should use Lubuntu? It takes 100-120mb at startup and it have pretty good configured LXDE and other *candy's* for touch installable.
And how about E17? it's more lightweight than LXDE. Look to Bodhi Linux *maybe we should use ARM vertion?*. It based on ububntu and It have a touch vertion too.
sergeikaspd said:
Maybe we should use Lubuntu? It takes 100-120mb at startup and it have pretty good configured LXDE and other *candy's* for touch installable.
And how about E17? it's more lightweight than LXDE. Look to Bodhi Linux *maybe we should use ARM vertion?*. It based on ububntu and It have a touch vertion too.
Click to expand...
Click to collapse
I do not know of any apps that allow you to install Lubuntu, although if you knew how you could get the IMG and do it yourself. I wrote this guide because it allows you to start from the ground up, with a simple Debian shell to installing whatever GUI and apps you want, or no GUI at all and just some terminal apps (if you can call them that).
Tat means you could install Gnome if you were so inclined, or any other window manager, desktop suite or anything, really. If you had room you could get the Android SDK. Just cause I used LXDE in my example doesn't mean you have to. Just install E17 or whatever you want and in the vnc startup file just tell it to run that instead of LXDE.
Hi!
I'm trying to install Debian Squeeze using your guide but with "linux.loop" file being on the SD-Card (I have like 100 MB free space on /data). When I clicked "Mount loop", Linux Installer after a few seconds just crashed. Then I turned it on again - I was able to start the installation anyway and now I'm installing it.
Was that crash something that could make Debian not working?

[Q] help with adb pull [Solved]

so my wife dorpped her s3 and broke the screen, the phone is rooted and i have adb debugging turned on i can use adb to pull/puch etc. but i dont know how, could some on tell me what adb commands i need to issue to the device to pull her internal sd data to my computer and push it back to her new s3, i also need to know how to wipe her phone with adb and reset to stock so i cna return it to the insurancce company, if anyone could tell me how to basically pull everything from her phone, internal sd data, and her text messages i know to pull the texts and view them i will need to use sqlite 3 to view the .db of her text messages but i cant figure out the commands to do so and i cant figure out how to format the commands so that it will pull the info to my desktop for viewing through sqlite 3 on the computer, also if i need to install sqlite 3 on the device with adb i need to know the commands for that as well, all help is welcomed, i have to get this thing back to stock in the next week or so, you are even more than welcome to call me an idot noob because i really am, i am very technically inclined and can follow complex instructions provided they are complete, please help ! lastly is there an adb command that would transfer what should be displayed on the screen if it worked within a emulator window if so please include that information as well.
This has been solved thanks to the info that was given, i was able to wrap my head around the entireity of adb, and my actual problem was not formatting of commands, my wife had a lock screen so i had to get that unlocked before adb would allow pulls if you need to do this with you phone i have posted a tutorial in the android general development and hacking [developers only] forums
MotoDefier said:
so my wife dorpped her s3 and broke the screen, the phone is rooted and i have adb debugging turned on i can use adb to pull/puch etc. but i dont know how, could some on tell me what adb commands i need to issue to the device to pull her internal sd data to my computer and push it back to her new s3, i also need to know how to wipe her phone with adb and reset to stock so i cna return it to the insurancce company, if anyone could tell me how to basically pull everything from her phone, internal sd data, and her text messages i know to pull the texts and view them i will need to use sqlite 3 to view the .db of her text messages but i cant figure out the commands to do so and i cant figure out how to format the commands so that it will pull the info to my desktop for viewing through sqlite 3 on the computer, also if i need to install sqlite 3 on the device with adb i need to know the commands for that as well, all help is welcomed, i have to get this thing back to stock in the next week or so, you are even more than welcome to call me an idot noob because i really am, i am very technically inclined and can follow complex instructions provided they are complete, please help ! lastly is there an adb command that would transfer what should be displayed on the screen if it worked within a emulator window if so please include that information as well.
Click to expand...
Click to collapse
I'm not going to call you an idiot noob. It seems to me that you know a little more than you express. A few Google searches could answer all of your questions. You are asking for someone to write you a novel, it's not going to happen.
Aerowinder said:
I'm not going to call you an idiot noob. It seems to me that you know a little more than you express. A few Google searches could answer all of your questions. You are asking for someone to write you a novel, it's not going to happen.
Click to expand...
Click to collapse
google has actually been un helpful in this dilema, however I think the explaination of adb commands on the sdk's page looks like it has enough information for me to write, my own novel (lol) so I will start there tonight, and hope that I understand the procedures described as well as I think I do, thanks for the reply anyway
Now that I have a little more information I guess what I really was trying to ask is for someone to give me a little better understanding of how issuing commands work I know how to issue ADB commands for instance with ADB HELP OR HELP ALL the command looks like this in the example. Adb pull [<local>] [<remote>] i dont understand what information adb is looking for where it says local and remote, is adb looking for me to type the [<local>] [<remote>] exactly this way or is it leading me to give a path for local and a path for remote, if so how do i go about figuring out said paths?
Sent from my ASUS Transformer Pad TF300T using xda app-developers app
Local would be path on pc, remote would be path on phone.
sorry, for asking probably dumb questions
Aerowinder said:
Local would be path on pc, remote would be path on phone.
Click to expand...
Click to collapse
I know that it sounds stupid that i know how to open adb, i know how to issue commands (mostly) and i know that you said you think i know more than i am taking credit for, but heres the thing i do know ALOT about computers and can do almost anything with them however Command line utilities is not my strong suit, so local is the path on the pc remote is the path on the phone i am assuming that this would be the proper way to pull the sd data
adb pull -shared [< / sd>] [< C:\user agentlogon\Desktop>] if i wanted to store the file on my desktop would that be correct or am i just completly command line retarted? , i know that this isnt the real path but if it were is this correct formatting for the command line?
Like this: adb pull -shared "/sd" "C:\user agentlogon\Desktop"
Adb kill-server
Adb start-server
Adb pull <file> <Local>
Sent from my LT26i using xda app-developers app
Aerowinder said:
Like this: adb pull -shared "/sd" "C:\user agentlogon\Desktop"
Click to expand...
Click to collapse
Ok, so sorry, at this point i feel like a total idiot and im sure if your not right there with me your getting close, but i think this last question will help me understand command line utils better in the future, so when you see [<>] am i correct that the utility is showing me its okay to perform said command on [ ] directories <> files ? Also i am a very literal learner so do i use the quotes on the command or are you just quoting me?
[<>] = variable. Replace the entire sequence. So, [<local>] = "C:\directory\file.ext" This is not standardized across commandline apps. The [<>] is only meant to show the user that they need to replace this with his/her own value.
In commandline utilities, spaces separate commands, this is why you need quotations around directories that have spaces. If you don't, the C:\... directory will be interpreted as two seperate commands, resulting in a syntax error. I always use quotations around directories out of habit. / is often used as a switch. To be safe, always quote directories. This is standardized across all commandline apps.
TrinityHaxxor said:
Adb kill-server
Adb start-server
Adb pull <file> <Local>
Sent from my LT26i using xda app-developers app
Click to expand...
Click to collapse
Yeah i got the kill start sever on lock, and i am wanting to pull thecentire contents of the sd, not a single file, but thanks for your input it is all welcomed!
Aerowinder said:
[<>] = variable. Replace the entire sequence. So, [<local>] = "C:\directory\file.ext" hhis is not standardized across commandline apps. The [<>] is only meant to show the user that they need to replace this with his/her own val
In commandline utilities, spaces separate commands, this is why you need quotations around directories that have spaces. If you don't, the C:\... directory will be interpreted as two seperate commands, resulting in a syntax error. I always use quotations around directories out of habit. / is often used as a switch. To be safe, always quote directories. This is standardized across all commandline apps.
Click to expand...
Click to collapse
now i have a new problem it is saying /sd does not exist do you possibly have a screenshot of the path for the sd in a file manger you could post for me if not i will try to look at it with my wifes new phone and hope that the stock file system is the same as the modded system she has on the broken phone. also if this doesnt work how would i just do a full wipe of the phone so it looks like i just wiped it for privacy.
Try:
/storage/sdcard
/storage/sdcard0
/mnt/sdcard
/mnt/sdcard0
One of those should work.
Aerowinder said:
Try:
/storage/sdcard
/storage/sdcard0
/mnt/sdcard
/mnt/sdcard0
One of those should work.
Click to expand...
Click to collapse
IIts not giving me any errors, but its not giving me the files either, i tried to adb root to see if that would change and it says adbd cannot run as root in production builds, i tried to adb remount it says opperation not permitted, i tried adb shell then su and adb freezes and wont let me exit shell, it either freezes or just echo's what i type, so if i type exit it returns exit showing the word exit twice but leaves me no choice other than to close cmd and re open and restart adb, not sure what im doing wrong, the device show with adb devices in adb and shell but then says device not found when i try to su in shell lol, fml!

[Non-Gapps-Solution] To broken home, statusbar, QT, etc

EDIT: Skip to the bottom EDIT for the short version..
Preamble: I searched for a fix to this recently and over the past 10 months and haven't seen any real solutions to this. Most people have probably experienced this issue at some time flashing roms, especially those people running gapps-free Android :highfive: such as myself. A band-aid for fixing this is running gapps' SetupWizard and/or CM's CMAccounts, I started adding CMAccounts.apk to /system/app some months ago to fix this. I was never satisfied with this workaround though since it doesn't narrow down the actual problem, and I really like sticking to the AOSP experience, open-source, no Stasi-esque permissions, and without the need to taint my installation just to set it up (setupwizard does a lot more than you might think).
Using some additional skills I didn't have 6 months ago, I finally isolated the issue to the SQL database /data/data/com.android.providers.settings/databases/settings.db, table global, value name device_provisioned. It is set to "0" by default which leads to all these ridiculous problems, and setting it to "1" + a reboot fixes all of these problems for me. Setting it back to "0" + reboot breaks everything again, back to "1" fixes, provision.apk present or removed.. I searched for (sqlite3 dump | grep) lots of other provision and setup value differences... tested this a lot.
!!!BACKUP /data/data/com.android.providers.settings/databases/settings.db before attempting this. Use 'busybox cp -p /data/data/com.android.providers.settings/databases/settings.db Your_Backup_Location' to copy and keep correct permissions on it. I would do a nandroid backup maybe anyway. This should be harmless or very helpful, but it's a su'd command in depths of /data so ya never know.
A couple simple ways to get this set right since you can't reliably grep'n'sed here: Get a nice free sql-frontend app off fdroid or xda -very handy- and go to the settings.db file, 'global' table, and then find or add "device_provisioned" in the name column and "1" in the value column. Root Explorer has this built in I think. The better way though is to pull up the 'adb shell' terminal remotely or use a terminal emulator from the phone with free && adfree Jack Palevich's Terminal Emulator, Spartacus Rex' Terminal IDE (recommended ...for everything!), anything using a jni_exec java execute emulation command. Also Ghisler's Total commander file manager has a built-in command line for convenient executions (or cool shell-script shortcuts you can make --it was actually the first tasker).
# Enter each command line by line (after '>'):
Code:
>su
>$(which sqlite3) /data/data/com.android.providers.settings/databases/settings.db
>update global set value="1" where name="device_provisioned";
>.quit
>exit 0
# One-liner
Code:
su && $(which sqlite3) /data/data/com.android.providers.settings/databases/settings.db 'update global set value="1" where name="device_provisioned";'; exit 0
Then just reboot, enjoy that home softkey that takes you to your launcher home.. your notification bar that displays your notifications. lol such basic s***.
Hope this can help someone else out as much as it did me. You don't have to use gapps/setupwizard to fix it! I also want to make sure there isn't another rogue SQL.db value. (btw if you happen to read this and have a broken back softkey/button, your problem is likely the lib file /system/lib/jni_latinime.so. Thought I'd throw that out there.)
EDIT: Heres an update short version. I added another sqlite value that needs correcting in ROMs without gapps setup bla installed. Run these commands in terminal emulator or via adb. Just copy and paste, they need to be exact.
Check that the values on the right are "1" when you fire off:
Code:
su -c '"$(whence -p sqlite3)" /data/data/com.android.providers.settings/databases/settings.db '\''select * from global where name="device_provisioned"; select * from secure where name="user_setup_complete";'\'
Otherwise or just to be safe, fire off this wicked one liner(Warning: reboots when finished):
Code:
su -c '"$(whence -p sqlite3)" /data/data/com.android.providers.settings/databases/settings.db '\''update global set value="1" where name="device_provisioned"; update secure set value="1" where name="user_setup_complete";'\'' && sync && fsync /data; sleep 3; svc power reboot'
Done, 1-2 steps.
Great write up and worked perfectly. Any more tips tricks advice or links for non-gapps users?
namtombout said:
Great write up and worked perfectly. Any more tips tricks advice or links for non-gapps users?
Click to expand...
Click to collapse
Yeah man, glad it worked. Cheers to your cojones for trying it!
What I usually do for a no gapp solution is:
-grab the libjni_latinime lib from microgapps cause its needed for the aosp keyboard swipe usually
-use "gapps browser" for Google related stuff like gmaps.
-or use rmaps (this and gapps browser need the maps api, so you gotta pull the google maps framework jar or use the "no-gapps project" hack api /system/framework/*google*jar. Make sure to add the corresponding /etc/permissions/*google*xml files too)
-instead of gmail I use the standard email client of k9
-instead of play I use fdroid, aptoide sometimes, nextwap.net, or mobilism forums, or a lucky patcher cracked Google play. (careful with the non-fdroid ones)
Sorry bout this 6 month late reply, Jesus I gotta watch my posts more closely.

Categories

Resources