Newbie Question about simple script - General Questions and Answers

Hi guys, I was hoping someone could help me write a simple script that I can execute in terminal. What I would like the script to do is copy all the files from one directory to another directory on my sdcard (to cut down what i need to type in terminal each time).
For example
cp /sdcard/dir1/*.* /sdcard/dir2
I've tried to just put that command line in a unix txt file from Crimson Editor, saved it as copy.sh. I did
chmod +x copy.sh
Then tried to type in terminal
sh /sdcard/copy.sh
I didnt get any errors, but I don't think it worked. Any help or suggestions are appreciated.
My phone is a N1 with the latest Cyanogen build. Thanks in advance.
** EDIT **
I fixed the issue by using a program called GScript from the market... I made a new script in the GScript window and can now just open gscript and click the script to run it instead of typing the terminal commands. Don't know if this will help anybody else with similar newbie scripting issues, but it worked for what I wanted to get done. I'm editing post instead of deleting because I don't see the delete post button.
** EDIT **

Related

adb install in terminal emulator?

Some of you are familiar with the adb install command.
Is there an equivalent of it in the terminal emulator?
Hi,
Adb is used from the computer and terminal emulator is used from the phone.
What are you trying to do?
I'm trying to install an app without using astro.
your best choise would be
cd to the location of the apk file and use
adb install appname.apk
or adb install C:\folder\appname.apk
think thats the correct way im not sure how you can install it in the terminal i knwowho to remove it.. but not install :/
Install .apk via Terminal EMulator
1) Place the .apk on the root of your SD card (for simplicity)
2) Type "su"
3) cd into the destination of your .apk (in this case it will be cd /sdcard)
4) Use "install "name of .apk" /"destination"/"name of .apk"
su
cd /sdcard
install com.makemobile.coursepro.apk /system/app/com.makemobile.coursepro.apk
further example:
install "space" com.makemobile.coursepro.apk "space" /system/app/com.makemobile.coursepro.apk
This will install the app on your phone using the Terminal Emulator. The destination location can change as well.
Additional help: http://www.busybox.net/downloads/BusyBox.html
On the flip side, could you uninstall from the ext2 partition this way?
install on/from ext2
not sure...I'll looks into this. I had my apps and data on my sd however, it seemed a little buggy and inconsistant. It may have been due to using original G1 1gb class 2 card.
-let me know if you find out first.
a1t said:
1) Place the .apk on the root of your SD card (for simplicity)
2) Type "su"
3) cd into the destination of your .apk (in this case it will be cd /sdcard)
4) Use "install "name of .apk" /"destination"/"name of .apk"
su
cd /sdcard
install com.makemobile.coursepro.apk /system/app/com.makemobile.coursepro.apk
further example:
install "space" com.makemobile.coursepro.apk "space" /system/app/com.makemobile.coursepro.apk
This will install the app on your phone using the Terminal Emulator. The destination location can change as well.
Additional help: http://www.busybox.net/downloads/BusyBox.html
Click to expand...
Click to collapse
nevermind..........used astro file manager and it worked fine
help
what's 'cd' ? the emulator is already installed on the phone ?
i'm trying to install an app but i don't understand the adb method. someone can help me ?
thanks
MikeMadden said:
what's 'cd' ? the emulator is already installed on the phone ?
i'm trying to install an app but i don't understand the adb method. someone can help me ?
thanks
Click to expand...
Click to collapse
cd is a command, meaning "change directory". Which is used to move your location on the system.
MikeMadden said:
what's 'cd' ? the emulator is already installed on the phone ?
Click to expand...
Click to collapse
cd is a *nix command , it is short for 'change directory' and it... changes directory
MikeMadden said:
i'm trying to install an app but i don't understand the adb method. someone can help me ?
thanks
Click to expand...
Click to collapse
it depends on what the app is
your best bet would be to get an app called 'Astro file manager' from the market
Its quite easy, so I won't go into further detail
Which to be honest is a fair trade
APrinceAmongMen said:
Some of you are familiar with the adb install command.
Is there an equivalent of it in the terminal emulator?
Click to expand...
Click to collapse
Some people have mentioned the `install' command from BusyBox, but this won't quite do what you probably want. To invoke the full Android package installation experience--the complete equivalent of `adb install'--you're looking for `pm install'. It takes the same arguments that `adb install' does, checks signatures, creates the appropriate user accounts, etc. so the package is installed the Android way. You can also use `pm uninstall' to remove a package (and as with `adb install', the "-k" option keeps its data around).
The `am' and `pm' commands are both underdocumented, but can be terribly useful. `am' can issue arbitrary Intents, including some Extra values. `pm' has other features not mentioned here, but which are shown in the help text.
olearyp said:
Some people have mentioned the `install' command from BusyBox, but this won't quite do what you probably want. To invoke the full Android package installation experience--the complete equivalent of `adb install'--you're looking for `pm install'. It takes the same arguments that `adb install' does, checks signatures, creates the appropriate user accounts, etc. so the package is installed the Android way. You can also use `pm uninstall' to remove a package (and as with `adb install', the "-k" option keeps its data around).
The `am' and `pm' commands are both underdocumented, but can be terribly useful. `am' can issue arbitrary Intents, including some Extra values. `pm' has other features not mentioned here, but which are shown in the help text.
Click to expand...
Click to collapse
'pm install' often fails with [INSTALL_FAILED_INSUFFICIENT_STORAGE]
which used to frustrate me no end ..
simple shell script
Code:
am start -a android.intent.action.VIEW -t application/vnd.android.package-archive -d file://$1
just pass the full path e.g
sh /sdcard/installapk.sh /sdcard/theapp.apk
and it pops up the Android Package installer
Firerat said:
'pm install' often fails with [INSTALL_FAILED_INSUFFICIENT_STORAGE]
which used to frustrate me no end ..
Click to expand...
Click to collapse
Interesting. I wonder if that's related to A2SD or a particular implementation, and pm getting confused as a result? Still, I like the idea of sending the VIEW intent to bring up the package installer. Good snippet.
I just cp the files to /system/sd/app/
from Windows Command prompt, and after switching to the folder containing the .apk file, type:
adb install filename.apk
if it is a reinstall:
adb install -r filename.apk
you could also push the file to the app folder. I use this method to push system apk:
adb remount <<<< you have to remount since you're going to mess with a sys folder
adb push filename.apk /system/app
seriously useful thread... especially after for some weird reason certain apps fail to install using the default Android installer. *cough* Radiant *cough*
Thanks for the help guys. Btw install command doesn't work. To clear things out for some clueless person like I am :
1. Open Terminal Emulator
2. Type -
su
cd /dir
pm install appname.apk
3. Done!
Example -
su
cd /sdcard
pm install AstroFileManager.apk
Hope that can help!
rajasyaitan said:
Thanks for the help guys. Btw install command doesn't work. To clear things out for some clueless person like I am :
1. Open Terminal Emulator
2. Type -
su
cd /dir
pm install appname.apk
3. Done!
Hope that can help!
Click to expand...
Click to collapse
This is very helpful, thanks!
rajasyaitan said:
Thanks for the help guys. Btw install command doesn't work. To clear things out for some clueless person like I am :
1. Open Terminal Emulator
2. Type -
su
cd /dir
pm install appname.apk
3. Done!
Example -
su
cd /sdcard
pm install AstroFileManager.apk
Hope that can help!
Click to expand...
Click to collapse
Thanks big time. Installed perfectly although apk won't open...just got to find one that will.

[HOW-TO]Set up Android SDK/ADB/Fastboot on Ubuntu Linux

When I first attempted to install the SDK, I found tutorials that only had bits and pieces about the whole procedure. A lot of Google searches and hours of eye strain. I wanted to write a solid tutorial, but instead of publishing it in a personal blog, I chose to publish it here on xda-developers. This is the definite forum to come to if you are interested in Android/G1/HTC Dream development or costumization. I wrote this to make the enlarge the knowledge of this community.
!! THIS TUTORIAL IS FOR THE LATEST UBUNTU RELEASE: JAUNTY JACKALOPE 9.04 !!
!!START -------------------------------------- Optional Preparation --------------------------------------
This applies if you -
Are interested in installing Ubuntu for the first time.
Are/will be reinstalling Ubuntu from scratch.
Want to keep your SDK installation easy to reach.
Want to keep things nice and clean.
And your machine -
Has a second hard drive.
Has free space for another small partition.
This procedure will make things easier during installation of the SDK and in the long run. Hopefully you've read about partitions. If you are dualbooting, please read this first to get an idea of what you're doing.
While installing Ubuntu and on the Prepare Disk Space screen (partition editor), select "Specify partitions manually (Advanced)"
On the Create Partition dialog, select the following options:
Type for the new partition: Primaryor Logical if you're dualbooting and know what you are doing.​
New partition size in megabytes: 5120MB (5GB) might work. BUT:
ccyrowski said:
It should be noted that if you ever plan on compiling kernels and/or cupcake ROM's you will NEED ubuntu8.04. You'll also need at least 10GB.
Click to expand...
Click to collapse
Location for the new partition: Beginning
Use as: Ext4 or Ext3Filesystem doesn't matter. (?)​
Mount point: /AndroidSDKEnter this manually​
Complete Ubuntu installation as usual.
-------------------------------------- Optional Preparation -------------------------------------- END!!​
You will now install the SDK.​
!!START -------------------------------------- Installing Android SDK --------------------------------------
Installing the SDK is the easiest of all.
Download the SDK.169.9 MB [http://developer.android.com/sdk/download.html?v=android-sdk-linux_x86-1.5_r3.zip]​
Right-click and select Extract Here.
Move the contents of the android-sdk-linux_x86-1.5_r3 directory to your desired location.If you followed Optional Installation, move the contents to your /AndroidSDK directory in the root of your filesystem.​
Close directory window.
-------------------------------------- Installing Android SDK -------------------------------------- END!!​
You will now set up your bashrc file and UDEV to recognize your HTC Device.​
!!START -------------------------------------- ADB + FASTBOOT --------------------------------------
The Android Debug Bridge (adb) is one of the tools that will help you the most when you run into flashing problems or running shell commands directly from your machine. UDEV will not recognize your G1 out of the box, but we will configure it with some rules so it can connect.
We will work with /AndroidSDK as the location of your sdk. If this is not your setup, I think you're smart enough to figure it out.
Editing .bashrc file to use tools from /AndroidSDK/tools/ directory -
Go to your home folder.Example: /home/wddglr/​
Press Control + H to view hidden files.
Look for your .bashrc file and double click to open it with gedit.
Add the following lines to the top of the file:
Code:
#AndroidDev PATH
export PATH=${PATH}:/AndroidSDK/tools
IMPORTANT NOTE
savethechicken said:
This is the way that I have my .bashrc file setup. For those having problems with it not recognizing the adb as a command try this...
Code:
export PATH=$PATH:/AndroidSDK/tools
I removed the {} around ${PATH} and it is working if I had them on it would say that it didn't recognize the command. Removed them and all works well.
Click to expand...
Click to collapse
Setting up UDEV to recognize HTC Device -
Type the following into a terminal (Applications > Accessories > Terminal):
Code:
gksudo gedit /etc/udev/rules.d/51-android.rules
Now add the following line to the blank file:
Code:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
Click save and close.
To restart udev, open up a terminal and enter:
Code:
sudo /etc/init.d/udev restart
Setting up fastboot -
Download this fastboot binary from http://android-dls.com.130.4 KB [http://android-dls.com/files/linux/fastboot]​
Once downloaded to your desktop, right click and select Properties.
Navigate to the Permissions tab and configure the following option:Execute: [√] Allow executing file as program​
Click Close.
Move the fastboot bianary to your /AndroidSDK/tools/ directory.
Reboot.
-------------------------------------- ADB + FASTBOOT -------------------------------------- END!!​Now you can use adb and fastboot directly from any terminal. If you chose to do the Optional Preparation, you can now save your Eclipse Workspace and your downloaded/custom ROMs/Themes in this new /AndroidSDK directory keeping things easier to reach and safe from evil disk errors or other mishaps!!! :O​If you are having problems, send me a PM. I will be happy to help.
*applaudes* awesome. Should be added to helpful threads.
very nice! perhaps add a "(How-To)" prefix to thread??
Everything was going great in setting this up until I got to this part "gedit /etc/udev/rules.d/51-android.rules"
I cannot find "51-android.rules" inside of "rules.d"
Any thoughts>?
nicholasbithell said:
Everything was going great in setting this up until I got to this part "gedit /etc/udev/rules.d/51-android.rules"
I cannot find "51-android.rules" inside of "rules.d"
Any thoughts>?
Click to expand...
Click to collapse
it does not exist, you will make it.
do the command as stated above.
Code:
gksu gedit /etc/udev/rules.d/51-android.rules
Damn you beat me to it!
I was just thinking earlier about doing this same "How-To" guide, I was surprise to see it posted just now.
Anyways, great job!
Can someone sticky this thread. Now I have ADB & fastboot on my Win7, Ubuntu, and OS X Partition. Thank you wddglr.
bravo...linux rocks even better now!...
Awesome tutorial for setting this up. Have been using adb/sdk on ubuntu since oct. but this would have saved me some headaches back in the first couple of weeks.
The onlything that is not clear and/or confuses me is
Setting up the udev to recognize the device.
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
Have never used this (will now to see if it will do anything) and the only problem i have is that sometimes i have to kill-server to get it to connect correctly but i have seen this happen to almost everyone on many forums since the 9.04 came out. And even after putting this file on the computer i have had the problem.
savethechicken said:
Awesome tutorial for setting this up. Have been using adb/sdk on ubuntu since oct. but this would have saved me some headaches back in the first couple of weeks.
The onlything that is not clear and/or confuses me is
Setting up the udev to recognize the device.
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
Have never used this (will now to see if it will do anything) and the only problem i have is that sometimes i have to kill-server to get it to connect correctly but i have seen this happen to almost everyone on many forums since the 9.04 came out. And even after putting this file on the computer i have had the problem.
Click to expand...
Click to collapse
It happens to me also from time to time. especially when i reboot and want to go into adb while the device is rebooting. although that file, 51-adndroid.rules, is what helped me get adb to recognize the device. the guide on developer.android.com talked about 50-android.rules but after a few deep searches i found this: http://groups.google.com/group/android-developers/browse_thread/thread/1d3488c601243686
Okay A few questions for you....
First I fixed the whole "couldnt find the (51-android.rules) file now I am having issues with executing ADB!
When in terminal this is what I get...
"[email protected]:/home/nick# /AndroidSDK/tools/adb
bash: /AndroidSDK/tools/adb: cannot execute binary file
[email protected]:/home/nick#"
and I also noticed something different from when I start terminal the first lines now state
"bash: : command not found
[email protected]:~$"
I dont remember the first line ever being there, but I could be mistaken!
Any help would be greatly appreciated!
Edit: You state creating "Mount point: /AndroidSDK" During Installation, and what I did was Just place my AndroidSDK at root so it is at "/AndroidSDK". I dont know if this makes a difference.
I am actually running ubuntu 8.10 ha! I just tried to update But I keep getting errors! is there anything I can change to get this to work on ubuntu 8.10?
nicholasbithell said:
First I fixed the whole "couldnt find the (51-android.rules) file now I am having issues with executing ADB!
When in terminal this is what I get...
"[email protected]:/home/nick# /AndroidSDK/tools/adb
bash: /AndroidSDK/tools/adb: cannot execute binary file
[email protected]:/home/nick#"
and I also noticed something different from when I start terminal the first lines now state
"bash: : command not found
[email protected]:~$"
Edit: You state creating "Mount point: /AndroidSDK" During Installation, and what I did was Just place my AndroidSDK at root so it is at "/AndroidSDK". I dont know if this makes a difference.
I am actually running ubuntu 8.10 ha! I just tried to update But I keep getting errors! is there anything I can change to get this to work on ubuntu 8.10?
Click to expand...
Click to collapse
okay, a few things -
seems like your .bashrc file isn't setup right (?)
make sure that the two lines you inserted into it are on separate line
Code:
#AndroidDev PATH
export PATH=${PATH}:/AndroidSDK/tools
because maybe export PATH=${PATH}:/AndroidSDK/tools got commented on accident if you copy pasted.
When copying your SDK to the root of your filesystem, did you copy it as your own user or as root? you can use:
Code:
gksu nautilus
to copy system files with complete root privileges.
What exactly are you trying to update, Ubuntu or ... ? There shouldn't be a difference to get this working on 8.10, the only thing that seemed to change was the 51-android.rules file. Maybe this can help -
renaming it to 50-android.rules with
Code:
gksu nautilus
and deleting any backups (use CTRL+H to view hidden files).
restarting udev using:
Code:
sudo /etc/init.d/udev restart
Remember this is for 9.04, not 8.10. I hope this helps.
wddglr said:
okay, a few things -
seems like your .bashrc file isn't setup right (?)
make sure that the two lines you inserted into it are on separate line
Code:
#AndroidDev PATH
export PATH=${PATH}:/AndroidSDK/tools
because maybe export PATH=${PATH}:/AndroidSDK/tools got commented on accident if you copy pasted.
When copying your SDK to the root of your filesystem, did you copy it as your own user or as root? you can use:
Code:
gksu nautilus
to copy system files with complete root privileges.
What exactly are you trying to update, Ubuntu or ... ? There shouldn't be a difference to get this working on 8.10, the only thing that seemed to change was the 51-android.rules file. Maybe this can help -
renaming it to 50-android.rules with
Code:
gksu nautilus
and deleting any backups (use CTRL+H to view hidden files).
restarting udev using:
Code:
sudo /etc/init.d/udev restart
Remember this is for 8.10, not 9.04. I hope this helps.
Click to expand...
Click to collapse
Okay this is how I moved my "AndroidSDK" Folder to root....
[email protected]:~$ su
Password:
[email protected]:/home/nick# mv /home/nick/Desktop/AndroidSDK /
[email protected]:/home/nick#"
And I went to the bashrc file and it is entered in there correctly.
This is still what I get even after restarting Udev...
" bash: : command not found
[email protected]:~$ adb
bash: /AndroidSDK/tools/adb: cannot execute binary file
[email protected]:~$ su
Password:
[email protected]:/home/nick# adb
bash: adb: command not found"
Edit: This is what my .bashrc file looks like, well the top part of it anyways....
#AndroidDev PATH
export PATH=${PATH}:/AndroidSDK/tools
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
Okay your .bashrc is setup right and it's recognizing adb and its directory.
I would say it's something to do with permissions. since you moved it under su, you are not the owner so i would say that you'd have to change the permissions of /AndroidSDK
you can do that with -
Code:
gksu nautilus
Navigate to /
Right click on /AndroidSDK and select Properties
Click on Permissions tab
Select your user account as the owner
hopefully now it will function correctly
wddglr said:
Okay your .bashrc is setup right and it's recognizing adb and its directory.
I would say it's something to do with permissions. since you moved it under su, you are not the owner so i would say that you'd have to change the permissions of /AndroidSDK
you can do that with -
Code:
gksu nautilus
Navigate to /
Right click on /AndroidSDK and select Properties
Click on Permissions tab
Select your user account as the owner
hopefully now it will function correctly
Click to expand...
Click to collapse
I dont understand what this line does...
"gksu nautilus"
when i type it in it asks me for my administrative password and then after i put it in it hangs for a sec and then back to...
bash: : command not found
[email protected]:~$ gksu nautilus
[email protected]:~$
nautilus is the file browser, while using gksu nautilus you can use the file browser under root privileges
wddglr said:
nautilus is the file browser, while using gksu nautilus you can use the file browser under root privileges
Click to expand...
Click to collapse
I dont have Nautilus as a file browser I have Thunar I believe.
Then gksu thunar
wddglr said:
nautilus is the file browser, while using gksu nautilus you can use the file browser under root privileges
Click to expand...
Click to collapse
For permissions it says that I am the owner and the group (I=Nick) for Others it says Read and Write, Access says Read and write. So it seems it has all the right permissions. Any other Ideas?
Partitioning HD
First off, thank you for this thread, it's most excellent. I have a question that is slightly off topic, but not so much. I have Ubuntu 9.04 installed on my recovery partition. This partition is only 10 GB, while I have Vista on my main. I have almost 100 GB free on my main drive, and what I want to know is, if I resized my partitions to give more space to Ubuntu, how would it affect my comp? (if at all). And which OS should I be on while resizing, Ubuntu or Vista?

removing apps2sd - questions

I've followed this guide from loccy, except for the last part where he uses vi editor in order to edit the apps2sd script...
http://forum.xda-developers.com/showpost.php?p=4353332&postcount=68
also when i install a fresh ROM, the app-private directory does not exist to begin with since i don't have any purchased .apk's installed in the /system/sd folder, so i basically just skipped all the steps for modifying the app-private folder... i did however create the proper folders in the /data folder for app-private and followed the corresponding commands... when i try to cp the file information from the SD to /data/app-private folder, i get a no such file or directory exists error, which i'm assuming happens because i have no private apps... i don't know if this is causing my problem, if so please let me know...
since I could never get VI editor to work properly in a windows command prompt, i adb pull the a2sd file from /system/bin and edited the file using notepad++, and adb push the file back... i verified that the file was pushed correctly and edited correctly by pulling it back again and verifying the changes were correctly made... i'm assuming not being able to use VI editor is probably whats causing my problems as i'm running windows 7 RTM, and notepad++ is possibly changing the file structure of the a2sd when i edit it on my machine...
i assumed busybox was installed cause if i run an invalid vi command, i get busybox reference information from the shell returned to me... i even went as far as installing my own instance of busybox to see if that would fix my VI editor problem, but that didn't help either... when i type #VI a2sd to edit the a2sd script file, i only get a partial amount of the actual script, some of it which comes out garbled, and i can't do anything, not press esc, not type an exit/reboot command, press j or k to move up and down... i can however type :q to exit the VI editor instance...
after pushing the a2sd script file after editing it with notepad++, my phone gets stuck on the first splash screen... unforutunately, i don't have a log i can provide to you guys, cause when i run adb logcat when the phone is booting, it just stays at waiting for device...
any help would be appreciated... if possible i would like to get this sorted out so maybe a script can be written for those who want to disable apps2sd like me...
Would be great if someone could upload a modified a2sd file with app2sd disabled, then we only put this file in update.zip file, sing it, and then make a fresh flash... Thats correct? or we need to change the update.zip structure?
ATM i am not at home then i can't try to use VI, but i sure that someone can upload the a2sd file modified
yah... after i finished writing my original post, i tried using VI again and noticed in the header of the a2sd script on jacherorom 1.4 that the a2sd script was written by cyanogen...
so, it was just a matter of taking the a2sd script from cyanogens 4.0.1 release, extracting his update.zip, taking the a2sd file from system/bin, and adb push the file to replace the existing file from your recovery image...
it worked like a charm... i'm currently running 230mb free on a fresh install... already i've noticed that its slightly faster than running off your ext for apps2sd on a class 6, but only time will telll... i'm gonna run this ROM through its courses and post my results... hopefully it doesn't slow down as much as using apps2sd, i'll post my results in a day or two
you can try just removing your ext2/3 partition. if the ROM does not detect a ext2/3 partition, it wont move hte apps to that partition thus no apps2sd.
motivecc said:
yah... after i finished writing my original post, i tried using VI again and noticed in the header of the a2sd script on jacherorom 1.4 that the a2sd script was written by cyanogen...
so, it was just a matter of taking the a2sd script from cyanogens 4.0.1 release, extracting his update.zip, taking the a2sd file from system/bin, and adb push the file to replace the existing file from your recovery image...
it worked like a charm... i'm currently running 230mb free on a fresh install... already i've noticed that its slightly faster than running off your ext for apps2sd on a class 6, but only time will telll... i'm gonna run this ROM through its courses and post my results... hopefully it doesn't slow down as much as using apps2sd, i'll post my results in a day or two
Click to expand...
Click to collapse
But you modified a2sd from cyanogens ROM or what? You put the modified one in the update.zip then fresh flash?
fridlack said:
But you modified a2sd from cyanogens ROM or what? You put the modified one in the update.zip then fresh flash?
Click to expand...
Click to collapse
nope, the a2sd script from cyanogen's 4.0.1 ROM automatically disables apps2sd if your have a fat32 only memory card, thus taking care of having to edit the script myself...
all i did was go into my recovery image, and do the following:
Code:
# go to the tools directory of your android sdk and run a push command
# the format of a push command goes as follows
# adb push <local directory of file> <directory of file on device>
# in my case i would have to type
adb push c:\androidsdk\androidsdk\a2sd /system/bin/a2sd
and thats it
by using the adb push command, i don't have to modify the update.zip file and go through the process of having to resign it... i find it easier to run this command to just replace the one file... i recommend doing this after a fresh install only of course...
motivecc said:
nope, the a2sd script from cyanogen's 4.0.1 ROM automatically disables apps2sd if your have a fat32 only memory card, thus taking care of having to edit the script myself...
all i did was go into my recovery image, and do the following:
Code:
# go to the tools directory of your android sdk and run a push command
# the format of a push command goes as follows
# adb push <local directory of file> <directory of file on device>
# in my case i would have to type
adb push c:\androidsdk\androidsdk\a2sd /system/bin/a2sd
and thats it
Click to expand...
Click to collapse
Thanks for the info, will give it a try
be careful what ROM you use it with... i would only suggest using it with any ROM that utilizes cyanogen's method of a2sd, as using a different one might brick or crash the phone... you can check by
Code:
adb pull /system/bin/ c:\<folder name here>
that will pull all your files to folder of your choice, and you can read the a2sd file by opening it with wordpad and seeing who made it... most likely its cyanogen anyway, but it doesn't hurt to check

Where are located the launched process at boot ?

Hi, i just rooted my hero yesterday.
I have some small capacities on linux, and i wnated to know if there is ( and where it is ) an equivalent to the /etc/init.d and different rc.x.d config. file for the process launched at boot. I wouldl ike to edit or delete some programs launching at startup which i don't need really to launch at startup Is it possible and simple ?
Ciao
Fred
Edit : stupid question... there is no vi on the system so no way to edit the file ..
I am even new than you to android rooting (just rooted my Sprint Hero 2.1 today!).
I loaded Fresh ROM 2.1.2 on my Hero today and there's an app called "ES File Explorer". It allows me to browse the unix-like filesystem, right to the directory you mentioned above.
I can click on the files and open them as Text, Executable, etc. Opening as Text even gives me two different text editors.
Unfortuantly, the file(s) you talk about are for readonly. You have to be logged in as a Superuser to edit them (as I found out today). The easiest way I found is to do it via a command-line prompt.
When you "root" your android phone, that means you are able to login remotely as another user. Such as the "superuser" account from the Android SDK. On Windows, after you have rooted your phone, you can do:
Code:
C:\android\tools\> adb remount
C:\android\tools\> adb shell
#
When you see that "#" prompt, you are now logged into your phone running the default shell (not sure which shell it is). So, now you can copy/open that file:
Code:
# cd \
# type init.rc | more
Of course u can't do squat from here. So, you have two options:
1) Change the permissions to allow you to modify it from the Android device itself (possible security issue if u download a broken app that wants to modify your phone).
Code:
# chmod 755 init.rc
Now you are able to modify the file locally, right on your device. No PC needed any longer. But again, it's a possible seucrity issue.
2) just pull the file from your device to your desktop pc, edit it, and push it back. Exit out of the # shell by typing "exit" and pressing enter. At the C prompt, pull the file:
Code:
C:\android\tools\> adb pull /init.rc C:\init.rc
That pulls the file from your android device and places it at C:\init.rc. You can obmit the C:\ part, which would place the file in your android Tools folder u are running adb from (mine is getting messy though).
Once you edit it to your liking, push it back to your device:
Code:
C:\android\tools\> adb push C:\init.rc /init.rc
And that's it.
most custom roms contain nano, which is also a possible way to edit files.
I updated my post to reflect actual directions on how to modify a system file like that.

[Q] ADB doesn't work on Mac

When I CD to the platform-tools folder and type
Code:
adb devices
it says "adb: command not found" If anyone could help me that would be wonderful. I am on the Inspire/DesireHD running AOSP Gingerbread. Thanks!
You have two choices. You can either run the command prefixed with ./ (dot slash), which allows for executing an executable in the current directory:
Code:
./adb devices
Or, the other choice (which will be better if you intend to use adb a lot) is to add the platform-tools folder to your path by editing or creating the file .bashrc in your home folder (~/.bashrc).
Let's suppose your platform tools folder is: ~/.android-sdk/platform-tools
Then, you would want to add something along the lines of the following to your bashrc:
Code:
export PATH="$PATH:$HOME/.android-sdk/platform-tools"
Save the file, the run this or log out/in:
Code:
source ~/.bashrc
Et voila, you should now be able to run adb from any folder without issue.
Explanation: adding the new path (folder) to your PATH environment variable tells BASH to include that folder in its search for an executable. The reason $PATH is added at the beginning of the new string is so that your default path does not get overwritten. $HOME will simply expand to /home/your_user_name when BASH interprets it.
GENIUS! IT WORKED! Thank you! Now, one more question- how do I get superuser privileges using ADB? (device is rooted, of course)
No problem.
On my G1 you were root as soon as you adb'd in. Just tested on my Defy and '$' - shocking. So once you have run adb shell, just run 'su' (without quotes of course) and accept the permission on your phone screen as usual for root programs and you should be good to go.
Sorry to keep asking questions, but when I typed
Code:
su
into adb, it asked for a password. No popup on device screen. I do have superuser installed on the device.
That is odd. I'm not sure why that would be. I'll see if I can think of something though. Hopefully someone else can make a suggestion.
Thanks! You have been very helpful.
Don't think I can hit the thanks button from the app, sorry
Sent from my Inspire 4G using XDA App

Categories

Resources