[Q] Command to install apps from terminal. - Android Software/Hacking General [Developers Only]

Sorry if this has already been asked. I tried searching and couldn't seem to find clear terminal commands. All of them either didn't seem to work, or were actually adb commands.
What are the exact commands for installing an app through terminal?
I'm trying to find the easiest commands to help a friend that needs to install an app on his phone. He doesn't have a data plan so he can't go into the market to install it, and isn't near the computer for adb.
I've used this command set before to install an app to system before:
su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
cat /sdcard/'name-of-app'.apk > /system/app/'name-of-app'.apk
mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system
But that is a little to complicated for him, and would be especially hard to explain over the phone, because like I said, he has no data plan.
Now I've seen this command around here:
su
cd /sdcard
install 'name-of-app'.apk /system/app/'name-of-app'.apk
But I tried that on my phone before giving it to him and it didn't seem to work.
So what are the commands for installing an app through the terminal to either system or data?

Install the sdk...
adb install application.apk
Sent from my HTC Liberty using XDA App

You just have to copy the application to /system/app (cp command), /system/ has to be mounted first of course.

SliestDragon said:
Sorry if this has already been asked. I tried searching and couldn't seem to find clear terminal commands. All of them either didn't seem to work, or were actually adb commands.
What are the exact commands for installing an app through terminal?
I'm trying to find the easiest commands to help a friend that needs to install an app on his phone. He doesn't have a data plan so he can't go into the market to install it, and isn't near the computer for adb.
I've used this command set before to install an app to system before:
su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
cat /sdcard/'name-of-app'.apk > /system/app/'name-of-app'.apk
mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system
But that is a little to complicated for him, and would be especially hard to explain over the phone, because like I said, he has no data plan.
Now I've seen this command around here:
su
cd /sdcard
install 'name-of-app'.apk /system/app/'name-of-app'.apk
But I tried that on my phone before giving it to him and it didn't seem to work.
So what are the commands for installing an app through the terminal to either system or data?
Click to expand...
Click to collapse
Sent from my HTC Magic using XDA App

Related

programming ON my android phone (etc)

Greetings gentlefolks.
This forum has been an absolute godsend. I managed to get the latest JF os installed and as such am thoroughly enjoying my G1.
In the past, I had a Windows Mobile phone from HTC. One of my favorite applications on it was Pocket Scheme because it enabled me to write code ON my phone. I'd love to eventually spend time working on software FOR my G1, but right now I'm interested primarily in writing code while on the train, in line, etc.
As far as I know, Pocket Scheme is not available on the Android. I also came across Ruby for Android [2], but so far it force closes as soon as I open it.
So:
1. Are there any languages that are available for writing code on the android? Something with either an included editor AND repl (like Pocket Scheme) or even just an editor (?) or a repl (like Ruby for Android) would be fine.
2. What editor for making "plain text" files with any extension do you use?
3. In desperation I tried using echo to create a new shell script file the other day, and Android OS complained that the file system was read only. Can I make it r/w from within the android, or do I need to use ADB?
Thanks in advance. I tried googling for answers, but to no avail.
[1] http://www.mazama.net/scheme/pscheme.htm
[2] http://code.google.com/p/android-ruby/
Well you could flash Debian to a JF build and go from there.
You can remount it as r/w from the device. I can't remember exactly what the command is but it is something along the lines of "mount -oremount,rw /dev/block/mtdblock0 /system" anyone care to correct me if that is wrong? You can also use DroidSans Tweak Tools available free in the market, just don't use the lite version
Geniusdog254 said:
You can remount it as r/w from the device. I can't remember exactly what the command is but it is something along the lines of "mount -oremount,rw /dev/block/mtdblock0 /system" anyone care to correct me if that is wrong? You can also use DroidSans Tweak Tools available free in the market, just don't use the lite version
Click to expand...
Click to collapse
almosst correct on the command there, there is actually a space between the "-o" and "remount" so it should read
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
that would make your system partition read write, but if you wanna run shell scripts i would go grab gscript and just write them in there.
oops i typed it wrong i switched the rw and remount, it's fixed now sorry
tubaking182 said:
almosst correct on the command there, there is actually a space between the "-o" and "remount" so it should read
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
that would make your system partition read write, but if you wanna run shell scripts i would go grab gscript and just write them in there.
Click to expand...
Click to collapse
Haha that's funny. Ive been typing: "mount -o rw, remount -t yaffs2 /dev/block/mtdblock3 /system"
But. That's just what works for me. Found it when I first rooted my phone.

