[q] adb shell - Android Software/Hacking General [Developers Only]

So, you'll have to bear with me because I've only had about 30 minutes worth of exposure with adb and all that goes along with it, but I'm having some trouble with a simple command. I'm trying to change the directory to /sbin/ but the command isn't working. It's keeps telling me "permission denied" Any ideas?
Just to give a liitle background information, I screwed up the partition in my phone and am trying to fix them via http://forum.cyanogenmod.com/topic/6433-solved-messed-up-partitions-on-internal-storage/ . My phone doesn't boot, but I can get in to recovery.
Thanks ahead of time.

Bump? Should I move to a different forum?
Sent from my Incredible.

Related

[Q] Rooting question.. gotta be something simple.

Hey everyone, I know I'm new here.. but I've been searching google and the forums for a while, and I can't seem to pinpoint my problem. (I'm on Froyo)
When I'm at the shell and run rageagainstthecage, it closes the shell.. then I open it again and I'm root. So while root, I copied the contents of Captivate2.2RootPack.zip (su, busybox, sqlite3) to where they are supposed to go, and I chmod'd them to 4755.
However if I reboot my phone and load up the shell again, when I go to "su", it hangs for about 10 seconds and then says "Permission denied".
I obviously missed something.. I just can't figure out what. Anyone have a clue?
Thanks folks.
mmerlina said:
Hey everyone, I know I'm new here.. but I've been searching google and the forums for a while, and I can't seem to pinpoint my problem. (I'm on Froyo)
When I'm at the shell and run rageagainstthecage, it closes the shell.. then I open it again and I'm root. So while root, I copied the contents of Captivate2.2RootPack.zip (su, busybox, sqlite3) to where they are supposed to go, and I chmod'd them to 4755.
However if I reboot my phone and load up the shell again, when I go to "su", it hangs for about 10 seconds and then says "Permission denied".
I obviously missed something.. I just can't figure out what. Anyone have a clue?
Thanks folks.
Click to expand...
Click to collapse
when you type su, do you have your phone screen on? it will prompt you to allow root access, and you have to allow
Haha okay.. I admit that was pretty silly. I did have my screen on but it was locked. When I unlocked it and looked at it, it was asking for permission.
I appreciate it..

Phone won't finish boot process, need urgent help

