[Q] Differences between reboot -p and power btn? - Motorola Droid and Milestone Q&A, Help & Troublesh

Can anyone tell me the differences btn using reboot -p command and classic way by pressing power button?
reboot -p turns off the phone very quickly, I'm afraid that it's not good for the system

My Galaxy Ace, won't get on after I am execute command reboot -p through adb.
Thats still my big question, how to safely shutdown android through adb shell.

Related

Is there a shell command for just Shutdown?

I am doing some testing and writing scripts in GScript and was wondering if there is a power off or shutdown command (as opposed to reboot). I want a command that will literally just turn the phone off but it needs to be a command line command, not an app.
Thanks
Code:
C:\>adb shell
* daemon not running. starting it now *
* daemon started successfully *
# which shutdown
which shutdown
/system/bin/shutdown
http://www.computerhope.com/unix/ushutdow.htm
lol i tried "shutdown -k" and it shutdown my phone!
Code:
# shutdown -k wait
shutdown -k wait
mount: mounting tmpfs on /dev failed: Device or resource busy
mount: mounting sysfs on /sys failed: Device or resource busy
mount: mounting none on /dev/cpuctl failed: Device or resource busy
C:\>
When I try shutdown from terminal it just locks the phone up completely
+1
I too am trying to achieve phone power down using a script. But like you when I issue the shutdown command the phone immediately powers off and won't switch on again without a battery pull.
Same for reboot command.
I am using gscript lite and have s-off with a stock Froyo sense ROM.
"poweroff" generally works in linux systems. I haven't tried this in Android though.
"reboot -p"
GldRush98 said:
"poweroff" generally works in linux systems. I haven't tried this in Android though.
Click to expand...
Click to collapse
Poweroff works if run using busybox, however, the command needs parameters to run.
#poweroff (doesn't work)
#busybox poweroff (also doesn't work)
#busybox poweroff -d 8 -f (works!!)
The -d 8 delays by 8 seconds to give system a chance to stop processes and unmount filesystems, whilst the -f forces poweroff.
Works a treat using Gscript. Not sure if it harms the system as the busybox poweroff command does not use init. That may be a bad thing. I just don't know enough about Android/Linux to know that. Maybe someone else does???
"reboot -p" works.
"busybox poweroff -d 8 -f" works too.
"busybox poweroff -f" works.
If I use the power button to shut down it takes a bit of time, goes through a process. If I shut down using terminal, by the command reboot -p, the shut down is instant. Is there any harm in that, or is that ok to shut down like that?
I like to find ways to reduce the use of the power button, as some have reported it fails after time, but if it's not good for the system then I'll just shut down normally using the power button...
YES! "reboot -p" works for me
duskymagus said:
"reboot -p" works.
"busybox poweroff -d 8 -f" works too.
"busybox poweroff -f" works.
Click to expand...
Click to collapse
YES! "reboot -p" works for me
"reboot -p" has a possibility of harming the phone.
What if none of these commands work for my device?
reboot does work.
reboot -p does not, just returns to command prompt.
shutdown does not work (no such file)
poweroff does not work (no such file)
busybox is installed, but these applets are not installed
Is there any other way?
"adb shell shutdown"
AngelOfGrief said:
What if none of these commands work for my device?
reboot does work.
reboot -p does not, just returns to command prompt.
shutdown does not work (no such file)
poweroff does not work (no such file)
busybox is installed, but these applets are not installed
Is there any other way?
Click to expand...
Click to collapse
If you use adb:
"adb shell shutdown" - performs immediate shutdown
poweroff under su always worked for me.
Nothing works but reboot -p for abrupt shutdown on my phone..
It may cause harm
Bryce2010 said:
If I use the power button to shut down it takes a bit of time, goes through a process. If I shut down using terminal, by the command reboot -p, the shut down is instant. Is there any harm in that, or is that ok to shut down like that?
I like to find ways to reduce the use of the power button, as some have reported it fails after time, but if it's not good for the system then I'll just shut down normally using the power button...
Click to expand...
Click to collapse
Sometimes there are problems when you use reboot -p too often, like failure in file systems because they are not unmounted safely. I do not use this command very often. I only use reboot recovery for flashing roms. Just try not to use this command very often to prevent harm okay?
Current Phone/ROM:
Samsung Galaxy Ace GT-S5830/Cyanogenmod 10.1 RC1 by bieltv3
Recovery:
CWM v5.0.2.6
ROMs used in the past: CM9 RC2 by Maclaw, SGS2 v9 ROM, AOSP ICS ROM by Maclaw, PAC ROM(very disappointed with this, no play store included.)
reboot -p actually does a reboot
Hi there,
on my device
Code:
reboot -p
does shut down the device, but after a few seconds (like 2 or 3 seconds) it boots again. So actually it behaves like doing a normal reboot. Any ideas how I can fix this issue?
Thank you and kind regards,
ToBe_HH
Hello gyus,
is there any Android application to perform power off?
Thank you
The followin shut down my CM13 using the Cerberus shell. Very slick.
su -c 'am broadcast android.intent.action.ACTION_SHUTDOWN && sleep 5 && reboot -p'
from:
android stackexchange com/questions/73001/how-to-shutdown-android-via-ssh-command
gorlox said:
The followin shut down my CM13 using the Cerberus shell. Very slick.
su -c 'am broadcast android.intent.action.ACTION_SHUTDOWN && sleep 5 && reboot -p'
from:
android stackexchange com/questions/73001/how-to-shutdown-android-via-ssh-command
Click to expand...
Click to collapse
works perfectly, also with 'reboot' and 'reboot recovery'

