[REF] "Android for the Nexus 4" 101 & FAQs - Nexus 4 General

The popularity of Nexus devices has increased significantly since the launch of the Nexus One in January 2010. Along with this popularity, forums such as xda-developers have also had an influx of new users, most of which are not developers, and are not well versed in the intricacies of Android.
After much thought (and some discussion on this thread), I’ve decided to create this thread as a compilation of FAQs, 101s, and “How-To’s” in the hopes that those coming to Android who want to learn will have another resource to help them learn. With that in mind, this thread is NOT meant to explain the quickest way to do things (you will NOT see toolkits or shortcuts discussed in this thread), nor is it meant to be a “fix-my-device” thread. It is created with for a purpose of learning, in order to expand users’ knowledge of Nexus devices and Android in general. See this post by kyphur for the general philosophy of this site, which I share.
I do not take myself to be an Android guru or developer. However, I do have a bit of knowledge to share. If you think things are missing or not accurate, I will be more than happy to add or revise anything. I will try to cover most of the basic topics related to Android, including drivers, ADB, fastboot, partitions, recoveries, bootloaders, root and reverting to stock. Again, I will not discuss toolkits, nor will I cover custom ROMs. Those have their own threads.
This will be an ongoing work-in-progress, as it takes considerable time to try and capture everything properly, and my time is limited. The order of the information will also change, as I haven't quite figured out the best way to present everything. (Currently there are some FAQs, including fastboot and ADB commands, followed by a list of reference and how-to threads.)
So, without further delay:
Frequently Asked Questions
What is Android?
Android is an open-source operating system for mobile devices. It is basically a java virtual machine running on a Linux-based kernel.
What is the Android SDK and do I need it?
SDK stands for "software development kit. Do you need it? If you are developing, then yes (but then you probably would be reading this thread now would you... ). If you are not developing, then no, you do NOT need to install it. It is just a waste of space. The only files you need (to interface with your PC) that comes from the SDK are the fastboot and adb files, and they can be found here for Windows, Linux, and MacOS.
Why do I need a driver for my Windows PC to recognize my device?
As with all hardware, Windows requires device drivers for it to be able to interface with the OS. Drivers are not required if you are using Linux or MacOS.
Where do I get the driver for my PC?
For the Nexus 4, the driver available in the SDK works. (You can get just the driver without the SDK from here.) However, I recommend using this package by 1wayjonny. It works perfectly and, unlike most other packages, 1wayjonny’s repack does not install any crapware along with it. That said, it doesn’t include an .exe file, so it needs to be installed manually from the .inf file. If you do not now how to do that, see here for instructions. Note: If you are using Windows 8, you will need to do this before you can install the driver.
Why do I need to install the driver twice?
Nexus devices use two main interfaces (there are actually a few more, but I will cover them later) to communicate with a PC. These are ADB (Android debug bridge) and fastboot, both of which will be covered later. The fastboot interface requires the N4 to be booted in fastboot (i.e., bootloader) mode. Thus, in order to install the fastboot driver, you need to boot your N4 into the bootloader. The ADB interface requires an Android kernel to be booted, i.e., your device needs to be booted normally, or in a custom recovery (covered later). Additionally, if your device is booted normally, you need to have USB Debugging set to enabled in settings (i.e., Settings->Developer options->USB debugging).
How do I boot my device into the bootloader (i.e., fastboot mode)?
Turn off your device, hold volume down, and press and hold the power button.
What is a command prompt?
A command prompt in Windows (or terminal in Linux/MacOS) is a command line window in which you can enter commands. To open a command prompt in Windows, you can hold the shift key and right click in the directory in which you want your command prompt open. Or, in a Windows Explorer window you can go to File-><name-of-window>->Open command window here.
What is a bootloader?
Without getting into too many technicalities, the bootloader is essentially the program that gets loaded first when starting your device, and it is responsible for booting the Android kernel. Think of the bootloader as the BIOS of a computer.
What does it mean if my bootloader is locked/unlocked?
Most (if not all) devices are shipped from the manufacturer with locked bootloaders. This is for security reasons. A locked bootloader does not allow easy flashing of images, which means that it is difficult to change or modify the operating system. Unlocking a bootloader (using fastboot) on most Nexus devices results in a complete loss of all personal data from the device. Having a locked or unlocked bootloader has no bearing on the functioning of the device. Unlocking it gives you more options to play around with the OS. Additionally, an unlocked bootloader means that you can easily root your device no matter what -- unlike most non-Nexus devices, if you lose root, it is trivial to get it back.
What is “root”?
Root essentially means that you have root (or superuser) access to the file system on Android. It is similar to being “administrator” on a Windows PC. It has nothing to do with your device or the bootloader, it has to do with the Android OS (i.e., you cannot “root” your device – you root the Andoid build that you are running). To have root, you need to be booted into the Android OS that you have rooted. If you are in fastboot mode, root is irrelevant.
How do I get “root”?
If you are booted into a custom recovery (recoveries will be covered later), root is enabled by default. If you want root while booted into Android, you will need to place two files on your system partition: an “su” binary which grants root access, and a superuser app that manages that access. The two that are available are ChainsDD’s Superuser and Chainfire’s SuperSU. Usually these files are packaged up in a zip file that is flashable using a custom recovery, but they can be flashed manually using ADB. Both of these methods will be described below.
If I unlock my bootloader, is that the same as root?
No, as was mentioned above, unlocking the bootloader allows you to (among a few other things) flash images easily to the device when not booted into the Android OS. Root allows you access to manipulate the files WITHIN the Android OS.
If I unlock my bootloader, does that mean that I have to root?
No.
If I unlock my bootloader, do I have to flash a custom ROM?
No.
Do I need to root to flash a ROM?
No.
What is a ROM?
A ROM is slang for an mobile OS build.
What are the different versions of Android, and is there a difference between say 4.2 and JOP40C?
Have a look at this link for an explanation of what (for example) JOP40C means, and what version of Android that is.
What is the difference between a stock ROM and a custom ROM?
A stock ROM is a ROM that is built by Google and is signed by Google’s platform keys. Everything else is a custom ROM.
What is this AOSP I keep hearing about?
AOSP stands for Android Open Source Project, and is a repository for the source code for Android. You can build your own ROM from AOSP. Details can be found on http://source.android.com/.
What is fastboot?
Fastboot can refer to three things: the actual interface between your PC and phone; the fastboot.exe file; or the “mode” of your device. For you to be able to use fastboot commands: your device has to be booted in fastboot mode, the fastboot driver for your PC needs to be installed, and the fastboot.exe file needs to be on your PC.
What are the fastboot commands?
The list of fastboot commands can be seen by typing “fastboot” (without the quotes) in a command prompt opened in the directory where you fastboot.exe file is located. See below.
Code:
fastboot
usage: fastboot [ <option> ] <command>
commands:
update <filename> reflash device from update.zip
flashall flash boot + recovery + system
flash <partition> [ <filename> ] write a file to a flash partition
erase <partition> erase a flash partition
format <partition> format a flash partition
getvar <variable> display a bootloader variable
boot <kernel> [ <ramdisk> ] download and boot kernel
flash:raw boot <kernel> [ <ramdisk> ] create bootimage and flash it
devices list all connected devices
continue continue with autoboot
reboot reboot device normally
reboot-bootloader reboot device into bootloader
help show this help message
options:
-w erase userdata and cache
-s <serial number> specify device serial number
-p <product> specify product name
-c <cmdline> override kernel commandline
-i <vendor id> specify a custom USB vendor id
-b <base_addr> specify a custom kernel base address
-n <page size> specify the nand page size. default: 2048
Along with these commands, there is an additional one: oem. For now, I will only cover the following commands: devices, flash, boot, erase, reboot, reboot-bootloader and oem.
These commands will work in fastboot mode, whether your bootloader is lock or unlocked:
oem: with a shipping bootloader (like what most of us have on our devices) there are two “oem” commands: “oem unlock” and “oem lock”. These commands are used to unlock and lock your bootloader, e.g., “fastboot oem unlock” will unlock your bootloader.
devices: this command checks to see if your device is properly connected to your PC in fastboot mode, e.g., “fastboot devices”
reboot: this command will reboot your device, e.g., “fastboot reboot”
reboot-bootloader: this command will reboot your device into fastboot mode, e.g., “fastboot reboot-bootloader”
These commands will only work in fastboot mode IFF your bootloader is unlocked:
flash: this command is used to flash images to partitions (partitions will be covered later) on your device. It cannot be used to “flash” individual files or .zips. For example, to flash the system partition, the command would be “fastboot flash system system.img”
boot: this command boots a kernel without flashing it to your device. For example, to boot an insecure kernel called “test.img”, the command would be “fastboot boot test.img”
erase: this command erases a specified partition. For example, to erase the cache partition, the command would be “fastboot erase cache”
The above mentioned commands are the basics for flashing your device. You should get familiar with them.
What is ADB?
ADB can refer to two things: the actual interface between your PC and phone, or the adb files (the .exe and two .dll files for Windows). For you to be able to use adb commands: the adb driver needs to be installed on your PC, the adb files need to be on your PC, and your device has to be booted either in recovery mode or booted normally into Android. Additionally, USB debugging needs to be enabled if booted into Android.
What are the ADB commands?
The list of ADB commands can be seen by typing “adb” (without the quotes) in a command prompt opened in the directory where your adb.exe file is located. See below.
Code:
Android Debug Bridge version 1.0.29
-d - directs command to the only connected USB device
returns an error if more than one USB device is present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is running.
-s <serial number> - directs command to the USB device or emulator with
the given serial number. Overrides ANDROID_SERIAL
environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices - list all connected devices
connect <host>[:<port>] - connect to a device via TCP/IP
Port 5555 is used by default if no port number is specified.
disconnect [<host>[:<port>]] - disconnect from a TCP/IP device.
Port 5555 is used by default if no port number is specified.
Using this command with no additional arguments
will disconnect from all connected TCP/IP devices.
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> [<local>] - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(-l means list but don't copy)
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] [-s] <file> - push this package file to the device and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
('-s' means install on SD card instead of internal storage)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories)
adb bugreport - return all information from the device
that should be included in a bug report.
adb backup [-f <file>] [-apk|-noapk] [-shared|-noshared] [-all] [-system|-nosystem] [<packages...>]
- write an archive of the device's data to <file>.
If no -f option is supplied then the data is written
to "backup.ab" in the current directory.
(-apk|-noapk enable/disable backup of the .apks themselves
in the archive; the default is noapk.)
(-shared|-noshared enable/disable backup of the device's
shared storage / SD card contents; the default is noshared.)
(-all means to back up all installed applications)
(-system|-nosystem toggles whether -all automatically includes
system applications; the default is to include system apps)
(<packages...> is the list of applications to be backed up. If
the -all or -shared flags are passed, then the package
list is optional. Applications explicitly given on the
command line will be included even if -nosystem would
ordinarily cause them to be omitted.)
adb restore <file> - restore device contents from the <file> backup archive
adb help - show this help message
adb version - show version num
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specified device
adb remount - remounts the /system partition on the device read-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloader or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on the specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be updated.
- If it is "system" or "data", only the corresponding partition
is updated.
copkay has written up a great guide on the use of the “backup” and “restore” commands in this thread, so I will not cover those commands here.
For now, I will only cover the following commands: devices, reboot, reboot bootloader, push, pull and shell.
devices: this command checks to see if your device is properly connected to your PC in ADB mode, e.g., “adb devices”
reboot: this command will reboot your device, e.g., “adb reboot”
reboot-bootloader: this command will reboot your device into fastboot mode, e.g., “adb reboot bootloader”
push: this command copies a file (or directory) to your device from your PC. For example, say you wanted to copy to your /sdcard folder on your device a file called junk.jpg, which is stored on your PC in c:\. The command would be “adb push c:\junk.jpg /sdcard/” (assuming the folder is mounted – to be covered later). Petrovski80 has added more details on copying files to your device in his thread here.
pull: this command copies a file (or directory) to your PC from your device. For example, say you wanted to copy to your c:\ directory on your PC a file called junk.jpg, which is stored in the /sdcard folder on your device. The command would be “adb pull /sdcard/junk.jpg c:\” (assuming the folder is mounted – to be covered later).
shell: this command opens a “shell” to your device so you can issue commands directly to the Android OS. The command is “adb shell”. Your prompt will change to “$” which means that you are now issuing commands to Android, not to your PC. (At some point, I will try to put together a list of commonly used commands, but for anyone that has used Linux, they are essentially the same.)
What are the partitions on a the N4?
A Nexus 4 has the following partitions:
modem -> /dev/block/mmcblk0p1
sbl1 -> /dev/block/mmcblk0p2
sbl2 -> /dev/block/mmcblk0p3
sbl3 -> /dev/block/mmcblk0p4
tz -> /dev/block/mmcblk0p5
boot -> /dev/block/mmcblk0p6
recovery -> /dev/block/mmcblk0p7
m9kefs1 -> /dev/block/mmcblk0p8
m9kefs2 -> /dev/block/mmcblk0p9
m9kefs3 -> /dev/block/mmcblk0p10
rpm -> /dev/block/mmcblk0p11
aboot -> /dev/block/mmcblk0p12
sbl2b -> /dev/block/mmcblk0p13
sbl3b -> /dev/block/mmcblk0p14
abootb -> /dev/block/mmcblk0p15
rpmb -> /dev/block/mmcblk0p16
tzb -> /dev/block/mmcblk0p17
metadata -> /dev/block/mmcblk0p18
misc -> /dev/block/mmcblk0p19
persist -> /dev/block/mmcblk0p20
system -> /dev/block/mmcblk0p21
cache -> /dev/block/mmcblk0p22
userdata -> /dev/block/mmcblk0p23
DDR -> /dev/block/mmcblk0p24
grow -> /dev/block/mmcblk0p25
Source here.
What does mounting mean?
In order for a device to have access to files, the partition on which those files reside needs to be “mounted”. If you are in recovery, you can easily do this by going to the mounts menu and mounting the appropriate partition. If you are booted in Android, you will need to mount the partition yourself. The /sdcard folder is already mounted by default, however.
How do I mount the system partition?
In recovery: go to the mount menu and mount /system
In Android, on your device: you need root, and a file explorer with root access
In Android, connected via ADB (root required): you need to type the following command in a command prompt:
adb shell
su
mount -o remount,rw -t ext4 /dev/block/mmcblk0p21 /system
To explain this a bit:
-o remount,rw <== this remounts a partition that is already mounted (as read-only), as read-write
-t ext4 <== this specifies to mount it as ext4
/dev/block/mmcblk0p21 <== this is the system partition
/system <== this is what you are mounting it as
What is recovery?
Recovery is like a mini OS, which allows you to perform various functions, usually related to flashing files to your device, or updating files, or backing things up, etc. The stock image has a recovery included, but its functionality is very limited. There are a number of custom recoveries available, but the two most popular for the Nexus 4 are CWM and TWRP. There are various versions of each. More details to come in this section.
I see an Android lying on its back when I boot into recovery. Why?
What you see is the main screen of the Nexus stock recovery. To access the menu, you need to push and hold power and press volume up.
I just flashed CWM, but every time I try to boot into CWM, I keep seeing the stock recovery. Why?
If you updated your Android build using an OTA update file (either manually or over-the-air), the update placed two files on your device that re-flash the stock recovery every time you reboot your device. These two files are:
/system/etc/install-recovery.sh <== this is the script that installs the patch file
/system/recovery-from-boot.p <== this is the patch
You have to rename (or delete) one or both of them, then re-flash your custom recovery. Now it will stick.
What is an insecure boot image?
An insecure boot image is one that has root enabled for the shell user (i.e, ADB) by default on boot. This means that if you have booted or flashed an insecure image, when you connect your device to a computer, and open a shell via ADB, you will be userid 0 (or root) without having to "request" root access via the su binary. This makes somethings easier -- for example, you can now use the "remount" command in ADB to mount /system without having to type the full mount command in a shell. (More to add later.)
How do I root?
As was mentioned earlier, you need to place the su binary and the superuser app into the right spots on your device. In order to do this, you need to already have root access. There are two ways: flash a root package in recovery (instructions here), or manually place the files in the appropriate spots (I will add instructions on how to do this at a later time).