Alright so looks like I did something completely stupid and now my phone won't finish the boot process. I was looking at some remappings for the recent key to the menu option and from a post in the development section I found a thread in the International One X development forum that had re-odexed files so that the recent key stayed as the recent key and holding the home button became the menu key. Since they were re-odexed and I had root access I figured I would just manually replace them on my phone with Root Explorer...bad idea. The files were:
System/Framework/android.policy.odex
System/Usr/keylayout/qwerty.kl
After I moved them and reset permissions I rebooted my phone and now it goes through the first couple of boot animations but gets stuck on screen that displays beats audio at the bottom.
I really need to know what to do to fix this. When I plug my phone into my computer it recognizes it as a new \drive, but I don't have access to any of it (still says I need to mount). I also have the android SDk and adb installed if thats of any help. I would really like to not lose any data so hopefully thats possible.
Please help me with this if you have any knowledge of what to do.
Just one little quick update. Even though my computer won't let me access my One X as a drive, when I use command prompt and adb to check for adb devices my One X is listed.
Run the at&t ruu exe file, located in the Dev section.
tanman21 said:
Run the at&t ruu exe file, located in the Dev section.
Click to expand...
Click to collapse
Alright I'm downloading that now.
In the meantime, how do I get root access with adb/give it permission to overwrite read only files? I pulled the two files that caused this messed and pulled my backups, but when I push them back to the phone it tells me I can't because their read only. I'd rather do it this way since I will be changing only the files that caused the problem.
EDIT: Is the RUU really going to delete all the information on my device? If thats the case I would really appreciate figuring out how to get adb to push my backuped files to the /system directory instead
ErikWithNoC said:
Alright I'm downloading that now.
In the meantime, how do I get root access with adb/give it permission to overwrite read only files? I pulled the two files that caused this messed and pulled my backups, but when I push them back to the phone it tells me I can't because their read only. I'd rather do it this way since I will be changing only the files that caused the problem.
EDIT: Is the RUU really going to delete all the information on my device? If thats the case I would really appreciate figuring out how to get adb to push my backuped files to the /system directory instead
Click to expand...
Click to collapse
Yeah, the RUU returns your phone to factory (but doesn't touch your personal files)
EDIT: Also, just pulling this off the top of my head so take it with a grain of salt...
adb devices
adb shell
su
*grant the su request on your device*
adb push <from> <to>
stnguyen09 said:
Yeah, the RUU returns your phone to factory (but doesn't touch your personal files)
EDIT: Also, just pulling this off the top of my head so take it with a grain of salt...
adb devices
adb shell
su
*grant the su request on your device*
adb push <from> <to>
Click to expand...
Click to collapse
Thanks for your comment. I used the RUU and it kept my personal data so its not a big lose. Had to reinstall a few apps, but for most of them (games at least) my saved data was still there.
I tried a lot using adb and just couldn't get it to work. I don't the phone got far enough through the boot process for root access to be allowed. I was able to run the one click root tool while it was in its stuck boot phase, but it still wouldn't give me permission to modify the /system portion of the phone to be read/write.
All in all though this was a great learning experience. Prior to this happening I knew nothing about adb and now I know commands for pulling, pushing, remounting, shell commands, and other things. I also learned how to fix a softbrick (first one) and what RUU is.

[Q] Won't turn on properly after installing custom boot animation

I installed a custom boot animation and now my phone won't boot up properly. The animation won't show during boot and basically after the galaxy sIII screen, nothing is shown. The phone seems to be started okay, I hear sounds and vibration when I press buttons, but the screen just is not showing anymore.
I'm trying to boot to recovery and use adp to either delete the bootanimation.zip or push a different version, but I get the device not found error.
PLEASE HELP!!!
ned4spd8874 said:
I installed a custom boot animation and now my phone won't boot up properly. The animation won't show during boot and basically after the galaxy sIII screen, nothing is shown. The phone seems to be started okay, I hear sounds and vibration when I press buttons, but the screen just is not showing anymore.
I'm trying to boot to recovery and use adp to either delete the bootanimation.zip or push a different version, but I get the device not found error.
PLEASE HELP!!!
Click to expand...
Click to collapse
How'd you install it? Do you have a link to what you flashed?
Sent from my SCH-I535 using xda app-developers app
ajrty33 said:
How'd you install it? Do you have a link to what you flashed?
Sent from my SCH-I535 using xda app-developers app
Click to expand...
Click to collapse
Thanks, but I finally got it figured out. Scarred the crap out of me for a minute there though!
I was able to run "adb push bootanimation.zip /system/media" and it works after reboot. I couldn't get it working in recovery, but was able to with the phone started like "normal".
Not sure what was wrong with the other version of the bootanimation to totally killed the screen though. The only thing I can think of is there was zip compression on. But I would have thought that wouldn't kill the entire screen like that! Dunno.
I am have execet same issue please help
ned4spd8874 said:
Thanks, but I finally got it figured out. Scarred the crap out of me for a minute there though!
I was able to run "adb push bootanimation.zip /system/media" and it works after reboot. I couldn't get it working in recovery, but was able to with the phone started like "normal".
Not sure what was wrong with the other version of the bootanimation to totally killed the screen though. The only thing I can think of is there was zip compression on. But I would have thought that wouldn't kill the entire screen like that! Dunno.
Click to expand...
Click to collapse
So I am experiencing same issue I can please be little be more detailed how you pushed the bootanimation. except command. please i am panicking i know there is a solution but i just cant seem to make it work. You help would be much appreciated. thank you!
MyMymusicIsSoHard said:
So I am experiencing same issue I can please be little be more detailed how you pushed the bootanimation. except command. please i am panicking i know there is a solution but i just cant seem to make it work. You help would be much appreciated. thank you!
Click to expand...
Click to collapse
Sorry, it's been so long I can barely remember this! I think what I did was pretty much as I described. I booted the phone up, waited for a little bit to make sure it was all the way started since I couldn't see the screen. And then plugged in the cable and performed the push command. It was pretty straight forward as long as you can ignore the fact that the screen wasn't displaying anything.
Had to flash the fireware
ned4spd8874 said:
Sorry, it's been so long I can barely remember this! I think what I did was pretty much as I described. I booted the phone up, waited for a little bit to make sure it was all the way started since I couldn't see the screen. And then plugged in the cable and performed the push command. It was pretty straight forward as long as you can ignore the fact that the screen wasn't displaying anything.
Click to expand...
Click to collapse
So my Debugging mode was off so I could not use adb push command, I had to do a complete firmware flash, that got my phone to work but lost all my data on the phone. but still a happy camper.
Thank you for prompt response, all your help it's much appreciated.
I had the same problem but with an ASUS memo pad hd7. I downloaded a bootanimation.zip that was the wrong orientation, so I unzipped it, rotated all the pictures rezipped and placed it back in /system/media/. Mistake! After that the device would not boot! At least that's what I thought until a quick google search led me here, thanks for your help! My situation was a little different, i'll explain my journey below in case it helps others with similar situations.
Installed minimal ADB and Fastboot from here http://forum.xda-developers.com/showthread.php?p=42407269 . I already had the device drivers installed on my computer so I skipped that step. Luckily I had USB debugging selected, however, I had never used ADB and had not given it SU permissions on the tablet. I input the following code into adb:
adb shell
cd /system/media/
ls
This verified that the offending bootanimation.zip was in there. I then tried to remove the offending bootanimation.zip with this command
rm bootanimation.zip
It failed because system was mounted as Read Only and I could not change it because I did not have SU permissions so I hit the power button on my tablet to wake it up, blindly swiped to get through the lock screen, and typed this into ADB to request Super User permissions
su
I then blindly tapped near the middle of my screen. After a few tries I successfully hit the right spot at the right time and granted SU to ADB
Once that was done I remounted system as read write and deleted the offending file with this code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock0 /system
rm bootanimation.zip
ls
After verifying that bootanimation.zip was gone, I rebooted the tablet and was greeted with success in the form of some generic Android boot animation.
Same thing with my Panasonic p11 and I have a password for SuperSU so I am stuck pls help
I would suggest flashing a backup from before the custom boot animation. Then taking more cautious steps the next time you try.
To avoid this kind of unpleasantness, whether for changing the boot animation or anything else, here's a few tips:
always root your phone
It's your phone, you should have access to everything, shouldn't you? That's like buying a new car and the dealer won't give you a key for the trunk.
always use a custom ROM
Stock ROMs are usually bloated with apps you don't need and can't uninstall. Also, stock ROMs often disable features and access either "for your own good" or to keep the interface simpler. Case in point, neither of the stock ROMs that came with my Galaxy S4 or my Atrtix HD allowed me to customize the LED notification light. Whatever defaults they picked, that's what I got. A flashing green light meant I received "something" (text or email). There are a variety of 3rd party ROMs out there ready to flash for a specific device, find one that you like.

[Q] Continuous Force Closes

I've recently started having problems after changing ROMs a couple of times.
I tried installing a new Rom (CM12.1) but it is still happening and I've installed a new GAPPS each time too so I guess the problem runs deeper than that.
The ROM runs fine for a bit but then all of a sudden I get a force close which constantly keeps coming up no matter how many times I press 'Ok'.
I've had a few different processes stop but the last two that spring to mind are 'process.android.phone', 'Swiftkey' and 'Google Play'.
I have to reboot but then end up stuck at the splash screen at boot. I then have to Power+Vol Down to go into recovery and then reboot system from there. It then runs through the App optimisation screen brfore restarting.
I've never touched kernels since I've been changing ROMs so whether thats the issue.
Any help with this would be great as otherwise this is the best Rom Ive used.
Thanks in advance
A logcat showing traces of these force closes would help
Aquous said:
A logcat showing traces of these force closes would help
Click to expand...
Click to collapse
I didnt do one on account of me not having a clue what the hell one was
Luckily my friend Google does know what the hell one was.
I've attached a couple of log files created around the time of the unpleasantries which hopefully might shed some light.
This one attached might be better, this was taken after I sorted out my Root Access again so might have more info.
Regards
Looks like a resources issue. Are you running any custom CM10 theme? What happens if you install such a theme providing an icon pack?
Aquous said:
Looks like a resources issue. Are you running any custom CM10 theme? What happens if you install such a theme providing an icon pack?
Click to expand...
Click to collapse
Hi, thanks for your reply. I havent been near any other custom themes. I've had this problem over a couple of Roms too.
I've tried to generate a catlog to get some error messages around the time its happening but I keep getting constant force close boxes which stop me doing anything (for a couple of different processes). The only way to stop them is to reboot but then the logs stop and reset when it boots so I cant get the info.
I've had to reboot about three times today and each time it has had to optimize the apps for some reason.
I've tried to get a catlog through ADB but I cant run the Android SDK as I need to install the JDK which keeps giving me 'Error 1500' on the install (even though I am most definately not already trying to install it).
Thanks for your help so far though and taking the time to read through the previous log.
Every solution I try just seems to create more problems
I've managed to attach a text file of all the error files its had since it started up (they are all in the space of about 10mins)
I'm not seeing any force closes in there. In your previous log, I saw these lines:
Code:
07-15 18:24:07.919 W/ResourceType(2356): No package identifier when getting value for resource number 0x00000000
07-15 18:24:07.919 W/PackageManager(2356): Failure retrieving resources for [insert any package here basically]: Resource ID #0x0
which led me to identify resources (i.e. icons, drawables, etc) as your culprit.
What we need to do with that information, I wouldn't know. Ask the rom dev, I suppose?
Aquous said:
I'm not seeing any force closes in there. In your previous log, I saw these lines:
Code:
07-15 18:24:07.919 W/ResourceType(2356): No package identifier when getting value for resource number 0x00000000
07-15 18:24:07.919 W/PackageManager(2356): Failure retrieving resources for [insert any package here basically]: Resource ID #0x0
which led me to identify resources (i.e. icons, drawables, etc) as your culprit.
What we need to do with that information, I wouldn't know. Ask the rom dev, I suppose?
Click to expand...
Click to collapse
Well I'm assuming their force closes. I get a white box popping up that says 'unfortunately XXXXX has closed' and when I click 'ok' the box goes away but either comes straight back or another similar one pops up. Its Trebuchet quite a lot.
I can't do anything then, if I try to get to LogCat that closes too and I can't really do anything until I reboot.
Its happened over 3 different Roms so dont think theres much the Rom compiler (is that what they're called, lol) can do.
I'm am probably going to have to see if I can get a Log through ADB, if I can remember how to use it, when I have time.
Cheers
I've managed to connect the tablet through ADB and managed to get some errors taken at the time I started getting all the 'Unfortunately XXXXX has closed [ok]' boxes kept coming up.
All the error messages attached came up in the space of a few seconds.
Ahh, now this is interesting. The main cause of your problem is that your filesystem is remounted read-only, which Play Store Services doesn't like.
As to why this is going on I can only guess, but it's possible that it's due to filesystem corruption. Can you try running fsck from recovery?
Aquous said:
Ahh, now this is interesting. The main cause of your problem is that your filesystem is remounted read-only, which Play Store Services doesn't like.
As to why this is going on I can only guess, but it's possible that it's due to filesystem corruption. Can you try running fsck from recovery?
Click to expand...
Click to collapse
Hi,
Thanks for looking through them errors.
To be honest I haven't heard of fsck. Is it something I can pick up fairly simply or am I more likely to do more damage? I've done a few searches and it looks a bit difficult and couldn't really find any threads that sounded similar to what I might need.
Thanks again
Update : I've gone into recovery and found files in /system/bin called fsck.exfat and fsck.f2fs is it a case of running a command through terminal command in recovery from this directory?
Fsck is the linux file system checker. The binary is named e2fsck. I think the command should be:
Code:
e2fsck -pv /dev/block/platform/omap/omap_hsmmc.1/by-name/DATAFS
This will try to automatically fix any errors (be sure to note whether there are any). If it complains about unexpected inconsistencies, you'll need to remove the 'p' argument to prevent it from trying to do any automatic fixing.
Note: the whole point of this command is to check and, if needed, modify low-level filesystem structures, so there is a risk of data loss on your DATAFS (i.e. /data) partition.
Be sure to note if there are any errors. If there are, we need to investigate where those are coming from. If not, something else is causing your fs to remount readonly (because THAT is ultimately what is triggering your system to flip out).
(Apologies for the delay, it's been a busy week)
Aquous said:
Fsck is the linux file system checker. The binary is named e2fsck. I think the command should be:
Code:
e2fsck -pv /dev/block/platform/omap/omap_hsmmc.1/by-name/DATAFS
This will try to automatically fix any errors (be sure to note whether there are any). If it complains about unexpected inconsistencies, you'll need to remove the 'p' argument to prevent it from trying to do any automatic fixing.
Note: the whole point of this command is to check and, if needed, modify low-level filesystem structures, so there is a risk of data loss on your DATAFS (i.e. /data) partition.
Be sure to note if there are any errors. If there are, we need to investigate where those are coming from. If not, something else is causing your fs to remount readonly (because THAT is ultimately what is triggering your system to flip out).
(Apologies for the delay, it's been a busy week)
Click to expand...
Click to collapse
Hi,
No worries mate, I wasn't sure if what I said didn't make sense thats why there were no replies
The problem seems to be a lot better now but I've still had it a couple of times over the last two days.
I've tried to run the command above but with no joy. I'm still only learning the basics of ADB so still having some trouble.
I wasn't sure exactly where to run the commands from through the SDK so just went to the Terminal Command in Recovery and after navigating to the system/bin folder tried that command but it came up with the following:
/dev/block/platform/omap/omap_hsmmc.1/by-name/DATAFS is in use
esfsck: cannot continue, aborting
I apologise if some of what I am doing seems nonsense but I am trying to pick up what I can by myself from various sketchy threads to avoid being a 'tell me what to do cos I can't be bothered looking myself' person. I dont know if this is doing more harm then good
Thanks again in advance for your help.
You cannot check a filesystem while it is in use. Solution: boot to recovery (sorry, I should have specified), then make sure your data partition is not mounted (in CWM it isn't by default, which is good). Then it should be able to run.
(so: boot tablet to recovery, on computer run 'adb shell', in adb shell copy/paste the actual fsck command)
Aquous said:
You cannot check a filesystem while it is in use. Solution: boot to recovery (sorry, I should have specified), then make sure your data partition is not mounted (in CWM it isn't by default, which is good). Then it should be able to run.
(so: boot tablet to recovery, on computer run 'adb shell', in adb shell copy/paste the actual fsck command)
Click to expand...
Click to collapse
For some reason I cannot get my PC to pickup the tablet in a command window when in TWRP so I was unable to run through ADB. 'ADB Devices just did not show anything.
In the end I did it all on my tablet in TWRP through the 'Command Terminal'. I navigated to the necessary folder (the one with fsck.exfat and fsck.f2fs in - /system/bin) through the Command Terminal and after typing the command in I got the following:
/dev/block/platform/omap/omap_hsmmc.1/by-name/DATAFS clean, 9086/791520 files, 694414/3160055 blocks
Is that good?
It means that your emmc is fine and that there's a different reason why you're getting force closes. Can you post a dmesg next time it happens?
Aquous said:
It means that your emmc is fine and that there's a different reason why you're getting force closes. Can you post a dmesg next time it happens?
Click to expand...
Click to collapse
Hi, yea sure. I could use a bit of guidance with exactly how to do that though. I take it that is something I would have to run through ADB from my PC before I reset my tablet? Step by step instructions would be appreciated a lot (as has your extensive help already, creep creep ).
Boot to normal android. Wait until you start getting force closes. Stick your tab into your computer, run 'adb shell', then run 'dmesg'. If it says permission denied, run 'su' first and then run 'dmesg' again. Post the output.
Aquous said:
Boot to normal android. Wait until you start getting force closes. Stick your tab into your computer, run 'adb shell', then run 'dmesg'. If it says permission denied, run 'su' first and then run 'dmesg' again. Post the output.
Click to expand...
Click to collapse
Right, first thing this morning I had some errors, so I've managed to paste the results of a dmesg into the log file attached.
Cheers!
Hmmmm, now this is interesting. It looks like random services are failing to load - they are immediately exiting after being restarted. This is basically the same problem as with your apps force closing - something at the lower layers is causing everything to crash immediately upon launch.
Yet you're able to run basic programs (e.g. adb, dmesg) just fine, meaning that it's not likely to be a hardware issue.
What happens if in adb shell you run su and then 'stop' followed by 'start'? What should happen: when you run 'stop', the whole system freezes, and when you run 'start', you see your boot logo and android starts booting up again. Is this indeed what happens in this case, or do you get a bootloop? If so, post another logcat when you're stuck in the loop; you can get out of it by simply entering 'reboot' in your still-open adb shell.

Frozen boot animation no recovery out of space all files/folders read only...more...

Jp5 tablet jail broke rooted android jellybean. Stuck on frozen boot animation, all files and folders read only, won't chmod or chown (permission denied) out of space message when trying to push, won't pull...adb server won't start tried the. Setprop persist etc. No result. Am won't work pm returns segmentation fault. VM returns 1. Kill all won't work. Wipe all permission denied. Won't master clear etc etc etc...can access via emulator and USB cable but can only look around. Data directory won't ls permission denied. SDcard isn't showing up when ls in /. What else can I add....basically screwed but still persistent and hopeful. please help me, no screenshots available. Oh and tried the rm rf/data* (not sure I wrote that right) in an attempt to free up space to push a service jar, no success. An error shows up in log cat re android os. Hmm, think that's all I remember off the top of my head. There are more errors and faults. Could possibly be related to the ''raccoon'' thing in system/bin I was messing with adb and was curious. Maybe or not. Maybe something else. Help and thanks.
Jason965 said:
Jp5 tablet jail broke rooted android jellybean. Stuck on frozen boot animation, all files and folders read only, won't chmod or chown (permission denied) out of space message when trying to push, won't pull...adb server won't start tried the. Setprop persist etc. No result. Am won't work pm returns segmentation fault. VM returns 1. Kill all won't work. Wipe all permission denied. Won't master clear etc etc etc...can access via emulator and USB cable but can only look around. Data directory won't ls permission denied. SDcard isn't showing up when ls in /. What else can I add....basically screwed but still persistent and hopeful. You can email me [email protected]. please help me, no screenshots available. Oh and tried the rm rf/data* (not sure I wrote that right) in an attempt to free up space to push a service jar, no success. An error shows up in log cat re android os. Hmm, think that's all I remember off the top of my head. There are more errors and faults. Could possibly be related to the ''raccoon'' thing in system/bin I was messing with adb and was curious. Maybe or not. Maybe something else. Help and thanks.
Click to expand...
Click to collapse
Jelly bean and phones that used jelly bean are no longer viable for today's systems, they are way too un-secured and are severe risks to your personal information, privacy and home network security. Not to mention, most of today's apps are not compatible with Jelly Bean.
Sent from my SM-S767VL using Tapatalk
Thank you for your reply
I understand I am using obsolete technology, but this is all I have and I am desperate for a solution. I cannot afford anything else. If someone could at the very least explain how to get around the permission denied so I can wipe it, I will be able to reinstall everyrthing else. Thank you for your time and attention to my plight.

Categories

Resources