ADB Issue - LG Optimus 3D

its been over a year since i last used ADB and this is the first time using adb on the optimus 3d but i cannot seem to pull anything off of the phone.
this is the command im using on command line
adb pull /data/app app & adb pull /data/app-private app-private
but i just get this returned
pull: building file list...
0 files pulled. 0 files skipped.
pull: building file list...
0 files pulled. 0 files skipped.
now i can tell you that there are many apks inside that folder.
i cant even list what files are in that directory by using the 'ls' parameter
the only way i can actually view the files is if i
adb shell su
# cd data/app
ls
then it will list the files but i still cannot pull the files it just says data/app/filename.apk cannot find specified file
is this some kind of lock lg have put on or has the adb been updated and no longer allow you to do this?

Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums and Read THIS
Moving to General

Im guessing no one knows or has not bothered with adb themselves

i did like this
(rooted phone)
enter in adb shell
su
mkdir app1
cp /data/app/*.apk app1
exit from shell
then try adb pull /app1 app
and its working
to remove files and folder from app1 folder in adb shell
rm -r app1 (deletes app folder)
pls note rm -r will delete folders with files so dont delete wrong folder.

cheers didnt think about creating a different directory in an attempt to get round the system, cool will try this many thanks

Related

[GUIDE] Basic Unix/Linux command to use with ADB SHELL

I am sure that many of the new people in here are not exactly sure how to use ADB under linux.
So Ive been reading the Evo 3D forum, and I found this really nice guide by vboyz103. You can find the thread HERE
All props go to vboyz103 for creating it, im just sharing it with you guys.
P.S. - I found it in the Android Development forum, so Im putting it in ours. If it does not belong here - MODs - please move it to General.
vboyz103 said:
So I have been reading quite a few threads here on XDA, and the one thing I noticed for noobs to linux/unix world is that they are struggling with some basic command once adb shell is gained. I decided to whip out this quick tutorial to help those noobs out to become more of an expert...like me...lol j/k
Here we go:
Prerequisites:
You must know how to invoke a adb shell command already to drop into your phone.
ALL commands in Unix/Linux are case sensitive
For more details, go to this ADB tutorial (very good one): http://forum.xda-developers.com/showthread.php?t=517874
Let's get going:
Once a shell is gained via adb, let's look at some of the basic commands you can do to navigate around the filesystem. Note: you must remove the double-quotes (") for the actual command.
Code:
"cd" = is change directory
to change to any directory, you type: cd dir_name (where dir_name is a full path)
Example: I want to go to /data/local/tmp in my phone, I would do
cd /data/local/tmp <hit ENTER>
You can also use the ".." to go UP one directory.
Example: I'm in /data/local/tmp and I want to go up to /data folder, a command would be: cd ../.. alternatively, if I do cd .. then i'll drop into /data/local folder instead.
Code:
"ls" = list files/directories
to list files/directories within a folder, the command should be:
ls <hit enter> => this will list all NON-HIDDEN file/directories within your CURRENT directory.
ls /data/local/tmp => this will list all NON-HIDDEN file/directories within /data/local/tmp directory.
ls -l => this will list all NON-HIDDEN file/directories within your CURRENT directory, plus additional details. Consider this is like a "Details" view in Windows Explorer.
ls -a => this will list all files/directories (including hidden files) within your CURRENT directory.
ls -la => this will list all files/directories (including hidden files) within your CURRENT directory, plus details.
Code:
"chmod" = change mode
Goes to wikipedia for more details: https://secure.wikimedia.org/wikipedia/en/wiki/Chmod
Most commonly used modes on android phones are:
"755" or "777".
So if you have a root.sh shell script that you downloaded from XDA, and uploaded to your phone and try to execute it with ./root.sh and it said "Permission denied". That means your script does not have the execute permission. You need to do:
chmod 755 root.sh <hit enter>
[B]IMPORTANT: There is *NO* negative sign (-) in front of the mode bit. So it is NOT chmod -755 root.sh[/B]
If you get a "File or directory not found" error, which means you are chmod-ing a file that doesn't exist in your current directory. To execute a chmod on root.sh in /data/local/tmp you do:
chmod 755 /data/local/tmp/root.sh
If you want to chmod an ENTIRE DIRECTORY and ALL files underneath it you do:
chmod -R 755 /data/local/tmp => this will set /data/local/tmp and ALL files/folders underneath it to be 755.
Code:
"chown" = change ownership
Go to wikipedia for details: https://secure.wikimedia.org/wikipedia/en/wiki/Chown
Most common used chown for android is: "root:root" or "root:shell"
Example: if you want to change ownership of root.sh to root:shell then you do:
chown root:shell root.sh
NOTE: the -R (recursive) option is also available for chown.
chown -R root:shell /data/local/tmp
Code:
"pwd" = print working directory
so when you are within a directory and you want to know which directory you are in, then you issue the command:
pwd <hit enter>
The system will reply back with the currently directory you are in.
I'll try to add more if I think of anything else useful, or if you have suggestions, please feel free to add.
Click to expand...
Click to collapse

adb pull /data/data/ not working

Everytime I use
Code:
adb pull /data/data/ C:\Android
it responds with
Code:
pull: building file list...
0 files pulled. 0 files skipped.
Pulling any other file works, but I can't seem to pull any file from /data/data/..
Is there a reason to this? or is it just me >_>?

Root fail

Okay, so I tried doing the One-Click Exploit and nothing happened (yes, I had the USB Debugging checked, allow for external developers, and USB Charge Only). So then I tried the manual root. My phone rebooted, but it wasn't rooted. Now when I try to do the Manual Root it says (after the ./zerg) :
[-] Cannot copy boomsh.: Permission denied
[1] + Stopped <signal> ./zerg
And when I tried doing the One-Click again, it rebooted my A2 a couple times and still didn't get it rooted. Help???
Ok first remove the tmp directory in the same place you copied zerg to.
Here are the commands:
From windows:
Launch a command line - go to start run and type cmd or command
Then from the prompt cd to the directory you installed the SDK in and do the following commands:
adb shell
cd /data/local (This will need to be the directory you copied the zerg file to the first time.)
rm ./tmp/*
rm ./tmp/*.*
rm ./tmp
Then follow this post from the root thead:
http://forum.xda-developers.com/showpost.php?p=19916762&postcount=194
Right now there is not a one click for the latest root methods.
The other thing I would do is read through the how to root thread, because there are people that have been able to root by using both the one click and the manual method at the same time to get it to root.
Link to the root thread:
http://forum.xda-developers.com/showthread.php?t=1327741&page=20
Alright, thank you...but I'm a bit rusty with my MS-DOS and I didn't get very far to begin with. So what do you mean by "cd to the directory" and how would I do that? Unfortunately I'm not very sure which directory I installed the SDK in. I think it's data/local/. Here's some of the lines:
c:\Users\User\Deskstop\Exploit\adb shell
shell(character I don't recognize)edison:/$ cd /data/local
cd /data/local
shell(" "):/data/local$ chmod 777 zerg
Sorry for being a little on the illiterate side...I'm like the shadetree mechanic of computers.
According to the xda news,superoneclick has added the zerg rush exploit to it's program.might could try it.
Sent from my MB865
Sent from my MB865
JDtech1701 said:
I'm like the shadetree mechanic of computers.
Click to expand...
Click to collapse
Hey shadetree mechanics keep cars running
Sent from my MB865 using xda premium
JDtech1701 said:
Alright, thank you...but I'm a bit rusty with my MS-DOS and I didn't get very far to begin with. So what do you mean by "cd to the directory" and how would I do that? Unfortunately I'm not very sure which directory I installed the SDK in. I think it's data/local/. Here's some of the lines:
c:\Users\User\Deskstop\Exploit\adb shell
shell(character I don't recognize)edison:/$ cd /data/local
cd /data/local
shell(" "):/data/local$ chmod 777 zerg
Sorry for being a little on the illiterate side...I'm like the shadetree mechanic of computers.
Click to expand...
Click to collapse
You will just highlight each line of commands ONE AT A TIME, then past it to your DOS terminal window then hit return, but just one line at a time.
Ok after you connect to your phone with ADB shell you should see:
see a $ for your prompt.
then copy these lines and paste them one at a time and hit return in your DOS terminal window:
su
cd /data/local
rm ./tmp/*
rm ./tmp/*.*
rm ./tmp
Then follow this:
http://forum.xda-developers.com/showpost.php?p=19916762&postcount=194
http://forum.xda-developers.com/showthread.php?t=1327741
Alright, I put in:
c:\Users\User\Deskstop\Exploit\adb push zerg /data/local
c:\Users\User\Deskstop\Exploit\adb push su /data/local
c:\Users\User\Deskstop\Exploit\adb push superuser.apk data/local
c:\Users\User\Deskstop\Exploit\adb shell
And then I put in all the commands you gave and..."rm failed"
lilhaiti said:
Hey shadetree mechanics keep cars running
Sent from my MB865 using xda premium
Click to expand...
Click to collapse
I know, I was a shadetree auto mechanic myself for a couple years (now I'm a heavy equipment diesel technician...intern). I'm just trying to say that I'm not literate enough to be a developer or anything, but at the same time I know more than your average user.
JDtech1701 said:
Alright, I put in:
c:\Users\User\Deskstop\Exploit\adb push zerg /data/local
c:\Users\User\Deskstop\Exploit\adb push su /data/local
c:\Users\User\Deskstop\Exploit\adb push superuser.apk data/local
c:\Users\User\Deskstop\Exploit\adb shell
And then I put in all the commands you gave and..."rm failed"
Click to expand...
Click to collapse
can you paste the output for me, so I can point you to the next step, or give me the exact error that rm showed? If I can get than I can help you move forward.
It looks like you were having an issue with a previous attemp at root, and there are some temp files we will need to find and remove first before you can try to root again.
Sure!
C:\Users\User\Desktop\Exploit>adb shell
shell(character I don't recognize)edison:/$ su
su
su: not found
shell(" ")edison:/$ cd /data/local
cd /data/local
shell(" ")edison:/data/local$ rm ./tmp/*
rm ./tmp/*
shell(" ")edison:/data/local$ rm ./tmp/*.*
rm ./tmp/*.*
rm failed for ./tmp/*.* No such file or directory
shell(" ")edison:/data/local$ rm ./tmp
rm ./tmp
rm failed for ./tmp, Is a director
shell(" ")edison:/data/local$
JDtech1701 said:
Sure!
C:\Users\User\Desktop\Exploit>adb shell
shell(character I don't recognize)edison:/$ su
su
su: not found
shell(" ")edison:/$ cd /data/local
cd /data/local
shell(" ")edison:/data/local$ rm ./tmp/*
rm ./tmp/*
shell(" ")edison:/data/local$ rm ./tmp/*.*
rm ./tmp/*.*
rm failed for ./tmp/*.* No such file or directory
shell(" ")edison:/data/local$ rm ./tmp
rm ./tmp
rm failed for ./tmp, Is a director
shell(" ")edison:/data/local$
Click to expand...
Click to collapse
Ok, good lets try this to remove the tmp directory.
adb shell
cd /data/local
rm -r ./tmp/
If that does not work install the root explorer app from the adroid market
https://market.android.com/details?id=com.speedsoftware.rootexplorer&hl=en
and locate the /data/local directory and then delete the tmp directory there. This will be the easiest way to remove that stubborn old tmp directory and those files that are holding you up from getting root. Once you have that done try the oneclick again, from here:
http://forum.xda-developers.com/showthread.php?t=1327741
In my experience, deleting the sh and boomsh files is sufficient to enable zergrush to run again. I didn't have to delete the tmp directory itself.
This would've been done in the step you already ran
Code:
shell(" ")edison:/data/local$ rm ./tmp/*
jimbridgman said:
and locate the /data/local directory and then delete the tmp directory there. This will be the easiest way to remove that stubborn old tmp directory and those files that are holding you up from getting root. Once you have that done try the oneclick again, from here:
http://forum.xda-developers.com/showthread.php?t=1327741
Click to expand...
Click to collapse
OK download the moto drivers. 32x or 64x.
Then get the zip file from the root link I'm this forum it should be a batch file your run. It opens a cmd window and follow the steps.
Profit.
It was super easy phone reboots and your rooted on the stock firmware. Pm me of you need the files for some reason I have them.saved in my mass android folder.
Best of luck.
Sent from my Rooted MB865 using XDA App
jimbridgman said:
Ok, good lets try this to remove the tmp directory.
adb shell
cd /data/local
rm -r ./tmp/
If that does not work install the root explorer app from the adroid market
https://market.android.com/details?id=com.speedsoftware.rootexplorer&hl=en
and locate the /data/local directory and then delete the tmp directory there. This will be the easiest way to remove that stubborn old tmp directory and those files that are holding you up from getting root. Once you have that done try the oneclick again, from here:
http://forum.xda-developers.com/showthread.php?t=1327741
Click to expand...
Click to collapse
Uh...are you sure I should remove the tmp directory? It looks like it's got some important stuff in there. Wait...is "tmp" short for temporary?
JDtech1701 said:
Uh...are you sure I should remove the tmp directory? It looks like it's got some important stuff in there. Wait...is "tmp" short for temporary?
Click to expand...
Click to collapse
Yes, but this is not the OS temporary directory, just the one that is, I am guessing in /data/local, or where you copied those files to... I am guessing since you don't have root yet that, that is not /, because then ./tmp would be /tmp (the OS temporary directory, we don't want to remove that one)..... but I am guessing that is not the case since you don't have root.
Yeah I am pretty sure it is safe... I work with UNIX and Linux for a living, and Android happens to be a form of Linux.
Like others have posted, you might be able to try the root process again, since the files that zerg was complaining about are now gone, from the rm ./tmp/* command you ran before... I was just trying to be very thorough.
Okay, I got that Root Explorer and went into tmp and did select all and delete. Now there's .. Parent folder, .X11-unix, appicon, and commdrv left. I tried doing the adb push zerg all the way down to ./zerg as listed in the How To you linked...and it gave me the exact same result. And when I opened Root Explorer, I went straight to tmp. I tried going to the data folder but it said my phone needed to be rooted first. Okay, figuring this app out...yeah, I went to /tmp. I'm not going to be able to access /data/local without rooting it first.
both the 1-click and the manual process fails for me too. I have tried deleting all the files and directory as well and it still doesn't work. When I run either ./zerg or ./zergRush it both fails with the message "Hellion with Blue Flame". Any help would be appreciated.
bbygfy said:
both the 1-click and the manual process fails for me too. I have tried deleting all the files and directory as well and it still doesn't work. When I run either ./zerg or ./zergRush it both fails with the message "Hellion with Blue Flame". Any help would be appreciated.
Click to expand...
Click to collapse
Which system version are you running.... You can find this out by going into settings --> About phone; then give me the text under System version. It should be something like 55.11.16.MB865.ATT.en.US.
Jim
55.11.16.MB865.ATT.en.US
Thanks!

[Q] ADB Push multiple files (of same type) to /sdcard

Hello.
I have some files that I want to push inside the /sdcard.They are all of the same type (.img).Here is what I am experiencing:
Code:
adb push *.img /sdcard
returns the adb command help... doesn't work obviously
If I put all the files inside a folder (eg. img):
Code:
adb push C:\Nexus/img /sdcard/
it starts copying all the contents of the img folder to /sdcard (adb ls /sdcard/ confirms so)
now if I want to remove those files from /sdcard, since they happen to have the same extension:
Code:
adb shell rm /sdcard/*.img
and all these image files (.img) are removed - the wildcard now is working.
Now is this normal behaviour or am I missing something? I mean is it that ADB command does not support wildcards?
If so copying the contents of a folder is it the only way to mass copy from PC to the phone?
Thank you.
Yea i believe it will only push or pull a full folder or a specific file.. but thats the beauty of it.. dump all the files you want in a folder and push it right where you want them
Based on my very limited experience, wildcards are not supported by push/pull commands, but you can pass along anything you want through "adb shell" and wildcards will be processed as expected.
-- Sent from my TouchPad using Communities
Yes I 've searched a lot myself and seems the only way is the "copy to folder" trick.Thanks for your input.
*Puzzled why they didn't include that option inside the command*
Can I change permissions of several Files that I have pushed into a system folder ??
DJLamontagneIII said:
Yea i believe it will only push or pull a full folder or a specific file.. but thats the beauty of it.. dump all the files you want in a folder and push it right where you want them
Click to expand...
Click to collapse
:good:Information shared on this thread is useful to me..
I come to understand that I can push multiple files to /system/<directory> using following command
Can I do this:
Copy all file to a folder and then copied the whole folder to adb.exe directory. sy my Folder name is "MoveAll" in C:\<adb directory)
adb push MoveAll system/app (got root access and remount rw to do this)
or
adb push MoveAll system/lib
Now my question is that can I change the file permissions as well in on shot ???
adb shell chmod 644 /system/app/*.apk (if all files that i copied are .apk files)
or
adb shell chmod 644 /system/lib/*.so (if all files that i copied are .so files)
................................will it work ???
A little help on this would be highly appreciated. Thanks in advance !!! :good:
VioletR said:
:good:Information shared on this thread is useful to me..
I come to understand that I can push multiple files to /system/<directory> using following command
Can I do this:
Copy all file to a folder and then copied the whole folder to adb.exe directory. sy my Folder name is "MoveAll" in C:\<adb directory)
adb push MoveAll system/app (got root access and remount rw to do this)
or
adb push MoveAll system/lib
Now my question is that can I change the file permissions as well in on shot ???
adb shell chmod 644 /system/app/*.apk (if all files that i copied are .apk files)
or
adb shell chmod 644 /system/lib/*.so (if all files that i copied are .so files)
................................will it work ???
A little help on this would be highly appreciated. Thanks in advance !!! :good:
Click to expand...
Click to collapse
What operating system do you use on your computer?
I test with:
Code:
adb push *.img /sdcard
Code:
adb push C:\Nexus/img /sdcard/
Code:
adb shell rm /sdcard/*.img
But They do not work. Can you help me???
kid1519 said:
I test with:
Code:
adb push *.img /sdcard
Code:
adb push C:\Nexus/img /sdcard/
Code:
adb shell rm /sdcard/*.img
But They do not work. Can you help me???
Click to expand...
Click to collapse
Hello.
Wildcards (*.fileExtension) do not work with adb or so it seems.You could always use the "copy to folder" trick though.
Put all your images in a folder - I assume you have windows.So:
all images to C:\Images
then open adb and:
adb push C:\Images/ /sdcard/Images/
the above command will copy all the contents of the C:\Images folder (so practically all your images in there) to the /sdcard/Images folder (could be any folder you prefer).
TR-909 said:
Hello.
Wildcards (*.fileExtension) do not work with adb or so it seems.You could always use the "copy to folder" trick though.
Put all your images in a folder - I assume you have windows.So:
all images to C:\Images
then open adb and:
adb push C:\Images/ /sdcard/Images/
the above command will copy all the contents of the C:\Images folder (so practically all your images in there) to the /sdcard/Images folder (could be any folder you prefer).
Click to expand...
Click to collapse
thanks. :X
Now, i can push. ok.
But
adb shell chmod
Click to expand...
Click to collapse
can you show me.
ex:
adb shell chmod 644 /system/app/mp3.zing.vn.apk
adb shell chmod 644 /system/app/mp3.zing.vn.odex
adb shell chmod 644 /system/app/mxtech.videoplayer.apk
adb shell chmod 644 /system/app/mxtech.videoplayer.odex
adb shell chmod 644 /system/app/nct.apk
adb shell chmod 644 /system/app/nct.odex
adb shell chmod 644 /system/app/notepad.color.note.apk
adb shell chmod 644 /system/app/notepad.color.note.odex
adb shell chmod 644 /system/app/Quickofficev5.7.327.apk
adb shell chmod 644 /system/app/Quickofficev5.7.327.odex
adb shell chmod 644 /system/app/Screenshot.ER.PROv2.4.3.2.apk
adb shell chmod 644 /system/app/Screenshot.ER.PROv2.4.3.2.odex
adb shell chmod 644 /system/app/viber.apk
adb shell chmod 644 /system/app/viber.odex
adb shell chmod 644 /system/app/vietmobitv.apk
adb shell chmod 644 /system/app/vietmobitv.odex
adb shell chmod 644 /system/app/yahoo.mobile.apk
adb shell chmod 644 /system/app/yahoo.mobile.odex
adb shell chmod 644 /system/app/youtube.apk
adb shell chmod 644 /system/app/youtube.odex
Click to expand...
Click to collapse
--->>>
adb shell chmod 644 /system/app/*.apk
adb shell chmod 644 /system/app/*.odex
Click to expand...
Click to collapse
kid1519 said:
thanks. :X
Now, i can push. ok.
But
can you show me.
ex:
--->>>
Click to expand...
Click to collapse
Well I am not familiar with multiple permission changes through adb or even shell.Maybe some other more experienced member could help.Or maybe better make a post of your own exclusively for that.

Moto 5g ace_kiev_lineage18.1_/data/media not found

ok ive yet to have to ask any ? on xda yet cause i feel like i dont know jack lol
BUT i do need help wile trying to remember linuix commands for adb shell and trying to replace boot animation.zip ans learned the mv file file2 overwrite/rename (i must say i find sort of retarted,but i dont do this for a living) and relized i had remount system as rw i exit shell heres the super mistake please help b4 i have to restart from stock
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Minimal ADB and Fastboot>adb remount
Using overlayfs for /vendor
Now reboot your device for settings to take effect
remount succeeded
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Minimal ADB and Fastboot>adb reboot
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Minimal ADB and Fastboot>adb devices
List of devices attached
ZY22CCHMQT recovery
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Minimal ADB and Fastboot>adb shell
kiev:/ # cd system/media
cd system/media
/system/bin/sh: cd: /system/media: No such file or directory
2|kiev:/ # cd /system
cd /system
kiev:/system # cd /media
cd /media
/system/bin/sh: cd: /media: No such file or directory
2|kiev:/system # cd media
cd media
/system/bin/sh: cd: /system/media: No such file or directory
On stock, it is located at /system/product/media

Categories

Resources