Useful Nexus 4 Guides and Reference Threads
Nexus 4 technical specifications: http://forum.xda-developers.com/showthread.php?t=1964850
Nexus 4 drivers: http://forum.xda-developers.com/showthread.php?t=1996051
How to back up your device using ADB – no root needed: http://forum.xda-developers.com/showthread.php?t=1420351
How to copy files to/from your device using ADB: http://forum.xda-developers.com/showthread.php?t=1869380
How to return your device to Google’s stock images: http://forum.xda-developers.com/showthread.php?t=2010312
How to root: http://forum.xda-developers.com/showthread.php?t=2010312
How to unlock your bootloader WITHOUT wiping (once you have root): http://forum.xda-developers.com/showthread.php?t=2063388
List of all OTA update files and links http://forum.xda-developers.com/showthread.php?t=1971169
Instructions on how to flash OTA updates: http://forum.xda-developers.com/showthread.php?t=2145848
List of all radios: http://forum.xda-developers.com/showthread.php?t=2087227
List of RILs: Coming soon.
List of bootloaders: Coming soon.
CWM recovery: http://www.clockworkmod.com/rommanager/
TWRP recovery: http://forum.xda-developers.com/showthread.php?t=2002326
Edify scripting: How to create recovery-flashable zips: http://forum.xda-developers.com/showthread.php?p=29735133
Information on bootloader security: http://forum.xda-developers.com/showthread.php?t=1898664
How to recovery deleted files: http://forum.xda-developers.com/showthread.php?p=34185439
How to nandroid directly to your computer: http://forum.xda-developers.com/showthread.php?t=1818321

Reserved.

Just to let you know, there's a mistake on " How to boot into the bootloader". It says to hold down vol+&vol- and press power, bit you only have to hold vol- and power.
Sent from my Nexus 4 using Tapatalk²

I think accessing bootloader mode is only by pressing volume down and the power key. I tried vol up + vol down + power key (the way you do it for the Galaxy Nexus) and it was a no go.

Maybe I'm just dumb, but on stock recovery, i get to the android with the triangle and hold vol up + power and my phone just turns off. What the heck am I doing wrong?

kcls said:
Just to let you know, there's a mistake on " How to boot into the bootloader". It says to hold down vol+&vol- and press power, bit you only have to hold vol- and power.
Click to expand...
Click to collapse
evaradar said:
I think accessing bootloader mode is only by pressing volume down and the power key. I tried vol up + vol down + power key (the way you do it for the Galaxy Nexus) and it was a no go.
Click to expand...
Click to collapse
Yeah, I caught it as well. Fixed.
Exidrion said:
Maybe I'm just dumb, but on stock recovery, i get to the android with the triangle and hold vol up + power and my phone just turns off. What the heck am I doing wrong?
Click to expand...
Click to collapse
You hold power and press volume up, not the other way around.

