Android shutdown process - General Questions and Answers

Where would the shutdown script be located ?
I want to add a simple unix command as the last thing before a shutdown just to understand where and how the Android system shuts down.

I too am curious about this one...

Any news on that?
I'd like to shutdown a phone properly from terminal app.
reboot seems to be "hard" reset without shuting down

Related

SDcard for apps not possible

From what I can tell anyway. I was working on this, and I had it working up until installing a new app from the Market. Here's the tutorial I wrote:
Code:
Note1: This process can brick your phone, and it can crash the Android OS. Please use with caution, and know that you are responsible for your own actions, not me, nor anyone else.
Note2: If the Android OS does crash (signified by the Android loading screen, with the flashing Android logo) a factory reset is your best option. It saved me a few times when working on this process.
Note3: Note that a fresh start (factory reset phone) is best for this process, as it changes where all apps are going to be stored and used from.
Note4: Your SDcard cannot be accessed when the USB cable is plugged into your computer, so note the apps will not work/will not work well if you are connected to a PC.
Get root
In terminal:
1. su
2. cd data
3. mkdir /sdcard/data/app
4. mkdir /sdcard/data/app-private
5. mv app app2 (don't want to delete the directory terminal is running from, also kept for backup)
6. mv app-private app-private2
7. ln -s /sdcard/data/app app
8. ln -s /sdcard/data/app-private app-private
And bam! Done.
I then used adb push/pull to backup the app and app-private directories to the SDcard. (just in case, for the terminal app. And I tried this process with and without this step, so I know it isn't this messing it up)
Now Terminal Emulator runs, as well as everything else, but when I download/install a new app, my phone freezes as it goes to install it, and then crashed and goes to the Android OS loading screen forever.
I also worked on this and ran into the same problems you have...I know that there are some other folders that deal with the apps we download from android market.. One of the problems you may be having is that when installing there is an intitial setting up communication that is trying to occur between the downloaded apps, /sdcard/app, and other folders on the phone. When the sdcard/app trys to communicate back with the other party, your errors occur and you crash....I would suggest doing this again, hooking your phone up to DDMS and reproducing the crash again so that you can see what is throwing the errors...that may give you a better idea of what else needs to be done....
I would love to help in any way possible as I was working on this as well, btw, when you get stuck at the flashing android, there is no need to do a reboot, you can plug your phone into your computer and run the adb shell even though it isn't booting up. Since you can run the adb shell, you can fix the problem. Also, you could run DDMS to see what is keeping it from booting as well.
Me too!
I'm working on this as well, I will relay any progress I make, hope you will do the same.
Thanks!
Phromik said:
Now Terminal Emulator runs, as well as everything else, but when I download/install a new app, my phone freezes as it goes to install it, and then crashed and goes to the Android OS loading screen forever.
Click to expand...
Click to collapse
one question .. why are you trying to install apps to /sdcard??
This is an old thread that got bumped. This is not the way to go about getting apps to install to the sd-card.

[HowTo] Remove boot sound from HTC Desire (rooted)

If, like me, you strongly dislike the HTC "Quietly brilliant" boot sound, here's how to disable it entirely:
Pre-requisites:
Put your phone into recovery
Get a working adb shell
Mount /system
Code:
mount /system
Move the sounds out of the way
Code:
mv /system/customize/resource/android_audio.mp3 /system/customize/resource/android_audio.mp3.nothanks
Code:
mv /system/media/android_audio.mp3 /system/media/android_audio.mp3.nothanks
I didn't really want to install an application to do "silent" the boot up, and was actually worried about the case (by Murphys law) that I drop my phone, the battery comes out, I insert it (forgetting it wasn't on silent) and the boot sound causes my death.
I Google'd for quite a while with no luck, but sorry if this has been posted somewhere. I especially didn't want to change ROMs just to remove the sound. I also noticed that in both locations, bootanimation.zip existed which contains the frame-by-frame sequence for the boot up screen.
Thanks! It worked perfectly.
Nice guide.
For anyone wanting to change the boot animation, see this thread:
http://forum.xda-developers.com/showthread.php?t=672339
I've changed mine to the Nexus One boot animation. Sweet
Great! it worked, cheers.
jayshah said:
and the boot sound causes my death.
Click to expand...
Click to collapse
I have a 6 weeks old daughter, after rooting my desire i had a quietly brilliant loop lol, never ran so fast out of the room before
Thanks for the tweak.
No root Needed! Juste install "Silent Boot" on the Market!
http://www.androlib.com/android.application.com-antweb-silentboot-BnqC.aspx
Dj!pOner said:
No root Needed! Juste install "Silent Boot" on the Market!
http://www.androlib.com/android.application.com-antweb-silentboot-BnqC.aspx
Click to expand...
Click to collapse
If you read the OP properly, you'd have realised why I didn't want to install an application for this purpose.
"Silent Boot mutes your Phone on shutdown to keep it silent on boot.
Restores previous volume settings after startup."
You drop the phone. The battery comes out. You need to boot the phone silently or you forget until its too late. Epic fail.
Hi,
this is something that I would like to do, but even the command "working adb shell" throws me.
I have rooted my phone ok, so is it a simple process that I can do, or should I avoid it?
Is there an idiots guide to starting out?
TIA
put it in recovery via the pushfiles, then in windows open a command (cmd.exe). Navigate to the android-sdk folder (if not installed download it), then cd tools, then adb.exe I think. I am a noob to... Plz correct if this is wrong
ShugM said:
Hi,
this is something that I would like to do, but even the command "working adb shell" throws me.
I have rooted my phone ok, so is it a simple process that I can do, or should I avoid it?
Is there an idiots guide to starting out?
TIA
Click to expand...
Click to collapse
All you have to do is:
- Put your phone into recovery
- Push the files as normal so you can get the menu screen where you can make nandroid backups etc etc (Google for now to get here and/or see MoDaCo).
Now type "adb shell" at a terminal (modify if you are using Windows), just get a # prompt basically.
Then copy/paste the commands.
failed on 'system/customize/resources/android_audio.mp3' - No such file or directory
not sure if that is exactly what you typed, but there's no 's' on the end of resource in the path
jondalar said:
failed on 'system/customize/resources/android_audio.mp3' - No such file or directory
Click to expand...
Click to collapse
You made two mistakes.
There is a / at the beginning (doesn't matter if your cwd is /, but better to have it just in case).
The final 's' in resources being the main error.
jayshah said:
You made two mistakes.
There is a / at the beginning (doesn't matter if your cwd is /, but better to have it just in case).
The final 's' in resources being the main error.
Click to expand...
Click to collapse
Uh-huh... hmmm yup; the 's' in resources was the bingo here. I checked everything and I did write point on everything as it should be .. well except the 's'. Where did it come from, the 's'...
...'xcept now there's a - Read-only file system error. For crying out loud!
jondalar said:
Uh-huh... hmmm yup; the 's' in resources was the bingo here. I checked everything and I did write point on everything as it should be .. well except the 's'. Where did it come from, the 's'...
...'xcept now there's a - Read-only file system error. For crying out loud!
Click to expand...
Click to collapse
Are you running this command while the phone is running?
As it's in /system, your phone has to be in recovery mode setup with the pushfiles. So you have the nandroid menu (for example).
jayshah said:
Are you running this command while the phone is running?
As it's in /system, your phone has to be in recovery mode setup with the pushfiles. So you have the nandroid menu (for example).
Click to expand...
Click to collapse
Omg, I'm a complete and utter idiot. Please disregard all my previous posts!
and thanks for all help and the patience. Worked flawlesly!
Thank you all
I found one of the down sides to apps2sd is that the silent boot app didn't seem to work any more - not sure why but i'm guessing that the sd card is dismounted before the app gets the chance to silence the phone on shutdown, maybe?
Anyway, after much reading and re-reading these instructions i finally found the courage to try using them and finally my phone is booting silently again. VERY happy
Hi,
Done Thanks very much.
My only concern is the intro video is very slow now - causing the entire phone to start up slower....
any ideas?
actually it's a lot easier, and no root needed ;-)
Code:
adb shell cp /system/media/bootanimation.zip /data/local/
This copies the standard boot animation to the location where custom animations can be put. This silences the animation, as the mp3 is not copied to the same location.
I finally registered for the forum, just to say: my GOD, that was a complicated process just to turn off an annoying sound!!
Step 1: Make a gold card (at least 17 steps)
Step 18: Root your phone (around 10 steps; ironically, probably the simplest bit!)
Step 29: Open command prompt and navigate to rooting folder on pc
Step 30: Turn on phone, holding down back button
...
Step 38: Rename the second (backup?!) mp3 file
Step 39: Reboot phone.
OR
Step 1: Live in a universe where phone manufacturers realise that not everyone wants to wince when they turn their phone on.
Step 2: Go to the settings and turn off the startup animation.

[Q] TF boots, flashes locked screen for a second and shuts down! :(

Hello friends, Please note that i tried installing ClockworkMod 3.1.0.1 but it refused to setup for some reason, even though i did everything right i.e. holding down the down vol key and power button etc but like others i only get the green android with the exclamation mark in the middle, so i do not have a backup unfortunately ;(
Anyway the story starts here:
Please be patient with me though as i am new to all this but learning fast.
Got a new Asus transformer TF101 (with keyboard) for only 5 days with
Device serial: B70KAS3?????
Build number: HMJ37.WW_epad-8.4.4.11-20110711
Android version: 3.1
Didnt know about Razorclaw ability to root B70 :-(
Anyway on going online on the TF101 for the first time, I immediately got a message saying there was a new os update available, the TF101 auto downloaded it and i then immediately updated it, thinking that the new update was best for me :-(
After the update, i then had -
Build number: HTK75.WW_epad-8.6.5.21-20111216
Android version: 3.2.1
Razorclaw doesnt work on my TF101 however i was able to use use the WW_epad-user-8.6.6.19.zip update on it and then was able to root using Razorclaw.
After that everything worked fine until i used 'Rom Manager' to create a script that was to change my hostname to my preferred one instead of the usual 'android_????????????', i then set it to do so on boot within 'Rom Manager'.
I then used 'Rom Manager' 'reboot' script to reboot the TF and now it boots then flashes locked screen for a second and shuts down and the same thing happens when i power it up again
If i am lucky and quick, i can put in the password and see the desktop just before it shuts down.
I have a feeling it the script i created and set to execute on boot is what is causing the shutdown.
Is there anyway to fix this?
It not a low battery issue, already checked that.
Was thinking along the lines of a key combination to prevent scripts running on boot time.
Dont really want to wipe the TF, as it already taken me 5 days to get it setup how i want it and now this!
It sounds like you have a stock recovery and a buggered up system.
You might be able to recover with adb, but you'll have to know what to stop/kill before it reboots. If it's enable, adb will be active well before you see the lock screen. There might also be some tools in the android sdk, perhaps ddms.
What exactly is in this rom manager script? Perhaps it is passing a reboot via one of the partitions. You would need to clear the command to stop the reboots or just kill the process that is rebooting.
That's all I gots. Good luck!
gee one said:
It sounds like you have a stock recovery and a buggered up system.
You might be able to recover with adb, but you'll have to know what to stop/kill before it reboots. If it's enable, adb will be active well before you see the lock screen. There might also be some tools in the android sdk, perhaps ddms.
What exactly is in this rom manager script? Perhaps it is passing a reboot via one of the partitions. You would need to clear the command to stop the reboots or just kill the process that is rebooting.
That's all I gots. Good luck!
Click to expand...
Click to collapse
thanx for responding mate...appreciated.
the script is just a simple script with just one line with tr3ble being the new hostname, its exactly as below:
setprop net.hostname tr3ble
I'll have a tinker with adb but what how do i search for processes to stop/kill using adb as im not that clued up with linux commands
I'm not a pro either, but I think "ps" will show you the process and "kill <pid>" will kill them. There might be a better way and I haven't tested this, so if you end up in a worse situation than then one you are in, it's all on you.
I don't think that changing the hostname will cause a reboot. I think the "reboot" command from rom manager is somehow stuck. I think it passes a reboot command via one of the partitions so that it can "find" it when it restarts. You would just have to clear the command. I think it's somewhere in the /cache directory, but that is just a guess.
gee one said:
I'm not a pro either, but I think "ps" will show you the process and "kill <pid>" will kill them. There might be a better way and I haven't tested this, so if you end up in a worse situation than then one you are in, it's all on you.
I don't think that changing the hostname will cause a reboot. I think the "reboot" command from rom manager is somehow stuck. I think it passes a reboot command via one of the partitions so that it can "find" it when it restarts. You would just have to clear the command. I think it's somewhere in the /cache directory, but that is just a guess.
Click to expand...
Click to collapse
Wow...you are definitely pointing me in the some direction though, in the begining i didnt have a clue what to do and where to look but now i have a few things to try...i'll see how things go with adb and report back.
Thank you for your time and patience mate
Update:
I tried everything i could but just didnt seem to have much time to do much using adb so i bit the bullet and did a data wipe, but to my joy, after the data wipe the TF was still rooted and my adhoc hack was still in place. If only took me bout an hour to then reinstall all my apps, which was more or less easy as i had them all in one folder on my microSD.
So all in all, the data wipe which cured the shutdown after restart wasnt sooo bad afterall.
Thank for your help mate!
....Happy New year!
b00b said:
Update:
I tried everything i could but just didnt seem to have much time to do much using adb so i bit the bullet and did a data wipe, but to my joy, after the data wipe the TF was still rooted and my adhoc hack was still in place. If only took me bout an hour to then reinstall all my apps, which was more or less easy as i had them all in one folder on my microSD.
So all in all, the data wipe which cured the shutdown after restart wasnt sooo bad afterall.
Thank for your help mate!
....Happy New year!
Click to expand...
Click to collapse
Did the same exact procedure when the same thing happened to my TF earlier this month.... Good to know that i wasn't the only one that faced this situation.
Sent from my Transformer TF101 using xda premium

Any boot switcher app/ or a way to boot from file?

I want to boot my phone using a .iso file without modifying my current android system.
Maybe the app asks what system to boot, when the phone is turned on.
Or a command to change boot? Again, without modifying system files/ OS.
Thanks for reading!
Not an option. The devices bootloaders don't work like that a d as the bootloader is closed Sourced per device. You will not find an option.

Recovering files from a boot looped Pixel 4a

Recently updated my Pixel 4a and have run into an issue that causes a strange boot loop to a screen that states "Cannot load Android system. Your Data may be corrupt." and prompts to either factory data reset or try booting again. What's strange is that when attempting to boot it again, it is able to load into the device and I have normal access to the phone for about 30-60 seconds before it restarts and prompts a factory reset again.
My main issue is that I need to backup/upload about 900 photos to google photos that were not saved. So far the phone has been rebooting, connecting to wifi and uploading about 0-3 items to google photos per boot until it restarts. Eventually I may be able to secure all my photos this way but I want to know if there is a more efficient method to do this.
Things to know:
Bootloader is locked (can't unlock due to wipe) -> cannot use custom recovery/ flash twrp
USB debugging is enabled and I have sideloaded the latest OTA (sunfish) via ADB sideload in recovery mode but the boot loop has not resolved.
I can successfully use ADB pull /sdcard/DCIM/Camera for only up to 60 seconds until it force restarts. When I attempt to pull again on the next boot, it will pull the same files because it is copying and not moving them.
Does anyone have a solution to this rather than to just factory reset or continuously rebooting? It is frustrating because I still have access to the phone's files but only for about less than a minute. I have scavenged reddit threads, forums, and google for some way to do this but to no avail. (Also is there a way to use the stock recovery's "mount /system" option?)
It's not very elegant, but I could totally imagine a script that listed the files and then copied a few at a time, waiting for the phone to reboot before continuing...
I have a python script that uses adb to "sync" a directory on the phone with a directory on the PC, but it's doing a push, not a pull.
a1291762 said:
I have a python script that uses adb to "sync" a directory on the phone with a directory on the PC, but it's doing a push, not a pull.
Click to expand...
Click to collapse
I modified my script a bit to pull instead of pushing, it's ... awfully rough (eg. you have to manually create a Camera directory to store the files it copies) but it seemed to work in principle. It might be enough for you, or it might serve as a base for a better solution. No doubt it'll need a few mods anyway, especially if you're on Windows (in which case ls won't work).
You might also try booting into safe mode, in case that stops the phone from rebooting? https://www.androidauthority.com/how-to-enter-safe-mode-android-801476/
a1291762 said:
I modified my script a bit to pull instead of pushing, it's ... awfully rough (eg. you have to manually create a Camera directory to store the files it copies) but it seemed to work in principle. It might be enough for you, or it might serve as a base for a better solution. No doubt it'll need a few mods anyway, especially if you're on Windows (in which case ls won't work).
You might also try booting into safe mode, in case that stops the phone from rebooting? https://www.androidauthority.com/how-to-enter-safe-mode-android-801476/
Click to expand...
Click to collapse
Thank you for the reply! I am on Windows and I am not too script savvy out of writing a few simple AHK actions so I am not entirely sure how to proceed with what you have there.
Booting into safe mode did not work unfortunately. Seems the time until restart was the same as well.
Expressionize said:
Thank you for the reply! I am on Windows and I am not too script savvy out of writing a few simple AHK actions so I am not entirely sure how to proceed with what you have there.
Click to expand...
Click to collapse
I do have a windows PC for gaming so I'll fire it up and see if I can make it work there.
a1291762 said:
I do have a windows PC for gaming so I'll fire it up and see if I can make it work there.
Click to expand...
Click to collapse
I was able to brute force the process and finally made my way through the photos. There was one lucky boot that allowed normal access for about 3 minutes and that was enough time for adb pull to completely grab what I needed. I appreciate your time and help.
I guess it still doesn't solve the issue if someone else runs into my similar situation though, but it seems like a rare enough problem.
Expressionize said:
I was able to brute force the process and finally made my way through the photos. There was one lucky boot that allowed normal access for about 3 minutes and that was enough time for adb pull to completely grab what I needed. I appreciate your time and help.
Click to expand...
Click to collapse
No worries. I'm glad you got your photos.
I had to go out, but I got back and literally just finished updating the script so it runs on Windows and is a bit smarter (eg. waiting for the phone to come back when it goes away). I'll attach it here in the event someone else finds it useful
There's a few variables at the top to configure it. It needs python and adb but shouldn't need anything else.
python3 fetch_files.txt
It's got a .txt extension instead of the more typical .py because XDA won't let me upload a .py file.

Categories

Resources