adb install in terminal emulator? - G1 Android Development

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.

Related

JF 1.42 rc33 and T.E.

I'm sure i'm not the only one that has noticed that you can't update terminal emulator with modded firmware, i did a mild look through the searches, and didn't find what i was looking for, is there a means to update this, i've tried takeing it out of white list and then updating, but no go... Not that its a big deal TE works, its just an annoying knawing thing in the back of my mind, knowing there is an update on the market, and i can't have it
Delete the terminal app in terminal by
su
cd /system/app
ls
them find the app that starts with com. something
type rm -> name of the app
update it in market
card13 said:
Delete the terminal app in terminal by
su
cd /system/app
ls
them find the app that starts with com. something
type rm -> name of the app
update it in market
Click to expand...
Click to collapse
gives me a read only error, i have to chmod it first right? have no clue how to do that right now, have to look it up. Thanks for pointing me to the proper file though
It'd probably be best to use adb.exe (available in the android SDK) to remove terminal emulator rather than using terminal emulator.
Also, in order to change anything in the /system partition, you need to remount it as read/write.
With adb this is easy:
Make sure your android has debug mode enabled (which I think is by default in all JF releases)
Hook it up to your computer with the USB cable
Open up a command prompt in windows (or whatever other OS you're using that has the Android SDK) and go to the tools directory in the SDK
Type "adb devices" to make sure adb sees your phone, if it doesn't, well uh...it's not working right, and you'll have to figure out why
Type "adb remount" to remount the /system partition as read-write
Type "adb shell" this will give you shell access to your G1, from there you can delete stuff from the /system partition. I think you might also be able to use "adb uninstall" but I don't know if that works for the /system/app folder.
thanks for the info TM will play with the sdk tools and see what i can do, they have been giving me a headache on linux, but then i haven't played with linux in about 6 years.. its come along way. Thanks again for the info wait 2 secs to reload the image
I've noticed that, too. I don't see a reason why I need to update TE, the one I have works just fine.
here your answer in the link below
this will allow you to remove the terminal and install the new one from market
http://forum.xda-developers.com/showthread.php?p=3287558

Save Protected Apps to SD

MUST HAVE ROOT ACCESS!!
You can do this on your phone using Terminal Emulator
1. type "su" to turn $ into # (Superuser Whitelist will ask for root access; grant it)
2. Type 'cd data/app-private'.
3. Get a list of all the applications by typing 'ls'.
4. Pick which file you want to copy and type 'cp your_file_name.apk /sdcard/ e.g. 'cp com.android.musicplayer.apk /sdcard/'
5. Copy the .apk file off your memory card.
You can also do this using ADB, just replace step one with "adb shell" in your command prompt, and follow the rest of the steps
Why are you making it easier for people to pirate applications?
GoldenCyn said:
4. Pick which file you want to copy and type 'cp your_file_name.apk /sdcard/ e.g. 'cp com.android.musicplayer.apk /sdcard/'
Click to expand...
Click to collapse
so all copyright law violations aside you have failed to mention the fact that the file can no longer be used on a G1 or any other file structure requiring proper permissions
nevertheless .. copying of these protected apps off the G1 is most definitely illegal .. i would not recommend testing this out

adfree android

now that we have an easy way to push update.zip files I was wondering if there was any way to push the host file that adfree android downloads to the sdcard. I know that it doesn't have write access to the system partition when booted but in recovery we do right?
So it should be as simple as creating an update.zip that overwrites the old host right?
I'm going to try to get this working
EDIT: Here's how to get this working
1. Search for Adfree Android on the market
2. Install and run
3. allow it to download and install new hosts file, it will copy it to your sdcard and try to replace /system/etc/hosts but fail (it should reboot the phone shortly)
4. Power off the phone and hold Volume Down and power.
5. Use volume down to select recovery
6. In clockwork recovery volume down to "partitions menu" and hit the track pad to select
7. Select "mount /system" and "mount /sdcard" "mount /data"
8. Plug in your usb cord and open a command line on your pc
9. enter adb shell and type the following commands
cp /sdcard/hosts /data/data/hosts
rm /system/etc/hosts
ln -s /data/data/hosts /system/etc/hosts
10. Reboot your phone and enjoy adfree android.
Thanks to all for help in getting this running.
Just adb push your modified host file to /system/etc/hosts. No need for update.zip
ive already done this doesnt work still have tons of adds
word, I figured it out
junjlo said:
ive already done this doesnt work still have tons of adds
Click to expand...
Click to collapse
what I did was install adfree android, wait for it download and error (the phone will reboot itself) put it into recovery and run the following command from adb shell
cp /sdcard/hosts /system/etc
All my ads are gone
You mind sharing the host file? I'd like to do the same. Now that I can connect as root with 'adb shell' then 'su' after the new Unrevoked^2 root. I'd like to start tweaking with things.
supagene said:
You mind sharing the host file? I'd like to do the same. Now that I can connect as root with 'adb shell' then 'su' after the new Unrevoked^2 root. I'd like to start tweaking with things.
Click to expand...
Click to collapse
just download and install adfree android, it copies the host file to your sdcard.
n0-0ne said:
what I did was install adfree android, wait for it download and error (the phone will reboot itself) put it into recovery and run the following command from adb shell
cp /sdcard/hosts /system/etc
All my ads are gone
Click to expand...
Click to collapse
i may have an older hosts file than but i just used adb push hosts /system/ect/hosts
tryed cp but get a box with busybox info
n0-0ne said:
just download and install adfree android, it copies the host file to your sdcard.
Click to expand...
Click to collapse
I intalled the app and when I hit download and intall I get java/io.FileNotFoundException:/sdcard/hosts
My guess is that it's not downloading.
Tried it on both WiFi and 3G
supagene said:
I intalled the app and when I hit download and intall I get java/io.FileNotFoundException:/sdcard/hosts
My guess is that it's not downloading.
Tried it on both WiFi and 3G
Click to expand...
Click to collapse
ok well here's what was downloaded to my card
https://www.yousendit.com/transfer.php?action=batch_download&batch_id=K0JRUGhYT2JQb0t4dnc9PQ
Thats good for 100 downloads.
Found this. forum.xda-developers.com/showthread.php?t=664532 do you guys know if the zip file with hosts good enough since I can't seem to get the AdFree app to work correctly? Of is there an apk somewhere for this app and I shouldn't have gotten the one in the app store?
host installed still doesnt block ever ad using tikl and fring to test
supagene said:
Found this. forum.xda-developers.com/showthread.php?t=664532 do you guys know if the zip file with hosts good enough since I can't seem to get the AdFree app to work correctly? Of is there an apk somewhere for this app and I shouldn't have gotten the one in the app store?
Click to expand...
Click to collapse
I used the one from the market, it does error but it should copy the hosts file to your SD card (and reboot your phone shortly thereafter).
What now?
Great...
cat /sdcard/hosts > /system/etc/hosts
write: No space left on device
junjlo said:
host installed still doesnt block ever ad using tikl and fring to test
Click to expand...
Click to collapse
I've tested both apps and no ads in either.
The one thing I did different that I didn't post was in recovery under partitions I mounted both system and sdcard. Try that and copy the file over.
Thanks!!
So I downloaded the hosts file, booted in recovery, mounted both /system and /sdcard and then 'adb shell' and 'su' and then 'cd /system/etc' and then 'cat /sdcard/hosts > hosts' and it seemed to have worked.
I go to fring and it displays 'Web page not available', not what I'd like to see but it's better than those retarded ads that I keep clicking on by accident.
can someone post step by step how to get adfree working I installed the one from the market and let it error and reboot then i entered into clockworkmod recovery now what? do i need to mount system and sd how do i enter into adb shell and change host file. thanks in advance for any help.
supagene said:
So I downloaded the hosts file, booted in recovery, mounted both /system and /sdcard and then 'adb shell' and 'su' and then 'cd /system/etc' and then 'cat /sdcard/hosts > hosts' and it seemed to have worked.
I go to fring and it displays 'Web page not available', not what I'd like to see but it's better than those retarded ads that I keep clicking on by accident.
Click to expand...
Click to collapse
Glad it worked out, not sure why your getting page not available, I just get a blank box at the top of my contacts list, other apps show the same as well, a blank box where the ad used to be.
j1000 said:
can someone post step by step how to get adfree working I installed the one from the market and let it error and reboot then i entered into clockworkmod recovery now what? do i need to mount system and sd how do i enter into adb shell and change host file. thanks in advance for any help.
Click to expand...
Click to collapse
Edited OP.
thanks for the quick response everything is good until step 8. I know i sound stupid but i learning fast you say enter adb shell. the way i think you do this is type
1. cd\
2. cd sdk
3. cd tools
4. adb shell
when i do this i get error device not found
can you help from there. thanks

Idea for a very usefull app. Dev's needed

Hello all.
By flashing my device many times, I am always fed up to plug it and remove all the application I don't want, or open the zip file, remove the apk and resign the ROM.
What I have in mind is making a little app that show us all the applications in system/app ( easy) and them when clicking on them just like a adb shell rm system/app/myUnwantedApp.apk.
The browser is easy to program, but the command line is not easy. I tried with eStrongs and Astro, but they cannot remove the apk..
Cam someone help me or teach me how to enter a adb command line in my phone?
Thank a lot.
profete162 said:
Hello all.
By flashing my device many times, I am always fed up to plug it and remove all the application I don't want, or open the zip file, remove the apk and resign the ROM.
What I have in mind is making a little app that show us all the applications in system/app ( easy) and them when clicking on them just like a adb shell rm system/app/myUnwantedApp.apk.
The browser is easy to program, but the command line is not easy. I tried with eStrongs and Astro, but they cannot remove the apk..
Cam someone help me or teach me how to enter a adb command line in my phone?
Thank a lot.
Click to expand...
Click to collapse
You can use a terminal emulator application like Better Term etc to run shell commands. There is nothing special about adb.
The command adb shell rm is simply running the shell first and then the "rm" command. Now, depending upon the ROM that you are using, the command adb shell will give you a root shell (or not). In any case, when you use a terminal emulator, simply use the "su" command to gain super user privileges (you have to have "su" and SuperUser.apk installed).
Since you are talking about a custom ROM, I think that root access is implied.
In any case, look at programs like Android Scripting Environment. It allows you to code scripts in an interpreted language like shell script, python etc... In your case simply write a shell script with the desired "rm ...." commands and execute them after gaining superuser permissions and make sure that your /system partition is mounted in rw mode.

Terminal Emulator isnt working :/

Hi, i have ICS for HTC Desire (Bravo), Android 4.0.4 and my problem when i start Terminal Emulator, i type "su" and i get # (superuser permissions) and when i type "adb uninstall package" i get message from terminal "waiting for device" and i dont know what to do
I need to uninstal com.android.vending
Thx for help
t0msk said:
Hi, i have ICS for HTC Desire (Bravo), Android 4.0.4 and my problem when i start Terminal Emulator, i type "su" and i get # (superuser permissions) and when i type "adb uninstall package" i get message from terminal "waiting for device" and i dont know what to do
I need to uninstal com.android.vending
Thx for help
Click to expand...
Click to collapse
This has nothing to do with Terminal Emulator, it's working fine ->
adb stands for android debug bridge, it's meant to be a way to do stuff with your android device from your computer over the "bridge" that is USB. It says "waiting for device" because it needs a USB android device to be connected. As far as I know, even with OTG you can't use adb actually on an android device itself with Terminal Emulator. If all you want to do is uninstall an app, you shouldn't need adb anyway.
Read here.
HTCDreamOn said:
This has nothing to do with Terminal Emulator, it's working fine ->
adb stands for android debug bridge, it's meant to be a way to do stuff with your android device from your computer over the "bridge" that is USB. It says "waiting for device" because it needs a USB android device to be connected. As far as I know, even with OTG you can't use adb actually on an android device itself with Terminal Emulator. If all you want to do is uninstall an app, you shouldn't need adb anyway.
Read here.
Click to expand...
Click to collapse
I tried use adb through cmd in windows but its waiting too (adb through cmd is working only in recovery)
So how can i uninstall system app?
Screenshot is in attachments, i can disable it, but i need to uninstall it, because here is thread: http://forum.xda-developers.com/showthread.php?t=1355660&page=1662
Originally Posted by rfandango View Post
Download: Vending-3.8.15.noupdate.norestrictions.apk - google it - rename to Vending.apk, with root explorer move it to system app and set perm to rw r r...reboot...work like a charm
Unfortunately, this isn't working for me - still no play store, but there's an entry for com.android.vending in Manage Apps with a grey icon (generic app icon with a little SD card in the bottom right corner) and a size of 0.00b. Anyone know what I missed?
Click to expand...
Click to collapse
Edit: Fixed it! Needed to do "adb uninstall com.android.vending" and then reboot. The store is back now.
Click to expand...
Click to collapse
Any idea?
Because i dont have Play Store so i cant do anything
t0msk said:
Any idea?
Because i dont have Play Store so i cant do anything
Click to expand...
Click to collapse
Try run the following in Terminal Emulator:
Code:
pm uninstall com.android.vending
* You must find out the vending apk and delete it first (If the apk exists and is a system app).
codelover said:
Try run the following in Terminal Emulator:
Code:
pm uninstall com.android.vending
* You must find out the vending apk and delete it first (If the apk exists and is a system app).
Click to expand...
Click to collapse
i got "Failure"
I made new screenshot and i found that when i type "adb devices" in Terminal Emulator i get blank page, you can see it in the screenshot
t0msk said:
I made new screenshot and i found that when i type "adb devices" in Terminal Emulator i get blank page, you can see it in the screenshot
Click to expand...
Click to collapse
As mentioned by @HTCDreamOn, adb is for you to run commands from Windows and since you are working with Terminal Emulator you do not need to deal with adb related command.
Also mentioned earlier that you MUST manually delete the apk first before you can uninstall the app if it is a system app.
To do that first find out where the vending apk located. assumed that you have busybox/grep installed, run the following in Terminal Emulator:
pm list packages -f | grep vending
You should get something like this:
package:/system/app/vending.apk=com.android.vending
Click to expand...
Click to collapse
* Actual filename & path may vary depending on device
Now that you know where the apk is, eg: /system, mount the /system rw and delete the vending.apk manually.
Then you can proceed to uninstall using the following command:
pm uninstall com.android.vending
Success :laugh:
Thx!
I dont want to make new thread so my another question is why i cant go to ini.d folder when its exists?
Look at my screenshot
//EDIT: SOLVED

Categories

Resources