@efrant
Glad to see you again old buddy--
You were of tremendous help guiding me in my early N1 days and pushing me into learning the correct ways to do things sdk/adb/fastboot etc, not the shortcuts some were taking
I am sure many others have been helped also--
Don't think you were a Mod back then, so congrats on that also--
I am currently active in the One S Forum. But, follow the N4 and GN2 as one of them will be my next phone in the near future--
Ken

Amazing... There should be a thread like this on every Nexus device, or at least the most popular Nexi this days, it would be really helpful

efrant said:
What is fastboot?
Fastboot can refer to three things: the actual interface between your PC and phone; the fastboot.exe file; or the “mode” of your device. For you to be able to use fastboot commands: your device has to be booted in fastboot mode, the fastboot driver for your PC needs to be installed, and the fastboot.exe file needs to be on your PC.
Click to expand...
Click to collapse
Thanks man, thats a great guide...
Just one thing, Fastboot IS NOT exclusive for windows system, even for PC.
Cheers

d.terenzzo said:
Thanks man, thats a great guide...
Just one thing, Fastboot IS NOT exclusive for windows system, even for PC.
Cheers
Click to expand...
Click to collapse
You are right, it is for Windows, Linux and MacOS. I have a habit of using "PC" to mean "computer". I will adjust the wording in the first post.

this is very useful. thanks!

I have a question that wasn't answered in this FAQ. I was hoping someone could shed some light on the issue, then the OP could update the post to help others...
Basically, on my last Android phone my nandroid backups were all located on my SD card, under clockworkmod/backups. Now, they are located under mnt/shell/emulated.
I am new to emulated partitions and don't really get what is going on. I seem to be able to access various contents of my SD from the following directories:
mnt
sdcard
storage - which also has emulated and sdcard0 subfolders
The contents of these locations is not identical though! Could someone please explain what is actually going on?
Many thanks

1234568 said:
I have a question that wasn't answered in this FAQ. I was hoping someone could shed some light on the issue, then the OP could update the post to help others...
Basically, on my last Android phone my nandroid backups were all located on my SD card, under clockworkmod/backups. Now, they are located under mnt/shell/emulated.
I am new to emulated partitions and don't really get what is going on. I seem to be able to access various contents of my SD from the following directories:
mnt
sdcard
storage - which also has emulated and sdcard0 subfolders
The contents of these locations is not identical though! Could someone please explain what is actually going on?
Many thanks
Click to expand...
Click to collapse
This is new in Jelly Bean. Not sure why Google changed it. That said, they are all symlinks for compatibility with various apps. You data is actually stored in /data/media/0. This is your "sdcard" and the other locations should be pointing to that, so the contents of the "other locations" should be identical to that.
Sent from my Galaxy Nexus using Tapatalk 2

efrant said:
This is new in Jelly Bean. Not sure why Google changed it. That said, they are all symlinks for compatibility with various apps. You data is actually stored in /data/media/0. This is your "sdcard" and the other locations should be pointing to that, so the contents of the "other locations" should be identical to that.
Click to expand...
Click to collapse
Thanks for the answer. I will try and express my current understanding in a few statements. If any of it is wrong I would appreciate someone putting me correct.
The N4 has one large 16Gb drive.
On this drive is the data/media folder, which is preserved when full wiping, flashing roms, etc.
The /data/media/0 folder is meant to represent the SD card. Without root access this is all file explorers will see.
Instead of saving to data/media/0/clockworkmod/backup, CWM now backs up to data/media/clockworkmod/backup. This is why you need a root file explorer to see the backups.
The 'SD card', 'mnt' and 'storage' folders are all symlinks to /data/media.
Assuming all that is correct how, how would an unrooted user delete folders from data/media, other than data/media/0.
Also, will it be possible for CWM to change their backup directory to what it has always been?

1234568 said:
Thanks for the answer. I will try and express my current understanding in a few statements. If any of it is wrong I would appreciate someone putting me correct.
The N4 has one large 16Gb drive.
On this drive is the data/media folder, which is preserved when full wiping, flashing roms, etc.
The /data/media/0 folder is meant to represent the SD card. Without root access this is all file explorers will see.
Instead of saving to data/media/0/clockworkmod/backup, CWM now backs up to data/media/clockworkmod/backup. This is why you need a root file explorer to see the backups.
The 'SD card', 'mnt' and 'storage' folders are all symlinks to /data/media.
Assuming all that is correct how, how would an unrooted user delete folders from data/media, other than data/media/0.
Also, will it be possible for CWM to change their backup directory to what it has always been?
Click to expand...
Click to collapse
There are a few points that are not exactly correct in your post. I'll explain when I'm in front of a computer.
Sent from my Galaxy Nexus using Tapatalk 2

I came across this comment in another thread that answered one of my questions:
"I believe the location was changed because of the multiple users feature that has been incorporated into android.
If you go into storage you'll notice a folder called sdcard0. This is how android handles multiple users the next user would have a folder called sdcard1 and the next sdcard2 so forth and so on.
CWM had problems handling this so Koush changed the location to get around the problem."

1234568 said:
I came across this comment in another thread that answered one of my questions:
"I believe the location was changed because of the multiple users feature that has been incorporated into android.
If you go into storage you'll notice a folder called sdcard0. This is how android handles multiple users the next user would have a folder called sdcard1 and the next sdcard2 so forth and so on.
CWM had problems handling this so Koush changed the location to get around the problem."
Click to expand...
Click to collapse
That's pretty much correct, although I believe the actual folders are /data/media/0, /data/media/1, etc. Everything else is just symlinks.
Sent from my Galaxy Nexus using Tapatalk 2

Cool. And was everything else in my previous post correct then? Just trying to puzzle out exactly how this all works. Thanks for giving your time for this one on one teaching!

1234568 said:
Cool. And was everything else in my previous post correct then? Just trying to puzzle out exactly how this all works. Thanks for giving your time for this one on one teaching!
Click to expand...
Click to collapse
The other thing that wasn't quite correct is that data/media is NOT preserved when doing a wipe if you are using the stock recovery, but is preserved if you are using a custom recovery like cwm or twrp.
Sent from my Galaxy Nexus using Tapatalk 2

Related

help - flashed kernel and now stuck at load screen

