Can't pull apks? - G1 Android Development

Ok, so I'm pulling apks from the device and here's what happens.
Various commands I've tried:
adb pull /system/sd/app/com.p1.chompsms.apk /Desktop/apks/messaging.apk
adb pull /system/sd/app/com.p1.chompsms.apk /Desktop/apks/
adb pull /system/sd/app/com.p1.chompsms.apk /Desktop/apks/com.p1.chompsms.apk
adb pull /data/app/com.p1.chompsms.apk /Desktop/******
My results:
**** kb/s (0 bytes transferred in **** s)
^random kb/s and different time intervals
Wtf...
I'm running my apps of the sd card... but the device is on, the ext2 partition is mounted.
Jf 1.41 Rc30
P.S. Just one time, I had it where the cmd prompt said the same thing, but the image of the file showed up in the destination, but it was still 0 bytes, so it was an empty file.

did you remount first?

Yep.
Remount succeeded. <_<
This is bugging me a lot.

just ignore the kb/s and bytes transfered and whatnot. it isn't accurate.

I know it isn't.
The thing is though, the cmd prompt seems to think it pulled the file, but it didn't.
The file doesn't show up in the destination folder at all. I tried pulling them to the full address and the shortcut and nothing happens, but the prompt says it was done.

command prompt? are you on windows? last I checked /Desktop/<whatever> isn't a valid path on windows (if you're on mac/linux, sorry, "command prompt" is windows speak )

Yeah, it's windows. I'll eventually convert to linux once I get more comfortable with it.
I've tried the full path C:/..../apks, and I used the shortcut, which is /desktop, because the current directory in command prompt is C:/Users/Admin/, but that isn't the problem.
The damned apks won't transfer.
If it was an invalid directory, it would give me that error, but alas it isn't.
I am not in adb shell command either.

i think that you should try ./desktop/<whatever> instead of /desktop/<whatever>
EDIT: the regular old /data/app/<whatever>.apk and /system/app/<whatever>.apk should work, too. No need to use /system/sd/<whatever> since you symlinked it to /data/app/ when you moved your apps to your SD card.

i used all of it.
I just gave up on using this computer with w7 x64 and used a 32 Xp, and it worked just fine. Might be the driver. Idk.
So yeah, I pulled them. Throwing out my little proggy tonight. Assuming all the testing is functional.

By default, if you dont specify a directory to pull it to, it should end up being pulled to the same folder as adb.

APrinceAmongMen said:
Ok, so I'm pulling apks from the device and here's what happens.
Various commands I've tried:
adb pull /system/sd/app/com.p1.chompsms.apk /Desktop/apks/messaging.apk
adb pull /system/sd/app/com.p1.chompsms.apk /Desktop/apks/
adb pull /system/sd/app/com.p1.chompsms.apk /Desktop/apks/com.p1.chompsms.apk
adb pull /data/app/com.p1.chompsms.apk /Desktop/******
My results:
**** kb/s (0 bytes transferred in **** s)
^random kb/s and different time intervals
Wtf...
I'm running my apps of the sd card... but the device is on, the ext2 partition is mounted.
Jf 1.41 Rc30
P.S. Just one time, I had it where the cmd prompt said the same thing, but the image of the file showed up in the destination, but it was still 0 bytes, so it was an empty file.
Click to expand...
Click to collapse
Are you using Vista?
Have tried just moving your "apks" folder to the C: drive and using: adb pull /system/sd/app/com.p1.chompsms.apk c:\apks (making sure you use the correct slash)

I was using windows 7.
Idk. There was some kind of issue. I just threw it on xp and did it there. No biggie.

Related

Rooting CDMA Hero [Mac]

Root the CDMA Hero
Edit: I assumed that everyone knew that you needed the Android SDK to root. If you didn't know and/or don't have it, you can download it from here. http://developer.android.com/sdk/index.html. Extract it to a location of your choice. I put mine in /Users/Antonio(Would be your username)/Documents/Android/SDK
Now, this part is completely optional.
I'm going to show you how to add your sdk/tools directory to your .bash_profile file so you won't have to navigate to the folder each time.
Download this so you'll be able to see your hidden files http://www.mediafire.com/?diimft1ninn Run it, check "Show Hidden Files" then click Restart finder. Now, navigate to your home folder (/Users/%UserName%/) and see if there's a .bash_profile already there. If not, create with textedit.
Now add this to the file: export PATH=${PATH}:/Path/Of/Your/Sdk/Tools/Folder
Mine is /Users/Antonio/Documents/Android/SDK/tools
Now do not save it as rich text. If yours is in rich text, click on "Format" in the menu bar, and click "make plain text". Now save it as .bash_profile and uncheck "if no extension is provided, use .txt".
Now you can go back to Ghost and uncheck "Show all hidden files" and restart finder again.
Now, for rooting.
First, go to Settings > Applications>Development, and make sure USB Debugging is checked on your phone.
1. Download Asroot2 (http://zenthought.org/tmp/asroot2) and move it to your SDK/tools directory
2. Navigate to your SDK/tools folder (cd ~/Documents/Android/SDK/tools for me)(~ replaces /User/%Username% if you didn't know)
3. Then type:
Code:
./adb push asroot2 /data/local/
./adb shell chmod 0755 /data/local/asroot2
./adb shell
/data/local/asroot2 /system/bin/sh
And you should get:
$ /data/local/asroot2 /system/bin/sh
[+] Using newer pipe_inode_info layout
Opening: /proc/857/fd/3
SUCCESS: Enjoy the shell.
4. Then type:
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
cd /system/bin
cat sh > su
chmod 4775 su
At this point you should have root access.
Now, for the recovery image (gives you extra options like backing up with Nandroid, partioning SD, etc.)
1. Download the recovery image from here: http://forum.xda-developers.com/showthread.php?t=596879
2. If you are still in adb shell from rooting type in exit until you are out. You should be in the directory where you extracted the recovery image. If not go there (You can put it in the SDK/Tools folder and nav there). Type in the following:
adb push recovery-RA-heroc-v1.5.1.img /sdcard/
You should get something like 868 KB/s (3352576 bytes in 3.767s)
3. Type in adb shell. If you see a dollar sign ($) then type in su and press enter. If it is a pound sign (#) you are good. Now type in:
Code:
flash_image recovery /sdcard/recovery-RA-heroc-v1.5.1.img
Once that is finished you are done. To reboot into recovery type in adb shell reboot recovery.
Told you most of the steps are the same. I just copied from other members and slightly modified it for Mac.
Now, if we could get a moderator to merge all these "How to Root" threads.
Ugh... Doesn't seem to work on Macbook. Phone shows "USB Connected", but, see below...
Code:
michael-macbook:tools mglipin$ ./adb devices
* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
michael-macbook:tools mglipin$ ./adb push asroot2 /data/local
error: device not found
michael-macbook:tools mglipin$
What's up?
Start HTC Sync on your phone Dont worry that it pops up with an error abbout not finding a PC.
Then when you do adb devices you should see your phones serial number.
Alsomake sure USB Debugging Settings >Applications > Development is turned on
Thanks for this! I ended up getting mine rooted last night, but i had no idea about the recovery image thing. I gotta get that Nandroid going so i start removing some of the Sprint/HTC bloat!
ajones7279 said:
Root the CDMA Hero
3. Type in adb shell. If you see a dollar sign ($) then type in su and press enter. If it is a pound sign (#) you are good. Now type in:
flash_image recovery /sdcard/recovery-RA-heroc-v1.2.3.img
Click to expand...
Click to collapse
I get to this step....and in my terminal it keeps coming up with
Code:
mtd: re-read error at 0x00440000 (Out of memory)
mtd: write error at 0x00440000 (Out of memory)
mtd: re-read error at 0x00440000 (Out of memory)
mtd: skipping write block at 0x00440000
mtd: write error at 0x00460000 (Out of memory)
error writing recovery: No space left on device
Any ideas???
SS70Chevelle said:
I get to this step....and in my terminal it keeps coming up with
Code:
mtd: re-read error at 0x00440000 (Out of memory)
mtd: write error at 0x00440000 (Out of memory)
mtd: re-read error at 0x00440000 (Out of memory)
mtd: skipping write block at 0x00440000
mtd: write error at 0x00460000 (Out of memory)
error writing recovery: No space left on device
Any ideas???
Click to expand...
Click to collapse
Unless you replaced your SD card with something > 4Mb then the 3.4Mb recovery image won't fit on the stock 2Mb SD card.
I ordered a 16Mb card myself from Amazon.
I'm pretty sure this has nothing to do with MicroSD card space. I have a 4 gig with lots of space.
I have a 2GB stock card and was able to flash. I initially had the same "Out of memory" error and fixed it by cleaning up my SD card -- copying off extra pictures, videos, podcasts, etc. I also rebooted for good measure, probably not necessary.
Thanks for the guide have everything working! The link to the recovery ROM is hard to get into, it is hosted here as well for anyone else that has a problem.
http://www.androidspin.com/downloads.php?dir=amon_ra/RECOVERY/&file=recovery-RA-heroc-v1.2.3.img
I was also getting the same error message. I didn't do anything to my SDcard, I just died a battery pull and tried again and everything worked.
Ooops, nvm
It is a 2Gb card and the recovery is 3.4Mb.
gilroykilroy said:
Unless you replaced your SD card with something > 4Mb then the 3.4Mb recovery image won't fit on the stock 2Mb SD card.
I ordered a 16Mb card myself from Amazon.
Click to expand...
Click to collapse
It cant be the size of the SD card, I have well over 4GB free on my 8GB card. Does anyone know how much device memory you must have free to flash the recovery image?
It was definitely the device memory. I deleted about 10 programs and rebooted. After that it had no error messages.
5tr4t4 said:
I have a 2GB stock card and was able to flash. I initially had the same "Out of memory" error and fixed it by cleaning up my SD card -- copying off extra pictures, videos, podcasts, etc. I also rebooted for good measure, probably not necessary.
Click to expand...
Click to collapse
mactruc said:
I was also getting the same error message. I didn't do anything to my SDcard, I just died a battery pull and tried again and everything worked.
Click to expand...
Click to collapse
Same Here, the soft reset worked like a charm Just started my nandroid backup. Thanks again gentlemen.
herzzreh said:
Ugh... Doesn't seem to work on Macbook. Phone shows "USB Connected", but, see below...
Code:
michael-macbook:tools mglipin$ ./adb devices
* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
michael-macbook:tools mglipin$ ./adb push asroot2 /data/local
error: device not found
michael-macbook:tools mglipin$
What's up?
Click to expand...
Click to collapse
Go to Settings > Applications > Development and make sure USB Debugging is checked. It was a step I left out (assumed people knew rather).
ajones7279 said:
Go to Settings > Applications > Development and make sure USB Debugging is checked. It was a step I left out (assumed people knew rather).
Click to expand...
Click to collapse
I can vouch for this as well, had the same issue, and this took care of it.
Thanks for the Mac guide! Worked flawlessly.
so, i'm quite definitely (and obviously, as you'll see) a complete android noob. i apologize in advance.
i followed the guide to the letter, and ran into the "out of memory" error. so i cleared out a few photos from the sd card and rebooted the phone, then tried the last step again. i typed "adb shell reboot recovery" at the command line, and my phone started to reboot, but when it hit the first HTC logo the screen went completely black, the charging light went off, and i couldn't turn the phone back on at all. i ended up popping the battery out and back in, then booted it back up just fine. it booted normally, as it always had, so i'm assuming i did something wrong and it's not "rooted".
basically my question(s) is/are:
a) when i ran into the "out of memory" error and rebooted, should i have started the guide from the beginning again? or was i right to just continue on from the step i left off at?
b) if it worked and i did in fact succeed in rooting the phone, how can i find out for sure that it's rooted? is there a failsafe way to tell me that it worked?
c) if i did something else wrong along the way.. what should i do?
ersocia said:
basically my question(s) is/are:
a) when i ran into the "out of memory" error and rebooted, should i have started the guide from the beginning again? or was i right to just continue on from the step i left off at?
Click to expand...
Click to collapse
I had the same issue. After the soft reset you should have done this:
Code:
mtd: re-read error at 0x004c0000 (Out of memory)
mtd: skipping write block at 0x004c0000
96-26-56-112:tools brynehobbs$ ./adb shell
$ su
# flash_image recovery /sdcard/recovery-RA-heroc-v1.2.3.img
# reboot recovery
ersocia said:
b) if it worked and i did in fact succeed in rooting the phone, how can i find out for sure that it's rooted? is there a failsafe way to tell me that it worked?
Click to expand...
Click to collapse
yeah dl PicMe from the market, its free and requires root to run.
ersocia said:
c) if i did something else wrong along the way.. what should i do?
Click to expand...
Click to collapse
Figure out where you made the mistake and try again.
ersocia said:
c) if i did something else wrong along the way.. what should i do?
Click to expand...
Click to collapse
Just about everything is reversable...and the nandroid backup will save you from just about anything.
However, if even that fails and you find yourself feeling like this guy:
http://forum.xda-developers.com/showthread.php?t=581963
You can always return to stock with the exes from here:
http://forum.xda-developers.com/showthread.php?t=559622
Ran into the memory problem, but I have root now.
I didnt do anything to the sdcard or the device memory, all I did was hit phone+power+menu to do the reboot then did the commands to flash the recovery image and now I am running my nandroid backup.
I love the recovery menu also much better than the recovery menu on my rooted G1, but missing the recovery shell. Is there a way to get into the shell from the recovery menu or is adb the only way in.
edit: nevermind about the recovery shell just realized you cant have a software keyboard in the recovery shell
i am having a hard time rooting my sprint htc hero
the stuff that ajones7279 posted is not enough from me as i have only had a mac and android phone a few weeks and don't know very much
i would be grateful if some one could give me detailed info on how to root my hero on a mac
thank you

I wanna remove the clear lockscreen and put the original one??

I am on fresh 1.1 but i dont like the clear lockscreen. Is there a way i can change it??
yes try looking
just push this to system/app
you can use the fresh kitchen or adb
btw you can take apps out of any rom.zip on your computer, that's where i got this
Thank You thedudejdog it worked perferct
You can take the HtcLockscreen.apk out of the /system/app dir of any ROM you like to get that rom's lockscreen going.
thedudejdog said:
just push this to system/app
you can use the fresh kitchen or adb
btw you can take apps out of any rom.zip on your computer, that's where i got this
Click to expand...
Click to collapse
am a newly rooted hero owner. read/re-read/followed the steps to do it on this forum and am grateful to those who lent their knowledge/expertise.
want to have the original hero lockscreen and downloaded this HtcLockScreen.apk file.
i searched online to see if i could find instructions to push this but can't seem to figure it out.
i've done the following:
- copied HtcLockScreen.apk to the root of my sd card.
- opened a command prompt
- got to "C:\android-sdk-windows\tools>"
from here am i supposed to type:
- "adb shell"
- "su"
'cause i think to push this is the command, right:
- "push /sdcard/HtcLockScreen.apk /system/app/"?
help please!
thank you.
ok, put the file that you want to push in your tools directory of the sdk (c:\sdk\tools) these are the commands to push the file using adb
make sure you are in the command prompt and in your android sdk/tools directory.
you can copy/paste these one line at a time
i always do a
Code:
adb devices
first just to make sure adb sees your phone. if your phone shows up then continue
then mount system read/write
Code:
adb remount
then push the new lockscreen (this will overwrite the one that is there now)
Code:
adb push HtcLockScreen.apk /system/app
then close the cmd prompt window
Code:
exit
or you can use the fresh kitchen for a nice gui that does all the dirty work for you.
then reboot and there ya go, new lockscreen (or whatever)
i've never used the shell to push files, but i assume those commands that you listed should work for that, but you have to remount the filesystem first.
I thought I saw on here a little while back that showed you how to remove just the image from the lockscreen so all you have is the grey bar. Does anyone know where that is because I thought that that was kinda cool.
thedudejdog said:
ok, put the file that you want to push in your tools directory of the sdk (c:\sdk\tools) these are the commands to push the file using adb
make sure you are in the command prompt and in your android sdk/tools directory.
you can copy/paste these one line at a time
i always do a
Code:
adb devices
first just to make sure adb sees your phone. if your phone shows up then continue
then mount system read/write
Code:
adb remount
then push the new lockscreen (this will overwrite the one that is there now)
Code:
adb push HtcLockScreen.apk /system/app
then close the cmd prompt window
Code:
exit
or you can use the fresh kitchen for a nice gui that does all the dirty work for you.
then reboot and there ya go, new lockscreen (or whatever)
i've never used the shell to push files, but i assume those commands that you listed should work for that, but you have to remount the filesystem first.
Click to expand...
Click to collapse
thank you! it worked...

HTC Navigation.apk

anyone have this please id like to have it ...... and how do i remove the other nav please ( like to save it incase i dont like the HTC NAV )
I don't have the .apk for HTC Navigation, but when/if you do get it, just to to system/app and rename your current nav application (i.e. navigation.apk.old) if you don't want it to show up in your app list, but don't want to uninstall.
http://forum.xda-developers.com/showthread.php?t=700448 At the bottom of post #1 Flip was nice enough to zip all the apks into one zip file. Hope that helps.
Stunna4life888 said:
http://forum.xda-developers.com/showthread.php?t=700448 At the bottom of post #1 Flip was nice enough to zip all the apks into one zip file. Hope that helps.
Click to expand...
Click to collapse
yea i pulled that from the SDcard but it wont install i might have to push it
Sporkman said:
yea i pulled that from the SDcard but it wont install i might have to push it
Click to expand...
Click to collapse
Thats what I had to do, know how do that?
Stunna4life888 said:
Thats what I had to do, know how do that?
Click to expand...
Click to collapse
hmm, could you kindly explain what "pushing" is, and how to do it?
my android pushing and pulling files.
for those of you new to android and adb.
ok here is the real answer
pulled directly from android developer tools.
----------------------------------------------------------------------
Copying Files to or from an Emulator/Device Instance
You can use the adb commands pull and push to copy files to and from an emulator/device instance's data file. Unlike the install command, which only copies an .apk file to a specific location, the pull and push commands let you copy arbitrary directories and files to any location in an emulator/device instance.
To copy a file or directory (recursively) from the emulator or device, use
adb pull <remote> <local>To copy a file or directory (recursively) to the emulator or device, use
adb push <local> <remote>In the commands, <local> and <remote> refer to the paths to the target files/directory on your development machine (local) and on the emulator/device instance (remote).
Here's an example:
adb push foo.txt /sdcard/foo.txt
How to push the file via your sd card
So for an example on pushing a file from a computer to phone make sure you are in recovery mode. And assuming you have the apk somewhere on your sd card. Open command prompt and navigate to your sdk-tools to use adb. THIS EXAMPLE IS STRAIGHT FROM FRESH THATS WHY I SAYS ..../FRESH-REMOVED-APKS/. That is just the location on your sd card so this is where you need to type where the file is. WHATEVERAPP.apk thats what the apk name is. Make sure that it is the same spelling and spacing/no spacing as well. notice the space after .apk as well. Now you are ready simply type the following commands (enter at the end of each line.) Last line is simply where your file is on your sdcard then the file name as it appears in the file on your sd card. Hope this helps!
adb shell mount /sdcard
adb shell mount /system
adb shell
cp /sdcard/fresh-removed-apks/WHATEVERAPP.apk /system/app

can't push files to my G2 thru adb

adb is recognizing the phone, but every time i try to push a file, i get 'cannot stat 'su': No such file or directory'. i have made sure over and over that i extracted su into the same place where adb is located, but i get this error every time. pullin' my hair out over here, haha. any suggestions?
well shoot, i finally got it to work by putting the files i wanted to push in User/Me.... once in that location, adb was able to push them to the phone!

ADB issues

Okay, so i trying to push a file to my SGS4G... I thought i got it to work but when i went to find the file it was just some random file with no extension.
e.g. I typed (adb push FFFFFF.FFF /sdcard/download) it says the file was copied but when i go to my phone ffffff.fff is not there, instead a file called /sdcard/download
I followed these instructions....
A:android-sdk-windows installed
B: (on your phone) go to menu>settings>applications>developement and make sure usb debugging is checked.
C: the file you are pushing must be placed in the tools folder of adb so if you are pushing file "build.prop.txt" this needs to be downloaded/copy and pasted in C:\android-sdk-windows\tools
1: go to run and type cmd (or just open your command prompt)
2: cd C:\android-sdk-windows\tools
3: adb remount
4: adb devices *if everything is set up right this should output a serial number*
5: adb push FFFFFFF.FFF /#####/###### *i hope my notes help here you need to put the file name in for the F(s) and in the pound signs you put the destination on the devices example adb push build.prop.txt /system/bin
6. repeat step 3 for multiple files
7. adb reboot this is how you finish
What am i missing?
i see you are trying to push a file to your download folder on the sd card...
you can just drag and drop for stuff like this.
true true, not sure why i didnt think of that, i do it all the time... But would i use those instructions if i wanted to move a file say a recovery file to the bin directory?
i have never seen the need to use adb for this phone. it is not a nand locked device, so there is no real use for it (im speaking for users, not devs). if you want to push a file, jsut use root explorer or similar. thats all you need.
also, it seems to me like you are trying to get krylons cwm. just flash bali instead. no need for the recovery file or update.zip.

Categories

Resources