Pushing without adb?

Sorry if this has been covered,but how would I go about pushing a file by using the phone only?Is that possible to do in a terminal?And if so what commands would be used.Thanks
casperlt1 said:
Sorry if this has been covered,but how would I go about pushing a file by using the phone only?Is that possible to do in a terminal?And if so what commands would be used.Thanks
Click to expand...
Click to collapse
all you'd need to do is go into a terminal, then su, mount with rw permissions, then cp file /path/to/destination
and how do I mount with permissions?that's what I was missing,thanks
casperlt1 said:
and how do I mount with permissions?that's what I was missing,thanks
Click to expand...
Click to collapse
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
Go to Market and search for SU file manager or check out http://www.androlib.com/android.application.com-protocol-su-fbs-jmwq.aspx
It's not free, but it's cheap, and has pretty much replaced all the file explorer/editor/utility-type apps I used to screw around with. For all intents and purposes, you can use it to do just about anything you'd otherwise need adb to do.

[Q] Rooting Android (remount)

I was never successful using SuperOneClick for the Optimus V. hangs at wating for device.
THOUGH...
I believe I did finally get it rooted using adb and push psneuter, busybox, su and Superuser.apk...via Ubuntu 10.10 Maverick...
I rebooted the device twice...downloaded terminal from the market and sure enough I can su to a # prompt...I take this to confirm I have successfully rooted my Optimus V.
Now to the question....
I found several post most of which included this command in adb shell:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock5 /system
However I was successful based on a post found here by (Endur):
http://forum.xda-developers.com/showthread.php?p=12076877
with the command
mount -o rw,remount /dev/block/stl9 /system
What is the difference? Have I done something horribly wrong?
And Thank you for all your work here...This is a lot of fun prying into the technologies of today and tomorrow.
Any answer or pointing me in the direction to research on my own would be much appreciated.
Jim

partition protected

I'm sure this has been addressed but a search wouldn't located it. I had this woman bring a phone in and ask me to get this spy app to work on her son's phone, it has to be written on the /system. She paid someone on Craigslist to root it. I'm able to get the # in terminal emulator, and s-off is there but I'm still unable to write to /system. Even once mounting it through Clock workMod. The phone is running cm7 by the way. Any ideas on how to make the /system writable.
Sent from my SGH-T989 using XDA Premium App
i use this command in Terminal after I get the #
mount -o remount,rw /system
N_otori0us_ said:
i use this command in Terminal after I get the #
mount -o remount,rw /system
Click to expand...
Click to collapse
Thank you very much. It worked.

[GUIDE] Enable/Disable HTC Virtual CDROM

I personally hate the automounting CDROM image with HTC software. I know it's fairly common knowledge how to disable it but below are the commands for anyone that cares. Make sure android debugging is enabled and enter the applicable command in your computer's terminal. As with other /system edits, this will only stick if you have S-OFF. You may need your phone screen unlocked to accept the su prompt if you haven't already granted ADB root access.
Disable HTC Virtual CDROM:
Code:
adb shell su root -c "mount -o remount,rw /system /system; mv /system/etc/CDROM.ISO /system/etc/CDROM.ISO.bak; mount -o remount,ro /system /system"
Re-Enable HTC Virtual CDROM:
Code:
adb shell su root -c "mount -o remount,rw /system /system; mv /system/etc/CDROM.ISO.bak /system/etc/CDROM.ISO; mount -o remount,ro /system /system"
i didnt know
I didn't know either... thanks!:good:
Never even crossed my ind to remove that annoying "feature"
Cheers man
Any particular reason to not simply rename the file cdrom. iso.bak or just delete it?
Transmitted from the holodeck of my HTC One M8.
hgoldner said:
Any particular reason to not simply rename the file cdrom. iso.bak or just delete it?
Transmitted from the holodeck of my HTC One M8.
Click to expand...
Click to collapse
Nope, I'm in IT so I always rename and not delete for small files. Personal preference.
I had no idea. Thanks so much
Nice. So glad to get rid of that stupid thing. I wanted to do that before but couldn't find where the file was located. Worked great. Thanks alot!
Thanks, just used root explore, found the file, and just added .bak to it.
Put a bootable Linux rescue ISO in there :angel:
unfortunately, I can't find that file. it exist because the silly CD popups every time I plug my phone in, but the .iso isn't in system/etc. my phone seems to be slightly stupid when doing a search. Oh well. Good info to have. Thanks for posting the instructions. I appreciate it.

Categories

Resources