Hi everyone.
I something of a noob but have unlocked/rooted/flashed several roms in the past but this time I have made a mess of it.
I unlocked my phone then flasked CWM revovery ok but was not getting anywhere with rooting it. So for some reason i flashed the kernel and now it is stuck on the white htc screen with some red text stating this is a htc developer rom please dont use without htc permission etc.
All I am able to do now is down/power button boot into bootloader and get into recovery.
I don't have any rom saved on the SD card.
I checked other solutions on this site all day yesterday and nothing seemed to work for me.
Thanks for the help in advance.
You should be able to download a rom to your pic, mount the internal sd in recovery and push the rom to it. Then wipe and flash. I'm not familiar with the phone or cwm, but that's a method used in the past.
if you have an otg cable you can mount external storage in recovery and flash from there...
metalfan78 said:
You should be able to download a rom to your pic, mount the internal sd in recovery and push the rom to it. Then wipe and flash. I'm not familiar with the phone or cwm, but that's a method used in the past.
Click to expand...
Click to collapse
I tried to mount sd card
in CWM it gives me 'error mounting /sdcard'
What next?
I don't know what kernel you flashed, since there are no kernels out for this device, but you need a otg cable with a usb drive stick to put the new rom zip on to flash in recovery, or your other options are to use the android sdk(adb) to push the rom zip to your storage, or you could adb sideload the rom zip.
to adb push plug up to your pc & type this in the cmd prompt
Code:
adb push nameofROM.zip /sdcard/nameofROM.zip
sideload is an option in cwm, just start it from recovery & connect to your pc & in your cmd prompt type
Code:
adb sideload (path to your rom.zip)
rayford85 said:
I don't know what kernel you flashed, since there are no kernels out for this device, but you need a otg cable with a usb drive stick to put the new rom zip on to flash in recovery, or your other options are to use the android sdk(adb) to push the rom zip to your storage, or you could adb sideload the rom zip.
to adb push plug up to your pc & type this in the cmd prompt
Code:
adb push nameofROM.zip /sdcard/nameofROM.zip
sideload is an option in cwm, just start it from recovery & connect to your pc & in your cmd prompt type
Code:
adb sideload (path to your rom.zip)
Click to expand...
Click to collapse
I got 'adb is not a recognised internal or external command
trenzador said:
I got 'adb is not a recognised internal or external command
Click to expand...
Click to collapse
try using google search to find out how to properly install the android sdk, your gonna need it. In the mean time take this & extract it, open your cmd prompt inside the folder, also put the rom.zip in that folder & it will work. https://dl.dropbox.com/u/31377968/adb_files.zip
rayford85 said:
try using google search to find out how to properly install the android sdk, your gonna need it. In the mean time take this & extract it, open your cmd prompt inside the folder, also put the rom.zip in that folder & it will work. https://dl.dropbox.com/u/31377968/adb_files.zip
Click to expand...
Click to collapse
great....but do i need to get android sdk working before the rest of the method or are you saying i will need it one day in the future maybe?
cheers by the way.
trenzador said:
great....but do i need to get android sdk working before the rest of the method or are you saying i will need it one day in the future maybe?
cheers by the way.
Click to expand...
Click to collapse
your gonna need it in the future, just use my files for now to get your device running again
rayford85 said:
your gonna need it in the future, just use my files for now to get your device running again
Click to expand...
Click to collapse
ok sorry one more question..
what do you mean open the cmd inside the folder? is there a file to open in the folder or i just open the fo....you get the picture.
trenzador said:
ok sorry one more question..
what do you mean open the cmd inside the folder? is there a file to open in the folder or i just open the fo....you get the picture.
Click to expand...
Click to collapse
open the folder, hold shift & mouse right click, choose open command prompt here.
i did what you said and i got this
Android Debug Bridge version 1.0.31
-d - directs command to the only connected USB devic
e
returns an error if more than one USB device is
present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is r
unning.
-s <specific device> - directs command to the device or emulator with
the given
serial number or qualifier. Overrides ANDROID_S
ERIAL
environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices [-l] - list all connected devices
('-l' will also list device qualifiers)
connect <host>[:<port>] - connect to a device via TCP/IP
Port 5555 is used by default if no port number
is specified.
disconnect [<host>[:<port>]] - disconnect from a TCP/IP device.
Port 5555 is used by default if no port number
is specified.
Using this command with no additional arguments
will disconnect from all connected TCP/IP devic
es.
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> [<local>] - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(-l means list but don't copy)
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] [-s] [--algo <algorithm name> --key <hex-encoded key> --
iv <hex-encoded iv>] <file>
- push this package file to the device and instal
l it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data
)
('-s' means install on SD card instead of inter
nal storage)
('--algo', '--key', and '--iv' mean the file is
encrypted already)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories
)
adb bugreport - return all information from the device
that should be included in a bug report.
adb backup [-f <file>] [-apk|-noapk] [-shared|-noshared] [-all] [-system|-nosy
stem] [<packages...>]
- write an archive of the device's data to <file>
.
If no -f option is supplied then the data is wr
itten
to "backup.ab" in the current directory.
(-apk|-noapk enable/disable backup of the .apks
themselves
in the archive; the default is noapk.)
(-shared|-noshared enable/disable backup of the
device's
shared storage / SD card contents; the defau
lt is noshared.)
(-all means to back up all installed applicatio
ns)
(-system|-nosystem toggles whether -all automat
ically includes
system applications; the default is to inclu
de system apps)
(<packages...> is the list of applications to b
e backed up. If
the -all or -shared flags are passed, then t
he package
list is optional. Applications explicitly g
iven on the
command line will be included even if -nosys
tem would
ordinarily cause them to be omitted.)
adb restore <file> - restore device contents from the <file> backup
archive
adb help - show this help message
adb version - show version num
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb get-devpath - prints: <device-path>
adb status-window - continuously print device status for a specifie
d device
adb remount - remounts the /system partition on the device re
ad-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the boo
tloader or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on th
e specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be u
pdated.
- If it is "system" or "data", only the corresponding partition
is updated.
environmental variables:
ADB_TRACE - Print debug information. A comma separated list
of the following values
1 or all, adb, sockets, packets, rwx, usb, sync
, sysdeps, transport, jdwp
ANDROID_SERIAL - The serial number to connect to. -s takes prior
ity over this if given.
ANDROID_LOG_TAGS - When used with the logcat option, only these de
bug tags are printed.
C:\Users\Leon\Desktop\ADB GUY\adb_files>
trenzador said:
i did what you said and i got this
C:\Users\Leon\Desktop\ADB GUY\adb_files>
Click to expand...
Click to collapse
Use 'adb shell' then adb sideload I think
MacHackz said:
Use 'adb shell' then adb sideload I think
Click to expand...
Click to collapse
sorry i gotta ask more, abd shell then adbsideload in the same command or what?
i got another wall of text bigger than last time.
trenzador said:
sorry i gotta ask more, abd shell then adbsideload in the same command or what?
i got another wall of text bigger than last time.
Click to expand...
Click to collapse
no need to shell, easiest way for me is to start sideload from recovery, once its started on your pc type adb sideload then drag the rom.zip into the cmd prompt & hit enter, it should do the rest.
rayford85 said:
no need to shell, easiest way for me is to start sideload from recovery, once its started on your pc type adb sideload then drag the rom.zip into the cmd prompt & hit enter, it should do the rest.
Click to expand...
Click to collapse
the good news is that worked in part, by that i mean it did load but on the phone i got this...
finding update package
opening update package
E: can't open /tmp/update.zip
(bad)
Installation aborted
trenzador said:
the good news is that worked in part, by that i mean it did load but on the phone i got this...
finding update package
opening update package
E: can't open /tmp/update.zip
(bad)
Installation aborted
Click to expand...
Click to collapse
redownload a rom like renovate for example and try again.
rayford85 said:
redownload a rom like renovate for example and try again.
Click to expand...
Click to collapse
I think I have it working...thank goodness.
Big thank you for the help and patience
Trenzador I have the same trouble can you please post instructions on how you managed to get it sorted out thanks
Sent from my Nexus 7 using xda app-developers app

