HTC Android Reboot Command Options

Due to a need that came up for us, and since it turned out, at least on IRC, that other people are also looking for an answer, I am documenting the various reboot options available in Android, and in particular, on HTC (and in particular, on the HTC Magic). As far as I can tell, at least some of what iswwritten here will apply to broader audience than just the HTC Magic users, but this is the platform I have tested this on.

How to Reboot the HTC Magic from a Shell Command Line

The basic command to reboot the device is called "reboot". Merely writing reboot will perform a restart of the device. The command will call "sync" before rebooting the device, but will not unmount the file systems. This is up to you. If a full system is running on the device, this might prove to be slightly difficult, and many people just reboot and hope for the best.

Keep in mind that the core OS is stored on the system partition, which is typically mounted read only. This means that the worse data corruption that you could possibly inflict by this is fixable by doing a factory wipe of the device.

Power Off and Avoiding the Sync - All Android Devices

The reboot command can accept two switches. The first is the "-n" switch, which means to not perform a sync before rebooting the device. Use at your own risk. The second switch is "-p", which means to power off the device rather than reboot it. As far as I could tell, if -p is given, the last argument is effectively ignored. Since it is not ignored by the Linux kernel, however, this may not be globally true for all devices.

Reboot Argument - Type of Reboot

If reboot is run with no argument (with or without the options discussed above), it will simply shut down the Linux kernel, restart the device, and reload the operating system as if the device was just turned on. It is, however, possible to provide an additional argument to reboot, which causes the device to do something else. For the HTC

Usage:reboot bootloader/recovery/eraseflash/oem-xx

Magic, these are the available arguments:

Argument

Meaning

Boot Key Sequence

bootloader
After restart, the device loads the bootloader in fastboot mode
Power + Back
recoveryAfter restart, the device loads the recovery partition
Power + Home
eraseflashDuring restart the device performs a factory wipe
oem-XXXX are two hexadecimal digits. Special OEM code. Precise meaning unknown


Source for the Information

The reboot command line is taken from the reboot command source for the open source version, at system/core/toolbox/reboot.c. The "-n" and "-p" options are handled there.

The argument for reboot is transferred, as is, into the kernel. The meanings provided here are taken from the HTC Magic kernel sources (available from the HTC web site) at arch/arm/mach-msm/pm.c.

from:http://www.lingnu.com/en/android/68-htcandroidrebootoptions.html

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Android和Linux关系
  2. Android CTS 兼容性测试
  3. Android 核心分析 之五 -----基本空间划
  4. Android位图总结
  5. 【Android Studio使用教程3】Android Stu
  6. Android(安卓)之 MediaPlayer类
  7. Android dumpsys input详解
  8. Android中LayoutParams总结和用法
  9. Android libv4l2-android 摄像头视频捕获
  10. 新书《Android/OPhone开发完全讲义》即将