Problems getting into recovery image on rooted Nexus

Hey guys,
I rooted my Nexus one but I have a small problem getting into the recovery image.
In the modaco instructions you have this red text
Check if there's no /system/etc/install-recovery.sh script if you keep booting back in the stock recovery (exclamation mark with a little Android).
This is exactly what is happening to me and all I would like to know is....
How can I make this exclamation android disapear?
The file /system/etc/install-recovery.sh is there... but can I delete it or modify it somehow?
Why not use fastboot and flash the recovery?
I actually tried to do that but I have the same problem when trying to boot up in recovery.
Actually finally managed to get into the recovery image just now after using fastboot to flash the image once again.
However after rebooting the phone I still have the same problem. So basicly, this works if I just flash it, power off phone and run the custom recovery image. After that I get the little android with the exclamation mark.
Just to show what I do when flashing the reccovery image.
Superboot aquired
Code:
- MAC - Open a terminal window to the directory containing the files, and type 'chmod +x install-superboot-mac.sh' followed by './install-superboot-mac.sh'
I get success on this and my root access seems to work. (I am only running Market enabler to make it work)
Code:
Copy recovery-RA-nexus-v1.7.0.1.img to a location where fastboot can find it. ( Put this in my home folder under superboot\recovery-RA-nexus-v1.7.0.1.img
Boot your phone into fastboot mode (power on while holding the trackball)
Connect your phone via usb to your [B]MAC[/B]
./fastboot devices (to make sure that fastboot "sees" your phone)
./fastboot flash ./recovery recovery-RA-nexus-v1.7.0.1.img
So, I continue... Any idea why I am still getting the little Android? I have
also
hjaltih said:
Hey guys,
I rooted my Nexus one but I have a small problem getting into the recovery image.
In the modaco instructions you have this red text
Check if there's no /system/etc/install-recovery.sh script if you keep booting back in the stock recovery (exclamation mark with a little Android).
This is exactly what is happening to me and all I would like to know is....
How can I make this exclamation android disapear?
The file /system/etc/install-recovery.sh is there... but can I delete it or modify it somehow?
Click to expand...
Click to collapse
same problem with me i can not do it!
Well look no further becouse I have found the solution to our problems.
Superboot again and start with
Code:
adb shell
$ su
# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
Then you type
Code:
rm /system/etc/install-recovery.sh
Now follow instructions to install the Recovery image
After this you will hopefully not have any problems
help
sorry to bring this back... but, i need some help here...
when i enter $ su... i get "permission denied"
You need to have root access, google it or look in the development section for guides.
Cannot remove /system/etc/install-recovery.sh
Nexus One FRF91, unlocked and rooted.
SDK and USB driver installed, Windows XP.
Using ConnectBot I can see /system/etc/install-recovery.sh is present
I recovery boot into RA-nexus-v1.7.0.1
fastboot and adb both see the device.
adb remount returns remount failed: Invalid argument
If I go into adbshell and try mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system I get failed: Invalid argument
Have I missed something?
Any help would be most appreciated!
I can work around it with adb shell, still puzzling why adb remount will not work though...

$100 paypal donation to whoever can help me!

I was messing around with the ONE-click-lag-fix thingy on this thread
http://forum.xda-developers.com/showthread.php?p=8353541#post8353541
someone posted a "fix"
""you can fix the jpk issue by doing this:
after the failure, reboot the phone.
then with root explorer delete the file linux.ex2 in folder /data/ext2 this will give you back the space
open terminal emulator on phone and type:
su
busybox mount -o remount,rw /system
press home button and reapply the lagfix.
wait...
profit!"
So I went into my phone in /data and found linux.ex2 (although it wasn't in /ext2 it was just in /data) and I deleted it
and used the terminal commands etc.
I reset my phone and it books into the logo then turns black and turns off
I don't have the 3 button recovery mode enabled... I have ADB and stuff though
WHAT do I do ?
Please oh please tell me I didn't brick my phone
Please tell me how to fix this and I will give you $50 or $100 paypal right away
If it is bricked, what do I do to go about getting it replaced ?
Try: adb reboot recovery
And try a factory reset
Otherwise, you can boot into download mode by: adb reboot download and flash via Odin.
kalpik said:
Try: adb reboot recovery
And try a factory reset
Otherwise, you can boot into download mode by: adb reboot download and flash via Odin.
Click to expand...
Click to collapse
Where do I get ADB again (im at work) is there a tutorial ?
btw if this works Ill need your paypal info
You can use mke2fs to re-create linux.ex2
Ex. mke2fs /data/linux.ex2
This could get you booted up again. Then you could uninstall/reinstall the lagfix.
frankencat said:
You can use mke2fs to re-create linux.ex2
Ex. mke2fs /data/linux.ex2
This could get you booted up again. Then you could uninstall/reinstall the lagfix.
Click to expand...
Click to collapse
What do you mean? can you please explain this further?
what's mke2fs ?
Funkadelick said:
Where do I get ADB again (im at work) is there a tutorial ?
btw if this works Ill need your paypal info
Click to expand...
Click to collapse
ADB tutorial: http://forum.xda-developers.com/showpost.php?p=7239659&postcount=3
WAIT!!!!!!!: Before you do anything else!!! Look for /sdcard/linux.ex2 and see if it exists. This should be a backup that can be restored. Copy this back to data and you should be good to go. Might take a while to copy but it should work.
frankencat said:
WAIT!!!!!!!: Before you do anything else!!! Look for /sdcard/linux.ex2 and see if it exists. This should be a backup that can be restored. Copy this back to data and you should be good to go. Might take a while to copy but it should work.
Click to expand...
Click to collapse
I'm fairly new -- this is the problem
What do you mean "look" for it ? I can't even open up my phone -- it goes black on the boot screen (i shouldn't have deleted linux.ex2)
So I would assume this would be done through ADB ? I'm downloading it now
frankencat said:
WAIT!!!!!!!: Before you do anything else!!! Look for /sdcard/linux.ex2 and see if it exists. This should be a backup that can be restored. Copy this back to data and you should be good to go. Might take a while to copy but it should work.
Click to expand...
Click to collapse
I would need to know the commands to type to "restore" this file basically once I get ADB running
and if it works, please PM me your paypal info
I downloaded the android development SDK -- but when I ran it i got this: "Failed to fetch URL http://dl-ssl.google.com/android/repository/repository.xml, reason: dl-ssl.google.com"
Is this b/c I'm at work ? (firewall)
do I need to connect in order to use ADB ?
You said you have ADB so do this...hook up your phone and fire up a command window on you pc.
type in "adb shell"
this should get you into adb shell (duh).
next type "su"
Now enter the following one at a time on order. The last line will reboot your phone.
/data/lagfixtemp/busybox rm -rf /data/data;
/data/lagfixtemp/busybox rm -rf /data/system;
/data/lagfixtemp/busybox rm -rf /data/dalvik-cache;
/data/lagfixtemp/busybox rm -rf /data/app;
/data/lagfixtemp/busybox rm -rf /data/app-private;
/data/lagfixtemp/busybox mv /data/bak/data /data/;
/data/lagfixtemp/busybox mv /data/bak/system /data/;
/data/lagfixtemp/busybox mv /data/bak/dalvik-cache /data/;
/data/lagfixtemp/busybox mv /data/bak/app/app-private /data/;
/data/lagfixtemp/busybox mv /data/bak/app /data/;
/data/lagfixtemp/busybox mv /system/bin/playlogosnow /system/bin/playlogos1;
reboot
Funkadelick said:
I downloaded the android development SDK -- but when I ran it i got this: "Failed to fetch URL http://dl-ssl.google.com/android/repository/repository.xml, reason: dl-ssl.google.com"
Is this b/c I'm at work ? (firewall)
do I need to connect in order to use ADB ?
Click to expand...
Click to collapse
You don't need to run anything. Just download it and unzip the files to a directory on your computer like C:\android-sdk-windows
Then add the tools directory to you PATH setting
C:\android-sdk-windows\tools
Let me know if you don;t know how to do that and I will walk you through it.
frankencat said:
You said you have ADB so do this...hook up your phone and fire up a command window on you pc.
type in "adb shell"
this should get you into adb shell (duh).
next type "su"
Now enter the following one at a time on order. The last line will reboot your phone.
/data/lagfixtemp/busybox rm -rf /data/data;
/data/lagfixtemp/busybox rm -rf /data/system;
/data/lagfixtemp/busybox rm -rf /data/dalvik-cache;
/data/lagfixtemp/busybox rm -rf /data/app;
/data/lagfixtemp/busybox rm -rf /data/app-private;
/data/lagfixtemp/busybox mv /data/bak/data /data/;
/data/lagfixtemp/busybox mv /data/bak/system /data/;
/data/lagfixtemp/busybox mv /data/bak/dalvik-cache /data/;
/data/lagfixtemp/busybox mv /data/bak/app/app-private /data/;
/data/lagfixtemp/busybox mv /data/bak/app /data/;
/data/lagfixtemp/busybox mv /system/bin/playlogosnow /system/bin/playlogos1;
reboot
Click to expand...
Click to collapse
Jesus christ how did you know all this stuff ? gonna try it out ill let you know how it goes -- brb
frankencat said:
You don't need to run anything. Just download it and unzip the files to a directory on your computer like C:\android-sdk-windows
Then add the tools directory to you PATH setting
C:\android-sdk-windows\tools
Let me know if you don;t know how to do that and I will walk you through it.
Click to expand...
Click to collapse
I got adb up and running
but please explain (in detail) your solution you mentioned in the previous page --
"You can use mke2fs to re-create linux.ex2
Ex. mke2fs /data/linux.ex2
This could get you booted up again. Then you could uninstall/reinstall the lagfix."
Please in details explain what you mean and show commands. Thanks
frankencat said:
You said you have ADB so do this...hook up your phone and fire up a command window on you pc.
type in "adb shell"
this should get you into adb shell (duh).
next type "su"
Now enter the following one at a time on order. The last line will reboot your phone.
/data/lagfixtemp/busybox rm -rf /data/data;
/data/lagfixtemp/busybox rm -rf /data/system;
/data/lagfixtemp/busybox rm -rf /data/dalvik-cache;
/data/lagfixtemp/busybox rm -rf /data/app;
/data/lagfixtemp/busybox rm -rf /data/app-private;
/data/lagfixtemp/busybox mv /data/bak/data /data/;
/data/lagfixtemp/busybox mv /data/bak/system /data/;
/data/lagfixtemp/busybox mv /data/bak/dalvik-cache /data/;
/data/lagfixtemp/busybox mv /data/bak/app/app-private /data/;
/data/lagfixtemp/busybox mv /data/bak/app /data/;
/data/lagfixtemp/busybox mv /system/bin/playlogosnow /system/bin/playlogos1;
reboot
Click to expand...
Click to collapse
when I type adb shell I get
error: device not found
am I doing something wrong ?
I rebooted my phone (galaxy S logo / start up screen) then it goes black as usual -- then I connected the cable and ran ADB from CMD.exe and typed ADB shell and got that error
Add C:\android-sdk-windows\tools to you computer's PATH...
- Open System Properties by right-clicking on My Computer
- Click on Advanced tab
- Click on Environment Variables
- Find PATH in System Varibles (bottom window) and open it for editing by either double-clicking or selecting it and clickin Edit button
- Scroll all the way to the end of the PATH string and enter a semi-colon ; at the end
- Paste the path to the sdk tools directory right after the semi-colon (C:\android-sdk-windows\tools)
- Click OK, OK, OK all the way out.
Now type "PATH" (without the quotes) in the command window and you should see the new path in the window. If not then close the window and open a new one. The tools dir should now be in the path and you are ready to use ADB.
You probably do not have have USB debugging enabled. Do you know if you eneabled that before or not? Also, did you make an nandroid backup before you started this?
And yes, it is because of Jesus Christ that I know this stuff.
<><
frankencat said:
Add C:\android-sdk-windows\tools to you computer's PATH...
- Open System Properties by right-clicking on My Computer
- Click on Advanced tab
- Click on Environment Variables
- Find PATH in System Varibles (bottom window) and open it for editing by either double-clicking or selecting it and clickin Edit button
- Scroll all the way to the end of the PATH string and enter a semi-colon ; at the end
- Paste the path to the sdk tools directory right after the semi-colon (C:\android-sdk-windows\tools)
- Click OK, OK, OK all the way out.
Now type "PATH" (without the quotes) in the command window and you should see the new path in the window. If not then close the window and open a new one. The tools dir should now be in the path and you are ready to use ADB.
Click to expand...
Click to collapse
I did all of this - i type in PATH and I see the new path etc.
But when i type adb shell it still says "device not found"
frankencat said:
You probably do not have have USB debugging enabled. Do you know if you eneabled that before or not? Also, did you make an nandroid backup before you started this?
And yes, it is because of Jesus Christ that I know this stuff.
<><
Click to expand...
Click to collapse
I don't think I enabled it -- as this happened spontaneously -- is there any way to fix this ? or am I seriously screwed ?
Not screwed, there is always a way.
Try this, pull your battery to power down your phone and then put the battery back in but DONT power it back up.
Now you have to do this all at the same time...hold down the up and down volume buttons and press down the power button. Hold all three buttons until you see the black Vibrant screen. KEEP HOLDING the up and down volume buttons until you see the yellow diags screen and then the green recovery screen.
Using the up/down volume keys to move, select "Reinstall Packages" and press the power button to select.
Tell me what you see...

problem rooting my device

Not sure if this is the correct category, but here goes my problem:
I'm following the instructions on wiki.cyanogenmod.com/index.php?title=HTC_Tattoo:_Full_Update_Guide
And now I am stuck at step 7 under Rooting the HTC Tattoo.
The first problem occurs after entering exit:
This line appears repeatedly
usage: reboot [-n] [-p] [rebootcommand]
So I had to close down the command window and start it again. And the next problem appears after entering this line:
while 'true' ; do ./m7 ; done
Same thing again, I have to close the command window and start again. After entering adb shell again I try with entering chown root.root su as it says and this line appear:
chown root.root su
Unable to chmod su: Operation not permitted
Does anyone know what to do from here?
There is a problem with the update guide. Dont follow it, I reported this problem long back in the CyanogenMod forums, but no one corrected it.
Get the 1-click root method with clockworkmod 3.0.0.5 by nTenisOT, its the best rooting option. It also installs clockworkmod recovery.
Also, you could try Universal Androot, but if u root with this, you need to insert the tattoo-hack.ko module before flashing custom recovery manually.
OptimusM said:
Not sure if this is the correct category, but here goes my problem:
I'm following the instructions on wiki.cyanogenmod.com/index.php?title=HTC_Tattoo:_Full_Update_Guide
And now I am stuck at step 7 under Rooting the HTC Tattoo.
The first problem occurs after entering exit:
This line appears repeatedly
usage: reboot [-n] [-p] [rebootcommand]
So I had to close down the command window and start it again. And the next problem appears after entering this line:
while 'true' ; do ./m7 ; done
Same thing again, I have to close the command window and start again. After entering adb shell again I try with entering chown root.root su as it says and this line appear:
chown root.root su
Unable to chmod su: Operation not permitted
Does anyone know what to do from here?
Click to expand...
Click to collapse
hi
pls ask ur question in the rooting thread their are a few threads on the same
CLOSED

[Q] change "relocked" to "locked" when putting phone back to stock?

[Q] change "relocked" to "locked" when putting phone back to stock?
I followed this thread but mine says "relocked" and it still says S-OFF. is it possible to get it to say "locked" without going through the whole process of unlocking, rooting, and using revone again?
I'm sending my phone back to get the screen replaced which isn't under warranty, so does it even matter that it says "relocked?"
mcarswell said:
I followed this thread but mine says "relocked" and it still says S-OFF. is it possible to get it to say "locked" without going through the whole process of unlocking, rooting, and using revone again?
I'm sending my phone back to get the screen replaced which isn't under warranty, so does it even matter that it says "relocked?"
Click to expand...
Click to collapse
Use revone -l to change back to "locked"
There is not a way without rerooting for Tue device to day say locked and not relocked BUT you can easily get rid of S-Off. It doesn't take long either...
1.) Reroot.
2.) Download revone to computer.
3.) Navigate Using Command Prompt to where revone file is located on computer and move the Downloaded file to /data/local/tmp using the command "adb push revone /data/local/tmp" without quotations while phone is booted into OS and connected to computer.
3.) Use Command Prompt with phone connected to computer to run these commands or you can use Terminal Emulator app without a computer but will need a computer later on to run RUU again...
3A.) adb shell
3B.) su(SU Will Now Request SU Access For ADB Shell, Grant It)
3C.) cd /data/local/tmp
3D.) chmod 755 revone
4.) Reboot device
5.) Once device is fully booted back up run these commands again while connected to computer
5A.) adb shell
5B.) su(Will Not Need To Request Access Again)
5C.) cd /data/local/tmp
5D.) ./revone -P(If It Tells You "No Need To Reboot" Then Move On To Step 7 And If It Tells You To "Reboot To Continue" Move On To Step 6).
6.) Reboot
7.) Once fully booted back into OS open another command prompt and run these commands with Command Prompt while connected to computer.
7A.) adb shell
7B.) su
7C.) cd /data/local/tmp
7D.) ./revone -s 0 -u(To Be Safe).
7E.) Reboot
8.) Once again open another command prompt window and run these commands
8A.) adb shell
8B.) su
8C.) cd /data/local/tmp
8D.) ./revone -t -l
9.) Reboot
10.) Run RUU And Allow It To Successfully Complete.
11.) Once booted back into OS open command prompt and type in the final two commands
11A.) adb reboot bootloader
12.) Once it boots into bootloader and recognizes device type in this command
12A.) fastboot oem writesecureflag e
Sent from my HTCONE using Tapatalk 4

Categories

Resources