[GUIDE] How to ADB Push to fix a formatted /sdcard (Mac + PC)

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This guide will help you to restore your phone if you happen to have wiped your internal sdcard and have no way of getting your phone to boot to a functional state.
This method is 99.9% safe, and should anyone break their phones as a direct result of this guide, I will send a donation
Requirements: A computer running either Windows or Mac
An unlocked bootloader, which can be achieved at http://www.htcdev.com/bootloader
This guide, best served cold, comes in three parts:
Unlocking the bootloader
Installing the ADB drivers
Restoring your phone
Feel free to skip to the part you require, and I hazard a guess at saying most people can skip straight to the third and most important part, where the magic actually happens.
Unlockin' the bootloader
First off, you need to head over to HTC Dev and select 'All Other Supported Models' in the little drop down menu, then press the big green button as shown.
This will then require you to register, and you can then follow the steps provided by HTC. Obviously, during this process you're gonna come to a point where ADB drivers are needed to flash your unlock token, so take a peek down the page. I aren't going into detail with this unlock guide because I am fully aware that there are detailed guides elsewhere in the forums, from people who have a lot more time to sit and explain things than I do.
Installin' the ADB drivers
Howdy partner, this here thang be the most important thing you can ever do regarding your Android and PC ecosystem, and you're gonna be hella glad that you did it. After installing ADB, you're free to enjoy the wonderful world that is logcats, custom recoveries, ROMs, kernels; the whole package!
First off, select your OS!​
Windows 7
Congratulations! You have managed to avoid the flop that is Windows 8, kudos to you.
First, head over to HTC Sync Manager and download this and install, to gain the required drivers.
Now, head over to the Android SDK and download it, using the big blue download button. Simpless.
Extract this zip file to the root of your C:/ drive.
Now you're done! To check it's working, open the platform-tools folder of the SDK and then hold down Shift, Right Click and press 'Open Command Window here'.
Now, type
Code:
adb devices
If your device is plugged in, and powered into Android or a custom recovery, it should appear as a serial number here!
Windows 8
Sorry to hear you're stuck with the latest and far from greatest iteration of Windows, but don't let that Metro interface get you down! Lets crack on.
First, head over to HTC Sync Manager and download this and install, to gain the required drivers.
Now, head over to the Android SDK and download it, using the big blue download button. Simpless.
Extract this zip file to the root of your C:/ drive.
Now you're done! To check it's working, open the platform-tools folder of the SDK and then hold down Shift, Right Click and press 'Open Command Window here'.
Now, type
Code:
adb devices
If your device is plugged in, and powered into Android or a custom recovery, it should appear as a serial number here!
Mac
Finally, someone with a good taste in operating systems This is the easiest thing you will do all day, believe me.
First, head over to HTC Sync Manager and download this and install, to gain the required drivers.
Now, head over to the Android SDK and download it, using the big blue download button. Simpless.
Locate the zip, or folder (if you have 'Open "safe" files' turned on) in your Downloads folder and drag it to your Desktop. If it ain't extracted, give it a double click to extract it.
Now open the folder and navigate to 'platform-tools'. Drag this to your Desktop out of the main folder.
Open Terminal and type:
Code:
cd Desktop/platform-tools
./adb devices
If your phone is plugged in, and powered into Android or a custom recovery, the serial number will show up here. Congrats, adb is set up, now lets restore your phone.
Usin' ADB Push
So, you're stuck in recovery and cannot boot, or you just need to transfer a file to your phone for whatever reason... This is the method to transfer a rom back onto your phone, in order to make it fully functional again. This works in both recovery and booted Android, meaning it is also a good way to transfer music and photos when your phone boots again. This process doesn't wipe any data.
First, open platform-tools (your adb folder as described above). Download any ROM from the HTC One section of XDA and drag the .zip inside here
Hold down Shift and Right-Click, selecting 'Open Command Window Here'.
On a Mac, open Terminal and type;
Code:
cd Desktop/platform-tools
to achieve the same result.
Now, we are ready to use the ADB push command.
Plug your phone into your computer in recovery mode, and in CMD type:
Code:
adb push NameOfRom.zip /data/media/
Be aware that on Android 4.2.2, you need to type '/data/media/0/'
On a Mac, type:
Code:
./adb push NameOfRom.zip /data/media/
(or /data/media/0/ if coming from a 4.2.2 rom)
Now, wait for the process to complete. This takes on average around 260 seconds for a 900mb rom, with no progress indicator. Don't worry, it hasn't frozen.
When it completes, type:
Code:
adb reboot recovery
or
Code:
./adb reboot recovery
on a Mac.
Your file can now be found on your sdcard, and can be flashed from the 'Install zip from sdcard' screen.
That's it, you have saved your phone, and can now get back to using it again!​
Annddd I've posted this in the wrong section by accident... Sorry I was too excited about finishing ;D
Great tutorial. I wish I had seen that a couple of days ago when I accidentally wiped my internal SD and had no ROM to flash. Thanks to the members here and hours and hours of Googling, though, I was able o get ADB working. Bookmarked!
Great work - this should be a sticky on the Q & A page. This issue/problem comes up 2 or 3 times per day. Especially since 4.2.2 releases came out.
Sent from my HTC One using xda premium
Sticked until August 1st. If there is still a problem with formatted sd-cards then, we will re-asess.
I can't believe there are still people around android who don't know how to push I had to do that as well as I had my internal SD wiped too during the S-OFFing/unlocking...
One a bit OT, but does anyone know why the TWRP lacks the advanced "mount USB storage" feature? I had that one on my OneX....
Cheers
Dr.Romca said:
I can't believe there are still people around android who don't know how to push I had to do that as well as I had my internal SD wiped too during the S-OFFing/unlocking...
One a bit OT, but does anyone know why the TWRP lacks the advanced "mount USB storage" feature? I had that one on my OneX....
Cheers
Click to expand...
Click to collapse
Neither TWRP nor CWM are able to Mount USB Storage anymore and I have no idea why. They were not able to mount on my Galaxy S3 either.
thnx
thanks you very much it helps me allot
thanks again
anyone know how to get around this so it actually pushes teh rom to the phone?
Android Debug Bridge version 1.0.29
-d - directs command to the only connected USB device
returns an error if more than one USB device is present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is running.
-s <serial number> - directs command to the USB device or emulator with
the given serial number. Overrides ANDROID_SERIAL
environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices - list all connected devices
connect <host>[:<port>] - connect to a device via TCP/IP
Port 5555 is used by default if no port number is specified.
disconnect [<host>[:<port>]] - disconnect from a TCP/IP device.
Port 5555 is used by default if no port number is specified.
Using this command with no additional arguments
will disconnect from all connected TCP/IP devices.
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> [<local>] - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(-l means list but don't copy)
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] [-s] [--algo <algorithm name> --key <hex-encoded key> --iv <hex-encoded iv>] <file>
- push this package file to the device and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
('-s' means install on SD card instead of internal storage)
('--algo', '--key', and '--iv' mean the file is encrypted already)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories)
adb bugreport - return all information from the device
that should be included in a bug report.
adb backup [-f <file>] [-apk|-noapk] [-shared|-noshared] [-all] [-system|-nosystem] [<packages...>]
- write an archive of the device's data to <file>.
If no -f option is supplied then the data is written
to "backup.ab" in the current directory.
(-apk|-noapk enable/disable backup of the .apks themselves
in the archive; the default is noapk.)
(-shared|-noshared enable/disable backup of the device's
shared storage / SD card contents; the default is noshared.)
(-all means to back up all installed applications)
(-system|-nosystem toggles whether -all automatically includes
system applications; the default is to include system apps)
(<packages...> is the list of applications to be backed up. If
the -all or -shared flags are passed, then the package
list is optional. Applications explicitly given on the
command line will be included even if -nosystem would
ordinarily cause them to be omitted.)
adb restore <file> - restore device contents from the <file> backup archive
adb help - show this help message
adb version - show version num
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specified device
adb remount - remounts the /system partition on the device read-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloader or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on the specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be updated.
- If it is "system" or "data", only the corresponding partition
is updated.
environmental variables:
ADB_TRACE - Print debug information. A comma separated list of the following values
1 or all, adb, sockets, packets, rwx, usb, sync, sysdeps, transport, jdwp
ANDROID_SERIAL - The serial number to connect to. -s takes priority over this if given.
ANDROID_LOG_TAGS - When used with the logcat option, only these debug tags are printed.
TarekElsakka said:
Neither TWRP nor CWM are able to Mount USB Storage anymore and I have no idea why. They were not able to mount on my Galaxy S3 either.
Click to expand...
Click to collapse
at least they allow to use OTG to install roms, so (if you have the cable) you just can wipe the internal sd, and flash using an usb with OTG :good:
SLver said:
at least they allow to use OTG to install roms, so (if you have the cable) you just can wipe the internal sd, and flash using an usb with OTG :good:
Click to expand...
Click to collapse
Yeah, I'm aware of that. I went ahead and ordered an OTG cable when I mistakenly wiped my internal SD card before. It arrived about four days later, though, so I had already fixed the problem. I am sure when I want to do a fresh install, it'll make life much easier than having to sideload or push using ADB.
Great guide although i'm a bit stuck, when I run the ./adb push Rom.zip /data/media/0 command it says:
-bash: /Users/archiedennis/Desktop/platform-tools: is a directory
Any ideas anyone?
Running OSX btw
JustArchiee said:
Great guide although i'm a bit stuck, when I run the ./adb push Rom.zip /data/media/0 command it says:
-bash: /Users/archiedennis/Desktop/platform-tools: is a directory
Any ideas anyone?
Running OSX btw
Click to expand...
Click to collapse
./adb push rom.zip /data/media/0/
MacHackz said:
./adb push rom.zip /data/media/0/
Click to expand...
Click to collapse
sry for noob question.. but adb won't show my device
have latest drivers and htc sync installed.. it was working before, now it just won't
fcjan said:
sry for noob question.. but adb won't show my device
have latest drivers and htc sync installed.. it was working before, now it just won't
Click to expand...
Click to collapse
Download and run this: http://adbdriver.com/upload/AdbDriverInstaller.exe
MacHackz said:
Download and run this: http://adbdriver.com/upload/AdbDriverInstaller.exe
Click to expand...
Click to collapse
thanks.. now there is a another problem -.-
I was trying to do a clean install of ARHD, had some problems..
enter CM recovery, tested adb (working)
wipe data/factory reset, wipe cache, wipe /sdcard.. full wipe
now adb is saying
C:\adb>adb devices
adb server is out of date. killing...
ADB server didn't ACK
* failed to start daemon *
error:
FIXED.. had do delete adb.exe in HTC Sync folder, it works now.. thank you!
MacHackz said:
./adb push rom.zip /data/media/0/
Click to expand...
Click to collapse
Nope still the same thing :L
Dude!!! You are the greatest! Help me alot and saved my weekend *muchlove*
An all nighter, os X and Win7, 8 hours later you saved me. Thanks!
crash087 said:
anyone know how to get around this so it actually pushes teh rom to the phone?
Android Debug Bridge version 1.0.29
-d - directs command to the only connected USB device
returns an error if more than one USB device is present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is running.
-s <serial number> - directs command to the USB device or emulator with
the given serial number. Overrides ANDROID_SERIAL
environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices - list all connected devices
connect <host>[:<port>] - connect to a device via TCP/IP
Port 5555 is used by default if no port number is specified.
disconnect [<host>[:<port>]] - disconnect from a TCP/IP device.
Port 5555 is used by default if no port number is specified.
Using this command with no additional arguments
will disconnect from all connected TCP/IP devices.
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> [<local>] - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(-l means list but don't copy)
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] [-s] [--algo <algorithm name> --key <hex-encoded key> --iv <hex-encoded iv>] <file>
- push this package file to the device and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
('-s' means install on SD card instead of internal storage)
('--algo', '--key', and '--iv' mean the file is encrypted already)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories)
adb bugreport - return all information from the device
that should be included in a bug report.
adb backup [-f <file>] [-apk|-noapk] [-shared|-noshared] [-all] [-system|-nosystem] [<packages...>]
- write an archive of the device's data to <file>.
If no -f option is supplied then the data is written
to "backup.ab" in the current directory.
(-apk|-noapk enable/disable backup of the .apks themselves
in the archive; the default is noapk.)
(-shared|-noshared enable/disable backup of the device's
shared storage / SD card contents; the default is noshared.)
(-all means to back up all installed applications)
(-system|-nosystem toggles whether -all automatically includes
system applications; the default is to include system apps)
(<packages...> is the list of applications to be backed up. If
the -all or -shared flags are passed, then the package
list is optional. Applications explicitly given on the
command line will be included even if -nosystem would
ordinarily cause them to be omitted.)
adb restore <file> - restore device contents from the <file> backup archive
adb help - show this help message
adb version - show version num
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specified device
adb remount - remounts the /system partition on the device read-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloader or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on the specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be updated.
- If it is "system" or "data", only the corresponding partition
is updated.
environmental variables:
ADB_TRACE - Print debug information. A comma separated list of the following values
1 or all, adb, sockets, packets, rwx, usb, sync, sysdeps, transport, jdwp
ANDROID_SERIAL - The serial number to connect to. -s takes priority over this if given.
ANDROID_LOG_TAGS - When used with the logcat option, only these debug tags are printed.
Click to expand...
Click to collapse
I'm having the EXACT same issue....

Back to the htc one stock rom

