[Q] executing adb shell scripts on Nexus One - No Laptop Required - Nexus One Q&A, Help & Troubleshooting

Is it possible to do this?
how can i run script commands without having to connect my phone to a laptop computer?
I have root explorer app installed, if someone knows how to do it with that app please give me a simple tutorial.
also, i found this other app on the android market called "ScriptMe" by gilsken.
the app has no reviews, but the description doesnt say how to use it to execute scripts.
in case any of you haven't noticed, yes I am a newbie when it comes rooting phones, any help is appreciated, let me know, thanks.

Do you want to use adb natively on the phone or just general scripts? You can run commands and scripts by installing a terminal from the market, I think Better Terminal Emulator Pro is the best. I think you can run most adb commands from the terminal but I'm not sure if they all work. I mean, push and pull don't seem like they'd work without somewhere to transfer files to, but maybe they push and pull to the sdcard or something. I'm really kinda clueless when it comes to adb because I've only used it to root the phone and use standard terminal tools for everything else.
I think I tried ScriptMe. You have to put the script on the sdcard, select it with the app, tap "execute" then it says "script ran". I'm not sure how that's useful. The only scripting app I've found useful is GScript, but there is another called "Scripter" which stores the scripts so you can select them from a list to execute them. Kinda like a no frills GScript.

Yeah just use the terminal app. It comes loaded on cyanogen and most ROMs out of the box.

Related

Facebook for Android - MIA

I applied the latest CM-update, and upon reboot my Facebook application was not showing, not listed in settings (manage application) or application directory. but if you attempt to install from Market it shows as installed and Open & Uninstall are grayed out. does anyone have an idea how to resolve this ???
Did you try ADBing in, removing the app, then reinstalling?
Mi|enko said:
Did you try ADBing in, removing the app, then reinstalling?
Click to expand...
Click to collapse
Hmmm - ADBing (must research this and find the appropriate instructions) .. I have never attempted something like this, Just a simple flash ROM guy; but I do have a little technical experience..
Is it very complicated ???
Shouldn't be too hard. Download adb (from the tools folder from the Android SDK), first do "adb remount", then use "adb shell" once it's set up, then you should get the rest, at least if you know basic unix commands like cd and rm. I think it's in /system/app somewhere, btw. If you need any help, just ask
The Compiler said:
Shouldn't be too hard. Download adb (from the tools folder from the Android SDK), first do "adb remount", then use "adb shell" once it's set up, then you should get the rest, at least if you know basic unix commands like cd and rm. I think it's in /system/app somewhere, btw. If you need any help, just ask
Click to expand...
Click to collapse
All better now...Thanks you guys...

[Q] Please help me use adb to root JI6 on a mac!!

I have been trying to make this whole adb think work for about twenty hours strait and I still have not gotten very far. I own a mac and no pc and updated to froyo with my buddies pc. I have followed all the directions to a T over and over using terminal on the mac and I can get to the ADB commands and even to where I can see my phone by clicking devices but I must be missing something important. ANY HELP WOULD BE REALLY APPRECIATED I AM ABOUT TO PULL MY FREAKING HAIR OUT!!!
Ok, so if you can see your phone through adb, then you are definitely on the right track. Unfortunately, I'm not really familiar with OS X anymore so I'm not quite sure how to do it. Just sit tight for now until someone who does use a Mac, or has more of a clue then I do can help you out.
But seriously, don't pull your hair out. It won't stay on your head forever ya know...
Edit: oops, just saw this is JI6 (Froyo) not JF6, so I can't help you, but here is a general overview:
from terminal inside Android sdk main directory:
tools/adb devices -> list all devices connected that ADB can see
tools/adb shell -> gets a normal user shell on your phone
tools/adb reboot recovery -> reboots into recovery mode, suitable for update.zip root method
--------------------------------
Place the root update.zip on internal sdcard.
from terminal inside Android sdk directory:
tools/adb reboot recovery
Select the update software option, and you will be done.
laxwillsch said:
I have been trying to make this whole adb think work for about twenty hours strait and I still have not gotten very far. I own a mac and no pc and updated to froyo with my buddies pc. I have followed all the directions to a T over and over using terminal on the mac and I can get to the ADB commands and even to where I can see my phone by clicking devices but I must be missing something important. ANY HELP WOULD BE REALLY APPRECIATED I AM ABOUT TO PULL MY FREAKING HAIR OUT!!!
Click to expand...
Click to collapse
Start simple:
If you open a terminal on the mac, and go to your android SDK tools folder; what happens when you type ADB shell?
Or if you type any of the ADB push commands?
You need to give more detail around what you are seeing for us to help you.
Ok so if I am in terminal and i type in my /android-sdk-mac_x86/tools nothing happens and it just says /android-sdk-mac_x86/tools is a directory. But if I type the same but with /tools/abd it opens the abd command lines, like how to write code. Then when I try to "adb push rageagainstthecage-arm5.bin /data/local/tmp/rageagainstthecage-arm5.bin"
it says "-bash: adb: command not found"
however when I type laxwillsch$ /android-sdk-mac_x86/tools/adb shell
it does give me the drop down $
but when I then try to write the next line of code "chmod 0755 rageagainstthecage-arm5.bin"
it says "chmod: rageagainstthecage-arm5.bin: No such file or directory"
I am stumped I am beginning to think i need to buy a pc as I am very interested in android development and want to learn more, but it seems all the tutorials are run assuming you are on a PC
EDIT** I have downloaded the android SDK started pack, and the 2.2 root pack and they are all in my /android-sdk-mac_x86/tools folder that is directly on my Macintosh HD for simplicity
Do you know how to change directories (cd command)?
The problem is that you are trying to work in one directory, but all your tools are in another.
So change directories to the tools directory:
cd /android-sdk-mac_x86/tools/
now run your adb commands - you may have to type ./adb to tell your mac to look in the current directory for the adb command (that is what ./ means "start here")
Also, try to understand what is happening so you can more easily troubleshoot: chmod is a command to change permissions, and you are running it on the phone. If you can't push the file to the phone, then you can change it's permisssions. I guess you never got rageagainstthecage on the phone, so there is no way to chmod it.
If you can't do this on a mac, a PC is not easier. I use both, and like both, but you need to learn basic commands first - they apply to the mac terminal and the windows cmd prompt.
Getting root means moving in and out of the phone - adb shell - puts you in a terminal on the phone. So you really need to understand cd (change directory); pwd (present working directory - shows you where you are); cp (copy); and know your current path - what the ./ does.
I hope this helps, not trying to sound condescending - maybe practice a linux terminal tutorial would help
Thanks so much, I am at school right now and cant test out all that but you are really helping me understand all this! I will post tonight and let you know how it goes. again thank you
ok so i dont have my usb cable with me but I was playing around with the commands that you suggested and ureka! i finally got to a point where it says "h70-33-65-19:tools laxwillsch$" thats a first! and when i type pwd it shows "/android-sdk-mac_x86/tools" so that means I am working out of the right directory right? and from here I enable usb debugging connect my phone then just copy and paste the codes from the thread correct?
yes, it sounds like you are on the right track. But take it nice and slow when you follow the steps. It is very important that the commands are entered exactly as you see them.
Also, one step tells you to wait for something to run and kick you out of ADB - wait just like it says - takes about 45 seconds but feels like forever.
If you are in the tools directory - just by typing "adb" no quotes will give you whole page of adb commands - if you get a "command not found", then you need to add the ./ and make it ./adb
Hope this helps and again, read the commands step by step a couple times first so you understand what is happening.
In a nutsell, you push the rage file;
change its permissions, run it;
get kicked out of ADB and then open a new ADB shell;
you are now root;
remount the system partition to give you write access when it reboots;
reboot;
push over some files;
change permissions on files you pushed;
reboot;
Some things to know - SU is a command for gaining root access; when you use SU your prompt changes (in adb shell) from $ to #
If you are succesful you should see the SuperUser app listed in your apps.
Done and Done just rooted successfully couldnt have done it without you! thanks so much

[Q] Sideload without root or swc

Hey guys,
I had a few questions about sideloading off market apps, that i couldn't find answers to. Thanks for your consideration.
If i understand correctly, you can only sideload apps on my unrooted samsung captivate by using a connection to a computer, right?
I know about the sideload wonder machine and i have used it successfully.
I know i could download the android sdk, and use the adb push command.
Is there a way to edit the no_market_app value in the settings db file only using my un-rooted phone?
Or can i use terminal emulator or a combination of both to somehow install an off market app?
I was just trying to think of ways to avoid having to conncect to a computer to install an app. I was on the road with a friend, and i had an off market app i wanted to give him, but he also has att(which blocks sideloading of off market apps), so i didn't even try. But wouldn't it be awesome if i could send the apps to his phone through bluetooth or email, then install it on his phone without rooting his phone? Maybe a temporary root of some sort would work? Isn't that how swc works?
Anyways, once i've played enough with my stock phone, i'll beg for more and i'll eventually root, and i'll probably end up playing with the sdk too. Thanks again guys!
To Root or Not To Root... or Perhaps Just A Temp Root...
There are a few quick fix temp root apps floating around. It really depends on you model and build if they work correctly or not.
You could, as you mentioned, push from a cmd promt in adb, install from the cmd promt in adb to the device - or - pull from the device itself using a shell or terminal.
Unfortunately, I currently don't know of a direct way that you would be able to access, let alone edit the system.db file to make a permanent modification without at least being under a temp root.
Peace-