Is the only way to go stock rom by changing mainboard?? htc malaysia sent "only way is changing the mainboard. Mainboard is too expensive for me. Is any idea to back stockrom??
Check this http://forum.xda-developers.com/showthread.php?p=51151301
Sent from my HTC One
Help this company said:
Is the only way to go stock rom by changing mainboard?? htc malaysia sent "only way is changing the mainboard. Mainboard is too expensive for me. Is any idea to back stockrom??
Click to expand...
Click to collapse
This is now your 4 thread for the same problem. Please quit making new threads and follow the advice folks have already given you for your issue.
Thread 1
Thread 2 <----------------- there were people who helped you here but you have not answered and you left
Thread 3 <----------------- there were people who helped you here but you have not answered and you left
I guess it will be the same thing here...
Back to stock.
Hi. I am Superpulla and i like go to stock from Maximus HD rom. i have 4.19.401.8 Version. I don't know witch ruu.zip i must download. all of them are meant to be on JB??!. If someone could help me with this, i be so thankfull.
I allready get my cid back to stock: HTC__Y13
HTC One m7_ul kitkat 4.4.2 Sense 5.5
Main guestions are: 1. What i do now?
2. Witch Ruu.zip i can flash
Superpulla said:
Hi. I am Superpulla and i like go to stock from Maximus HD rom. i have 4.19.401.8 Version. I don't know witch ruu.zip i must download. all of them are meant to be on JB??!. If someone could help me with this, i be so thankfull.
I allready get my cid back to stock: HTC__Y13
HTC One m7_ul kitkat 4.4.2 Sense 5.5
Main guestions are: 1. What i do now?
2. Witch Ruu.zip i can flash
Click to expand...
Click to collapse
U should repost in your own thread, it's easier to track.
Also post output from fastboot getvar all
A
alray said:
Thread 1
Thread 2 <----------------- there were people who helped you here but you have not answered and you left
Thread 3 <----------------- there were people who helped you here but you have not answered and you left
I guess it will be the same thing here...
Click to expand...
Click to collapse
I need Thread 1,2,3. Each thread different..
Help this company said:
I need Thread 1,2,3. Each thread different..
Click to expand...
Click to collapse
Why? Is it a different device?
Help this company said:
I need Thread 1,2,3. Each thread different..
Click to expand...
Click to collapse
Hmmmm no
To summarize:
Thread #2 (initial thread) -----> phone soft bricked, explained you how to install adb/fastboot/drivers to post a ''getvar all'', determined that you can not use your stock rom atm because of this. So I have suggested you to try this. You did not answered.
Thread #1 ------> phone soft bricked, you are asking again to flash your stock rom (adb sideload) even after reading this. no body answered in this thread.
Thread #3 --------> phone soft bricked, you are asking direction how to use adb sideload.
Thread #4 (here) ----> phone soft bricked you are asking how to return stock again.
Your issue is: Phone soft bricked. You don't have to create a new thread for each problem you encounter with un-bricking your phone. You could simply update the information in your initial thread so its easier for people to help and for YOU to understand. Now read back those threads and ask questions about what you don't understand (not in a new thread) and I'll (we) be pleased to help you.
---------- Post added at 07:23 PM ---------- Previous post was at 07:08 PM ----------
Help this company said:
Is the only way to go stock rom by changing mainboard?? htc malaysia sent "only way is changing the mainboard. Mainboard is too expensive for me. Is any idea to back stockrom??
Click to expand...
Click to collapse
So again, you can return to stock using a ''guru reset rom''. This is a stock rom that when installed will reset your phone back to stock (stock rom, stock recovery, stock radio). The rom is pushed to your sd card via TWRP or sideloaded via TWRP. The problem is the guru reset rom version you need have a bad file that will prevent you to get ota updates (discussed here)
this Reset ROM is supposed to install 3.63.707.4 software on the phone but it installs 3.63.707.3 instead , the software information under settings shows 3.63.707.3 while OS in "fastboot getvar all" shows 3.63.707.4. i went ahead and tried to OTA update it with this ROM but it gave variant error because of fw and sw number not matching
Click to expand...
Click to collapse
. So you will not be 100% stock because of this but at least your phone will boot.
Option 2 is to flash a custom rom like ARHD. It really looks and feels like the stock rom. This is a rock stable rom, always up to date. Again you'll need to push or sideload the rom
Option 3 is to go back to stock using a RUU. Unfortunately the only RUU for you phone version is DECRYPTED which means it required S-OFF to be flashed. So to use this RUU you'll need to S-OFF your phone which require to flash ARHD rom before.
Hope its clear, ask any questions if not, or choose which option you prefer and we will assist you but please for the love of god, no more threads :victory:
a
alray said:
Hmmmm no
To summarize:
Thread #2 (initial thread) -----> phone soft bricked, explained you how to install adb/fastboot/drivers to post a ''getvar all'', determined that you can not use your stock rom atm because of this. So I have suggested you to try this. You did not answered.
Thread #1 ------> phone soft bricked, you are asking again to flash your stock rom (adb sideload) even after reading this. no body answered in this thread.
Thread #3 --------> phone soft bricked, you are asking direction how to use adb sideload.
Thread #4 (here) ----> phone soft bricked you are asking how to return stock again.
Your issue is: Phone soft bricked. You don't have to create a new thread for each problem you encounter with un-bricking your phone. You could simply update the information in your initial thread so its easier for people to help and for YOU to understand. Now read back those threads and ask questions about what you don't understand (not in a new thread) and I'll (we) be pleased to help you.
---------- Post added at 07:23 PM ---------- Previous post was at 07:08 PM ----------
So again, you can return to stock using a ''guru reset rom''. This is a stock rom that when installed will reset your phone back to stock (stock rom, stock recovery, stock radio). The rom is pushed to your sd card via TWRP or sideloaded via TWRP. The problem is the guru reset rom version you need have a bad file that will prevent you to get ota updates (discussed here)
. So you will not be 100% stock because of this but at least your phone will boot.
Option 2 is to flash a custom rom like ARHD. It really looks and feels like the stock rom. This is a rock stable rom, always up to date. Again you'll need to push or sideload the rom
Option 3 is to go back to stock using a RUU. Unfortunately the only RUU for you phone version is DECRYPTED which means it required S-OFF to be flashed. So to use this RUU you'll need to S-OFF your phone which require to flash ARHD rom before.
Hope its clear, ask any questions if not, or choose which option you prefer and we will assist you but please for the love of god, no more threads :victory:
Click to expand...
Click to collapse
thank you. I want to go back perfect stock rom. So I have to s-off... But how to s-off??
And I don't want to use any custom rom.
Last, I have a question, Do I not to send htc malaysia center to change mainboard??
Now, I'll not use any fixing ways but i will use only ur ways. I believe you!!
*Information.
my hboot is 1.56. radio ; 4A.23.3263.28 OS; 4.20.707.6 S-ON TAMPERED UNLOCKED.
Help this company said:
thank you. I want to go back perfect stock rom. So I have to s-off... But how to s-off??
And I don't want to use any custom rom.
Click to expand...
Click to collapse
Help this company said:
my hboot is 1.56.
Click to expand...
Click to collapse
You can s-off your phone using rumrunner tool or firewater tool. However many users reported not being able to s-off on hboot 1.56. You'll have to try it. You'll need to use a custom even if you don't want. A working rom is needed to achieve s-off. If you can't s-off you'll have no choice using a custom rom or the guru reset rom
Help this company said:
Last, I have a question, Do I not to send htc malaysia center to change mainboard??
Click to expand...
Click to collapse
If you phone still able to boot in bootloader mode, you don't have to send the phone for repair.
A
alray said:
You can s-off your phone using rumrunner tool or firewater tool. However many users reported not being able to s-off on hboot 1.56. You'll have to try it. You'll need to use a custom even if you don't want. A working rom is needed to achieve s-off. If you can't s-off you'll have no choice using a custom rom or the guru reset rom
If you phone still able to boot in bootloader mode, you don't have to send the phone for repair.
Click to expand...
Click to collapse
adb reboot (<--- important!!!!)
adb wait-for-device push firewater /data/local/tmp
adb shell su
chmod 755 /data/local/tmp/firewater /data/local/tmp/firewater
Shoud I input that code at cmd??? For example adb reboot. And Why important "adb reboot"?
And Shoud I add the file "firewater" at existing adb folder??
Last, To use adb command, what I have to prepare? Stay twrp recovery or bootloader or fastboot??
I'm so sorry about my short root knowledge...
Help this company said:
adb reboot (<--- important!!!!)
adb wait-for-device push firewater /data/local/tmp
adb shell su
chmod 755 /data/local/tmp/firewater /data/local/tmp/firewater
Shoud I input that code at cmd??? For example adb reboot. And Why important "adb reboot"?
And Shoud I add the file "firewater" at existing adb folder??
Last, To use adb command, what I have to prepare? Stay twrp recovery or bootloader or fastboot??
I'm so sorry about my short root knowledge...
Click to expand...
Click to collapse
Do you have arhd rom installed on your phone?
a
alray said:
Do you have arhd rom installed on your phone
Click to expand...
Click to collapse
No, Could you write download link?? And 1st install arhd 2nd go back to stock rom??
How to s-off by using firewater?? I downloaded file, and just type "adb reboot (<--- important!!!!)*adb wait-for-device push firewater /data/local/tmp*adb shell su*chmod 755 /data/local/tmp/firewater /data/local/tmp/firewater" ????
Help this company said:
No, Could you write download link??
Click to expand...
Click to collapse
Easy to find on the forum. ARHD is the second thread listed under the ''ROMs'' tab or a simple search on google using ''ARHD'' and ''HTC ONE'' key words will brings you at the right place.
Help this company said:
And 1st install arhd 2nd go back to stock rom??
Click to expand...
Click to collapse
flash arhd first then if you can achieve s-off you'll be able to run the ruu to go back to stock. If you can't s-off then use arhd rom.
Help this company said:
How to s-off by using firewater?? I downloaded file, and just type "adb reboot''
Click to expand...
Click to collapse
Hmmmm, so your phone is softbricked which mean it can't boot. How can you reboot a phone that is not booted?! You need a working rom before. Then follow the guide I have posted above to s-off.
Honestly, making your phone boot should be your absolute priority. You are at step #1 -----> making your phone boot by flashing a rom. S-off is like step #10.
alray said:
Easy to find on the forum. ARHD is the second thread listed under the ''ROMs'' tab or a simple search on google using ''ARHD'' and ''HTC ONE'' key words will brings you at the right place.
flash arhd first then if you can achieve s-off you'll be able to run the ruu to go back to stock. If you can't s-off then use arhd rom.
Hmmmm, so your phone is softbricked which mean it can't boot. How can you reboot a phone that is not booted?! You need a working rom before. Then follow the guide I have posted above to s-off.
Honestly, making your phone boot should be your absolute priority. You are at step #1 -----> making your phone boot by flashing a rom. S-off is like step #10.
Click to expand...
Click to collapse
1. Should I check the radio,etc of ARHD ROM??
2. If I downloaded Arhd, Should I use "adb sideload arhdname.zip"??
3. I entered adb sideload and Swipe it, it shows me "Failed". What's the problem???
Thank U Mr.alray helping me. I'll do that at night(korea time).
Sincerely, I appreciate ur help.
Help this company said:
1. Should I check the radio,etc of ARHD ROM??
2. If I downloaded Arhd, Should I use "adb sideload arhdname.zip"??
3. I entered adb sideload and Swipe it, it shows me "Failed". What's the problem???
Thank U Mr.alray helping me. I'll do that at night(korea time).
Sincerely, I appreciate ur help.
Click to expand...
Click to collapse
1. just flash the rom
2. adb sideload it or adb push it.
3. Maybe a driver issue. When in twrp sideload mode, open a command prompt from your adb/fastboot folder and type ''adb devices''. What is the output?
a
alray said:
1. just flash the rom
2. adb sideload it or adb push it.
3. Maybe a driver issue. When in twrp sideload mode, open a command prompt from your adb/fastboot folder and type ''adb devices''. What is the output?
Click to expand...
Click to collapse
when I typed adb devices,it shows "my serial name sideload". and I did adb sideload arhd.zip. it shows 100% but I can't find the file.
also, I did adb push,this shows me this.↓
-a - directs adb to listen on all interfaces for a c
onnection
-d - directs command to the only connected USB devic
e
returns an error if more than one USB device is
present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is r
unning.
-s <specific device> - directs command to the device or emulator with
the given
serial number or qualifier. Overrides ANDROID_S
ERIAL
environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
-H - Name of adb server host (default: localhost)
-P - Port of adb server (default: 5037)
devices [-l] - list all connected devices
('-l' will also list device qualifiers)
connect <host>[:<port>] - connect to a device via TCP/IP
Port 5555 is used by default if no port number
is specified.
disconnect [<host>[:<port>]] - disconnect from a TCP/IP device.
Port 5555 is used by default if no port number
is specified.
Using this command with no additional arguments
will disconnect from all connected TCP/IP devic
es.
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> [<local>] - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(-l means list but don't copy)
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward --list - list all forward socket connections.
the format is a list of lines with the followin
g format:
<serial> " " <local> " " <remote> "\n"
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb forward --no-rebind <local> <remote>
- same as 'adb forward <local> <remote>' but fail
s
if <local> is already forwarded
adb forward --remove <local> - remove a specific forward socket connection
adb forward --remove-all - remove all forward socket connections
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] [-s] [--algo <algorithm name> --key <hex-encoded key> --
iv <hex-encoded iv>] <file>
- push this package file to the device and instal
l it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data
)
('-s' means install on SD card instead of inter
nal storage)
('--algo', '--key', and '--iv' mean the file is
encrypted already)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories
)
adb bugreport - return all information from the device
that should be included in a bug report.
adb backup [-f <file>] [-apk|-noapk] [-obb|-noobb] [-shared|-noshared] [-all]
[-system|-nosystem] [<packages...>]
- write an archive of the device's data to <file>
.
If no -f option is supplied then the data is wr
itten
to "backup.ab" in the current directory.
(-apk|-noapk enable/disable backup of the .apks
themselves
in the archive; the default is noapk.)
(-obb|-noobb enable/disable backup of any insta
lled apk expansion
(aka .obb) files associated with each applic
ation; the default
is noobb.)
(-shared|-noshared enable/disable backup of the
device's
shared storage / SD card contents; the defau
lt is noshared.)
(-all means to back up all installed applicatio
ns)
(-system|-nosystem toggles whether -all automat
ically includes
system applications; the default is to inclu
de system apps)
(<packages...> is the list of applications to b
e backed up. If
the -all or -shared flags are passed, then t
he package
list is optional. Applications explicitly g
iven on the
command line will be included even if -nosys
tem would
ordinarily cause them to be omitted.)
adb restore <file> - restore device contents from the <file> backup
archive
adb help - show this help message
adb version - show version num
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb get-devpath - prints: <device-path>
adb status-window - continuously print device status for a specifie
d device
adb remount - remounts the /system partition on the device re
ad-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the boo
tloader or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on th
e specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be u
pdated.
- If it is "system" or "data", only the corresponding partition
is updated.
environmental variables:
ADB_TRACE - Print debug information. A comma separated list
of the following values
1 or all, adb, sockets, packets, rwx, usb, sync
, sysdeps, transport, jdwp
ANDROID_SERIAL - The serial number to connect to. -s takes prior
ity over this if given.
ANDROID_LOG_TAGS - When used with the logcat option, only these de
bug tags are printed.
Help this company said:
when I typed adb devices,it shows "my serial name sideload". and I did adb sideload arhd.zip. it shows 100% but I can't find the file.
also, I did adb push,this shows me this.↓
Click to expand...
Click to collapse
You need to add the file name you want to push and its destination on the phone! Not only ''adb push''
Code:
adb push <name_of_rom>.zip /sdcard/
then your rom will be on your sdcard folder.
or
adb sideload using this command:
Code:
adb sideload <name_of_rom>.zip
Btw use the sideload command when in twrp sideload mode (''adb devices'' must output your s/n + sideload)
use adb push when in twrp recovery main menu (''adb devices'' must output your s/n + recovery)
---------- Post added at 07:06 PM ---------- Previous post was at 07:05 PM ----------
and the long text you posted is the help page. Every time you see that page means you did not typed a valid command.
-a - directs adb to listen on all interfaces for a c
onnection
-d - directs command to the only connected USB devic
e
returns an error if more than one USB device is
present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is r
unning.
-s <specific device> - directs command to the device or emulator with
the given
serial number or qualifier. Overrides ANDROID_S
ERIAL
environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
etc etc etc.....
Click to expand...
Click to collapse
a
alray said:
You need to add the file name you want to push and its destination on the phone! Not only ''adb push''
Code:
adb push <name_of_rom>.zip /sdcard/
then your rom will be on your sdcard folder.
or
adb sideload using this command:
Code:
adb sideload <name_of_rom>.zip
Btw use the sideload command when in twrp sideload mode (''adb devices'' must output your s/n + sideload)
use adb push when in twrp recovery main menu (''adb devices'' must output your s/n + recovery)
---------- Post added at 07:06 PM ---------- Previous post was at 07:05 PM ----------
and the long text you posted is the help page. Every time you see that page means you did not typed a valid command.
Click to expand...
Click to collapse
WOW, Finally, I did !!!!!!! I hadn't supersu in my device. I was deleted it. I installed supersu by adb sideload today,It works well.!!!!!!!!
Thank U !!!! thank u very much(x100).!!!!!!!!!!!! U save my money and life.!!!!
Now, Should I s-off to go back to stock rom???
And If I clicked the Thanks, Can't I ask this inquiry???
Anyway Thanks Mr.alray. Ur perfert Guy!!!!!!:good:

Getting rid of the emulated CD drive and unknown devices in MTP mode [Partial Fix]

When you connect your MIUI device to the computer through USB in File Transfer (MTP) mode (that is, not in Photo Transfer), it also emulates a CD-ROM drive. The ISO image for the fake CD contains a copy of Mi Assistant, a device management tool for the PC, which is in Chinese only and can be downloaded from the Internet anyway. Basically, it's all useless and mildly annoying.
View attachment 3137500
Here's what you need to do to get rid of it:
Step 1. Edit /system/build.prop and add the line:
Code:
persist.service.cdrom.enable=0
Step 2. Edit /init.qcom.usb.rc and where it says:
Code:
on property:sys.usb.config=mtp
(a) Change the first line to remove mention of mass_storage (this is for the CD only):
Code:
write /sys/class/android_usb/android0/functions mtp
(b) Remove these two lines:
Code:
write /sys/class/android_usb/android0/f_mass_storage/lun/ro 1
write /sys/class/android_usb/android0/f_mass_storage/lun/file /data/miui/cdrom_install.iso
Similarly, where it says:
Code:
on property:sys.usb.config=mtp,adb
(a) Change the first line after the above to:
Code:
write /sys/class/android_usb/android0/functions mtp,adb
(b) Remove these two lines:
Code:
write /sys/class/android_usb/android0/f_mass_storage/lun/ro 1
write /sys/class/android_usb/android0/f_mass_storage/lun/file /data/miui/cdrom_install.iso
Step 3. Delete the ISO image file to free up some space.
File location: /data/miui/cdrom_install.iso
And here's how to do it:
Using Android Debug Bridge from the command line:
Code:
adb root
adb shell "mount -o remount,rw /system"
adb shell "echo persist.service.cdrom.enable=0 >>/system/build.prop"
adb pull /init.qcom.usb.rc
Now use your favorite editor to make changes as described above in step 2.
Code:
adb push init.qcom.usb.rc /
adb shell "mount -o remount,ro /system"
adb shell "rm -f /data/miui/cdrom_install.iso"
adb reboot
Using ES File Explorer:
Download from Play Store or the developer's website. Install. Open. In context menu (hold leftmost button for 1 second), switch Root Explorer to On (this will fail). Go back to the home screen. Open Security, Permissions, Root Access. Put the switch next to ES File Explorer to On. Now you can switch back to ES File Explorer, and follow the steps 1-3 above. Use the built-in editor the make changes in the files.
Unknown USB devices when connected in MTP mode
When your device is connected in MTP mode (File Transfer) there are 3 unrecognized USB devices. To check if you have them too, go to Control Panel and choose Device Manager or run mmc devmgmt.msc from the command line (screenshot 1). The devices appear to have no hardware IDs (screenshot 2) and their class number seems to be {c897b31c-e8d2-59e9-a212-ccf0962fe102} (full registry dump provided as attachment).
View attachment 3137478 View attachment 3137479
This problem appears to be caused by the CD-ROM emulation as well: the number of devices will actually increase to 4 when it's switched off following the instructions above, which means there must be one extra step to get rid of it completely. This doesn't seem to cause any problems and the issue appears to be purely cosmetic. If I have time to investigate it further, I will report the conclusions back here. Meanwhile, if anyone has an idea what the cause is, please feel free to share it (might also be a driver issue).
Disclaimer: there might be some mistakes in what I wrote. Please use at your own discretion. This should work with a "developer" stock ROM out of the box, otherwise you'll need to set-up root access first.
Update for a total fix, and a more elegant approach
So the missing link to make the mysterious devices disappear is to edit /init.qcom.usb.rc and where it says:
Code:
case "$cdromenable" in
0)
Comment out (put the # sign) in front of:
Code:
#echo "" > /sys/class/android_usb/android0/f_mass_storage/lun0/file
The best way to make the whole change seems to be to unpack boot.img, for example with Android Image Kitchen, apply the patches (diffs attached), rebuild the image, and flash it. The persist.service.cdrom.enable=0 property can be set in /default.prop so that all the changes are contained within the boot image. In summary:
Code:
unpackimg boot.img
echo "persist.service.cdrom.enable=0" >>ramdisk/default.prop
patch ramdisk/init.qcom.usb.rc < init.qcom.usb.rc.diff
patch ramdisk/init.qcom.usb.sh < init.qcom.usb.sh.diff
repackimg
cleanup
adb reboot bootloader
fastboot erase boot
fastboot flash boot image-new.img
fastboot reboot
@ Aqq123 thanks for the write up, I have a Mi 4C and the iso file is not in /data/miui/ but it still shows up when connecting to pc

[how to]lock/unlock your bootloader without htcdev(s-off required)

READ THIIS!
*this thread is for desire 510. it will NOT work on m7,or any older device. please check the general forum for your particular device for a similar thread.
this thread will let you unlock your bootloader without htcdev,or let you change your hboot watermark from relocked or unlocked back to stock.
advantages
-no hassle with htcdev,tokens,or unlock codes
-no submitting your phones personal info to htc
-the ability to get back to 100% stock without any visual traces or records of having been s off or unlocking your bootloader.
*you must be s off.
*you must have superuser installed
read this:
this will not work if your s on. its not a way to magically unlock
the usual disclaimers:
use this info at your own risk. if it melts your phone into a little pile of plastic goo,its not my fault.
credits
-beaups for schooling me on echo comand protocol
-strace for originally discovering the location of the lock status flag(check out this thread for more info)
*i have tested this on my gsm cricket desire 510 variant(a11_ul). let me know if you try it on a different variant,or if youd like to dump partitions and have me take a look
IF you are an advanced user with adb/fastboot set up and some basic knowlede of the cmd window,you can skip to #2
1)set up adb(windows 7 and older)
-download this file
-install drivers: if you have htc sync installed,you should allready have drivers. if not,you can install htc sync,or install these modified htc drivers from revolutionary (driver mirror)
-unzip your miniadb_v1031.zip file. this is native funtionality in windows 7. you otherwise may need a utility such as "7-zip" to extract,or unzip it. place the unzipped folder onto the root of your C drive on your PC. root means the top level,not inside any folders. so just copy and paste,or drag and drop the folder onto C with everything else that is there. you may want to rename it to "miniadb_m7" since youll be putting some device specific files in here.
-open a command window. on windows 7,click the start bubble in the lower left and type "command" in the search box. xp i believe is similar or the same. doing this should open a small black command window.
-change to your miniadb_m7 directory. type the following at the prompt in your cmd window:
cd c:\miniadb_m7
your command promt should change to "c:miniadb_m7>" provided you: 1)unzipped the miniadb_v1031 zip file,and 2)put the folder on your c drive,and 3)entered the name of the folder correctly ("miniadb_m7" in this case)
-now make sure usb debugging is checked in developer options(you will need to turn it on first),and plug your phone into your PC with a usb cable
-make sure your phone is being recognized- type:
adb devices
if your drivers are installed correctly,this should return your phones serial number. you should hear the "found device" noises when you plug your phone in. if it starts installing drivers,wait for it to finish before typing the adb devices command.
if you get your serial number back,then enter this command:
adb reboot bootloader
this should take your phone to the "fastboot" screen,wich is white with colored letters. this is one mode of your bootloaders interactive modes. at the top youll see fastboot devices as confirmation youre in fastboot.
now enter:
fastboot devices
again,this should return your phones serial number. you should hear the "found device" noises when you plug your phone in. if it starts installing drivers,wait for it to finish before typing the adb devices command.
if you get your serial number back,you can enter the following to boot back to the phones OS:
fastboot reboot
and now,youve installed adb/fastboot and tested youre phones drivers. if at either spot,you have trouble and dont get your serial number back,there is some sort of connection issue. use these steps to troubleshoot:
troubleshooting connectivity issues:
-try a reboot of the PC
-try different usb cables and ports
-dont use a usb hub
-dont use usb 3.0
-make sure nothing capable of comunicating with the phone is enabled and running. htc sync,pdanet,easy tether,and even itunes have all been known to cause issues.
-windows 8 has been known to have issues. try a windows 7 or older machine
failing the above,
-i use these drivers for fastboot and adb(donwload and run as admin): http://downloads.unrevoked.com/HTCDriver3.0.0.007.exe (mirror)
failing that,try manually updating the drivers in the following manner:
-put the phone in fastboot mode(select fastboot from the hboot menu)
-open device manager on the PC
-plug in phone,watch for it to pop up in device manager.
-update drivers with device manager,pointing the wizard to the extracted
driver download folder from above
note that you can check the connectivity of the phone,and make sure drivers are working by in the following manner:
-open cmd window. change to directory containing adb/fastboot utilities
-adb with the phone in the booted OS,usb debug enabled,enter:
adb devices in a cmd window
-fastboot with phone in fastboot,enter:
fastboot devices in cmd window
in either case,a properly connected phone with working drivers installed should report back the phones serial number.
Click to expand...
Click to collapse
this process,in your cmd window,should look something like this:
Code:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Scott>[COLOR="red"]cd c:\miniadb_m7[/COLOR]
c:\miniadb_m7>adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
FAxxxxxxxxxx device
c:\miniadb_m7>[COLOR="red"]adb reboot bootloader[/COLOR]
c:\miniadb_m7>[COLOR="red"]fastboot devices[/COLOR]
FAxxxxxxxxxx fastboot
c:\miniadb_m7>[COLOR="red"]fastboot reboot[/COLOR]
rebooting...
finished. total time: 0.037s
c:\miniadb_m7>
2)reset your "lock status flag"
to LOCK your bootloader,enter the following:
adb devices
adb shell
su (if needed to get a # prompt)
echo -ne '\x00\x00\x00\x00' | dd of=/dev/block/mmcblk0p2 bs=1 seek=33796
(i would very strongly recomend you copy/paste this)
exit
(exit a second time if you need to to get back to a normal > prompt)
adb reboot bootloader
verify you are now locked
_____________________________________________________________________________________________
to UNLOCK your bootloader,enter the following:
adb devices
adb shell
su (if needed to get a # prompt)
echo -ne "HTCU" | dd of=/dev/block/mmcblk0p2 bs=1 seek=33796
(i would very strongly recomend you copy/paste this)
exit
(exit a second time if you need to to get back to a normal > prompt)
adb reboot bootloader
verify you are now unlocked
other useful threads:
remove your tampered banner: http://forum.xda-developers.com/desire-510/general/how-to-remove-tampered-banner-t3179866
mine too

Categories

Resources