[Q] Terminal Emulator....Help??? Anyone???

I have wiped and restored more times tonight than I can count....HELP!!!! I have a very lean rom. So lean it that it has no file explorer and I don't want to install gapps. All I want to do is install Titanium Backup (the .apk file is on the root of my SD card) with the terminal emulator and I'll be all set. I have had all different error messages, and I'm more confused now then when I started this adventure, 6+ hours ago. Any help would be great.
hockeyfamily737 said:
I have wiped and restored more times tonight than I can count....HELP!!!! I have a very lean rom. So lean it that it has no file explorer and I don't want to install gapps. All I want to do is install Titanium Backup (the .apk file is on the root of my SD card) with the terminal emulator and I'll be all set. I have had all different error messages, and I'm more confused now then when I started this adventure, 6+ hours ago. Any help would be great.
Click to expand...
Click to collapse
Just download a file manager, (es fileexplorer, or root explorer) and install it that way. or if you have adb and all the drivers you need for it.
Put the .apk in the tools folder in the SDK
and go to it in a command prompt and type adb install titaniumbackup.apk..
Or whatever you apk is named.
if you need help, dont quote this, just send me a pm for help =]
(Posting this again for others reference all this is pulled from my previous post which you can find in my signature - "Terminal/adb shell commands")
Adb commands are completely different than terminal commands.
First enter "su" to get substitute user (the # sign)
Then enter "mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system" to make the root r/w
to copy files use "cp" command
to move files use "mv" command
to remove files use "rm" command
to change file/dir permissions use "chmod"
to change directories use "cd" - "cd .." will bring you back one directory - "cd //" brings you back to root
to list files in the dir use "ls"
to read/mod/combine a file use "cat"
to edit a value use "echo"
to see running processes use "top"
to kill a process use "kill -9 PID#HERE"
ex) cp /sdcard/download/myapplication.apk /data/app/myapplication.apk
If you know any linux commands then you should know your way around terminal emulator. If you want i can give you more examples just let me know. Hope this helped
To answer your question OP, just follow my example. Except in your case it'd be something like this:
Code:
su
cp /sdcard/TitaniumBackup.apk /data/app/TitaniumBackup.apk
replace "titaniumbackup.apk" with the actual file name of your apk file.
Sent from my Android using Tapatalk
kyouko said:
(Posting this again for others reference all this is pulled from my previous post which you can find in my signature - "Terminal/adb shell commands")
Adb commands are completely different than terminal commands.
First enter "su" to get substitute user (the # sign)
Then enter "mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system" to make the root r/w
to copy files use "cp" command
to move files use "mv" command
to remove files use "rm" command
to change file/dir permissions use "chmod"
to change directories use "cd" - "cd .." will bring you back one directory - "cd //" brings you back to root
to list files in the dir use "ls"
to read/mod/combine a file use "cat"
to edit a value use "echo"
to see running processes use "top"
to kill a process use "kill -9 PID#HERE"
ex) cp /sdcard/download/myapplication.apk /data/app/myapplication.apk
If you know any linux commands then you should know your way around terminal emulator. If you want i can give you more examples just let me know. Hope this helped
To answer your question OP, just follow my example. Except in your case it'd be something like this:
Code:
su
cp /sdcard/TitaniumBackup.apk /data/app/TitaniumBackup.apk
replace "titaniumbackup.apk" with the actual file name of your apk file.
Sent from my Android using Tapatalk
Click to expand...
Click to collapse
i know theyre different,i was getting a point across, in which if he cant get it too work, try adb. Even though errors with TE usually means youre not entering something correct
davidevan said:
i know theyre different,i was getting a point across, in which if he cant get it too work, try adb. Even though errors with TE usually means youre not entering something correct
Click to expand...
Click to collapse
Yea they are. Besides, personally I'd do it the way you mentioned; either first using a filemanager (easiest imo) or via adb install
Only reason I replied was in case there was a specific reason he'd only want to use terminal emulator and not adb or a FileMan
Edit: Oh I see what I think you're referring to, the line:
Adb commands are completely different than terminal commands.
Click to expand...
Click to collapse
That was just directly copied from a post I made before something about wanting to "adb push" with TE, it had nothing to do with your response
Sent from my Android using Tapatalk
Thank you everyone. I need to use Terminal Emulator, because I'm not allowed to install the ADB drivers on my work computer, the ROM I want to use did not have a file manager packed in it and I don't want to install gapps to download one from the market. I simply want to install Titanium, so I can add a file manager and a couple of other select apps so as not to clutter up the system. As soon as I flash back to that rom, I'll try it the above mentioned way.
hockeyfamily737 said:
Thank you everyone. I need to use Terminal Emulator, because I'm not allowed to install the ADB drivers on my work computer, the ROM I want to use did not have a file manager packed in it and I don't want to install gapps to download one from the market. I simply want to install Titanium, so I can add a file manager and a couple of other select apps so as not to clutter up the system. As soon as I flash back to that rom, I'll try it the above mentioned way.
Click to expand...
Click to collapse
Ah thats sucks bro, it come in handy now and then, Listen to this guy up here since he knows more about TE than I. Also a simple google "terminal emulator" command and it might add on to your comprehension.
And judt to get this outta of the way, in TE if you do type su <enter> you get #? if you dont #,you get acces denied; denied meaning youre not rooted. Meaning it cant find an su in the bin or xbin, rendering TE pointless. So make sure youre root
hockeyfamily737 said:
Thank you everyone. I need to use Terminal Emulator, because I'm not allowed to install the ADB drivers on my work computer, the ROM I want to use did not have a file manager packed in it and I don't want to install gapps to download one from the market. I simply want to install Titanium, so I can add a file manager and a couple of other select apps so as not to clutter up the system. As soon as I flash back to that rom, I'll try it the above mentioned way.
Click to expand...
Click to collapse
btw click my thanks meter ;]
its the ony thing i have left lmao! :'(
davidevan said:
Ah thats sucks bro, it come in handy now and then, Listen to this guy up here since he knows more about TE than I. Also a simple google "terminal emulator" command and it might add on to your comprehension.
And judt to get this outta of the way, in TE if you do type su <enter> you get #? if you dont #,you get acces denied; denied meaning youre not rooted. Meaning it cant find an su in the bin or xbin, rendering TE pointless. So make sure youre root
Click to expand...
Click to collapse
and how is your computer not compatible with SDK. You dont have Windows, linux or Macc?
davidevan said:
and how is your computer not compatible with SDK. You dont have Windows, linux or Macc?
Click to expand...
Click to collapse
It's not an issue of compatibilty..... It's an issue of the IT people at work having our computers locked up so we can't install / uninstall anything from them. All I can do is transfer files from the pc to my sd. I don't have authorization to install the necessary drivers for my phone.
hockeyfamily737 said:
It's not an issue of compatibilty..... It's an issue of the IT people at work having our computers locked up so we can't install / uninstall anything from them. All I can do is transfer files from the pc to my sd. I don't have authorization to install the necessary drivers for my phone.
Click to expand...
Click to collapse
If you can transfer files from a computer to a device, then you should be able to take files from a USB drive and put them on the C drive of your computer.
waffle_ said:
If you can transfer files from a computer to a device, then you should be able to take files from a USB drive and put them on the C drive of your computer.
Click to expand...
Click to collapse
To clarify.... Yes I can access my sd card from my computer. Yes I can transfer files between my sd card and my hard drive. However, when I try to install the ADB drivers to access the rom in my phone I get a little message that I'm not authorized to add / remove hardware or software from the computer....to please contact my IT administrator. Maybe it's something I'm doing wrong, maybe it's not. If I can learn to use this emulator though, it doesn't really matter. I have ADB on my computer at home if I really need it, I'm just not inclined to turn the computer at home on very often. Thanks again to everyone for the help.
"
hockeyfamily737 said:
To clarify.... Yes I can access my sd card from my computer. Yes I can transfer files between my sd card and my hard drive. However, when I try to install the ADB drivers to access the rom in my phone I get a little message that I'm not authorized to add / remove hardware or software from the computer....to please contact my IT administrator. Maybe it's something I'm doing wrong, maybe it's not. If I can learn to use this emulator though, it doesn't really matter. I have ADB on my computer at home if I really need it, I'm just not inclined to turn the computer at home on very often. Thanks again to everyone for the help.
Click to expand...
Click to collapse
Search the dev thread for my guide on how to install adb. Might do the job for your work computer. Or just hit my avatar and find the thread that way. If you do try it let me know if it works.
#Root/Hack_Mod-Always®
laie1472 said:
"
Search the dev thread for my guide on how to install adb. Might do the job for your work computer. Or just hit my avatar and find the thread that way. If you do try it let me know if it works.
#Root/Hack_Mod-Always®
Click to expand...
Click to collapse
Sitll no good installing ADB at work, but I did get a good ADB workout at home this weekend rooting my son's Optimus......Wholy crap!!! Revert to old software, lose the lcd display, root with rage against the cage, push recovery to the phone, revert back to current version of software, lose root, and then re-root on current software with recovery already installed, what a process that was!!!! BTW.... Terminal Emulator commands worked perfect. Mistake I was making was trying to "push" from my SD card instead of "copy".

[Q] Trying to backup my EFS folder with SGS Tools and it fails

Trying to be charitable and cautious, I'm trying to back up my EFS folder before I go messing around and it is consistently failing. I'm using:
SGS Tools Vz 0.5.7
Busy Box Vz1.17.2
On my previous captivate this works just fine. Now I get
"could not create backup folder /sdcard/SGSToolbox/backup (date string)" and then the bluebox saying creating backup. This never goes away and to clear I have to reboot.
Any helpful hints?
I tried to download the latest and greatest SGS Tools but Google knows I have it installed and won't let me get the newest one. Haven't figure out how to get around that unless I just have to un-install my current one.
Rooted 2.2, KB2, running existz KB1 kernel.
Knowing there are no successful backups... just successful restores.
If you're willing to use your computer and can get the Android SDK and ADB going, just get into a command prompt in the ADB directory and type "adb pull /efs". That will back it up to your computer.
Or you could open a file explorer and copy the directory from there to your sd card
You could use an app called nitrality
Sent from my SGH-I897 using XDA App
Try to update your su binary, the simpliest way is use Root Explorer to backup whatever u want
Well just to be daring, I tried to install the ADB tools. Had to install the Java development software first. After I installed what I thought was the ADB suite, I can't seem to find the place to type in commands, dumb as that sounds. I may not have gotten the right package. Going to tinker with it though.
My SU is up to date.
I can see the folder with Super Manager so I guess I'll just copy with that. Interesting though I can't see anything in the /efs directory. Probably just something else I don't understand.
Still curious though as to why SGS Tools is failing... part of my nature.
Thanks to all that replied.
Make a note of where adb is installed (e.g. c:\users\person\Android-sdk-windows\platform-tools). Then hit the windows key and R, and type cmd. Once in the prompt, type CD (directory from before, no parentheses) and hit enter. From there, type your adb commands.
Ahhhh.... I get it. Was expecting something a bit more elegant. Gotta love DOS commands.
Well..there are a couple more elegant ways to do it.
Open up a new note in NotePad, just type:
Cmd
Exit
And save, but instead of a .txt file extension save it as a .bat, now drop that into your adb directoty, then just double click on that to open a prompt in that directory, so you don't have to do the cd command every time.
Or..the most elegant way is to add adb to your environmental variables so you can enter adb commands from anywhere
That's a good solution. I've got a set of files put into my C:\Users\(my username) folder called "adb", "adbr" (adb reboot), "adbrd" (adb reboot download), and "adbrr" (adb reboot recovery).
Each of these is a .bat file with a version of this text in it:
@ echo off
cd "C:\Users\(me)\Other\tools\android-sdk-windows\platform-tools"
adb reboot
That way, all I have to do is hit Win-R and type one of those file names and it does that command for me. Or, I can type cmd, then adb, and automatically be where adb is installed without cd'ing through a long file list.
My suggestion is Root Explorer. I was able to backup the EFS directory without problems also create a .tar file.
I used root explorer to do my backups, another option is the explorer inside the rom tollbox aplication its also very good
Now I have another adb question...
First off, now I'm just trying to learn and get better. I've built my bat files and I can get adb working. Thanks to those that helped with that. When I tried to pull the /efs folder it said there was no device recognized. I was in "mass storage" mode at the time.
Whenever I've seen people talk about using adb, I don't recall anything being said about if it should be in Download, debug or what. One of those assumed knowledge things.
So what do I have to do to the phone to let adb recognize it?
gnawing on the bone....
I'm also thinking of pulling a logcat or something when SGS tools fails... just to see. That's my next step.
Enable usb debugging in settings> applications> development
SGS Toolbox doesn't work with efs backups. Are there easier ways to do the backup?
Adb or root explorer.
I did both... just to say I did it and finally got adb working.

Categories

Resources