Solutions to problems encountered during flash and some insights

Source: Internet
Author: User

Because of the project, you need to brush your mobile phone. The mobile phone number is Nexus 4. I sent the project document and the image file of the flash system to me.

I have basically never used Android phones before, and I have never used Android phones. In addition, I have a careless character. I have been using Android phones for N days, and I have been wasting my work for a few days. Just now, I finally succeeded, and it is hard to express my excitement. During this period, I encountered various problems and made many detours. Now I think that sometimes the practices and ideas are really ridiculous, but I also realized some truth. To sum up, you may be able to use it.


Flash in Linux: Install ADB and fastboot

Step 1: Enter the lsusb command on the Linux terminal to query the devices on the USB bus. For example, the query result is as follows:
Bus 005 device 001: Id 1d6b: 0001 Linux Foundation 1.1 root Hub
Bus 004 device 001: Id 1d6b: 0001 Linux Foundation 1.1 root Hub
Bus 003 device 001: Id 1d6b: 0001 Linux Foundation 1.1 root Hub
Bus 002 device 001: Id 1d6b: 0001 Linux Foundation 1.1 root Hub
Bus 001 device 002: Id 15a2: 0c02 Freescale semicondu, Inc.
Bus 001 device 001: Id 1d6b: 0002 Linux Foundation 2.0 root Hub
15a2 is the device ID number.

If it is not obvious, you can unplug the data line to find the device Number of the mobile phone.

Step 2: download the latest Android SDK and decompress it to a directory ,.

The files downloaded here seem incomplete. After downloading the files, check whether there are tools and platform-tools folders. If not, search Baidu Network Disk,

Android SDK versions

I downloaded it from Baidu online storage. In addition, the 32-bit and 64-bit versions also seem to affect the flash drive. It is best to download the correct version.

So far the latest SDK for android-sdk_r12-linux_x86.tgz
Extracted name is android-sdk-linux_x86
Go to the following directory:
CD android-sdk-linux_x86/tools/
Then run:./Android update ADB on the terminal.

Step 3: Modify ~ The/. Android/adb_usb.ini file. Note that the path in root mode is normal,
This directory does not exist.
# Android 3rd party USB vendor ID list -- Do not edit.
# Use 'android update adb' to generate.
#1 USB vendor ID per line.
0x15a2

Step 4: create a file for a new udev rule, create a file named imx-android.rules in the/etc/udev/rules. d path, and edit the content as follows:
Subsystem = "USB", sysfs {idvendor} = "15a2", mode = "0666"

Step 5: declare the ADB path in/etc/bash. bashrc:
Export Path = ........
Then
Source/etc/bash. bashrc

If not, enter export Path = $ path :/...........

However, you need to introduce the directory when you open the terminal next time.


Step 6: restart ADB
ADB kill-Server
ADB start-Server
Step 7: Use the ADB devices command to find the device:
[Email protected]:/opt/Program/mx53_smd/out/host/linux-x86/bin # ADB Devices
List of devices attached
0123456789 abcdef Device
So far, ADB has been installed successfully.

Enter fastboot devices in the terminal to check whether the fastboot installation is successful.


Enter fastboot Mode

Enter ADB fastboot bootloader in the terminal

You can also press the combination of buttons on your phone to enter the fastboot mode. For example, you can press the volume drop key + screen lock key to access Nexus 5.

Some posts need to enter fastboot mode with the root permission; otherwise, waiting for device will appear during the flash.


Image swiping. imgfile

Go to the directory where the image file is saved,

Set the "android_product_out" environment variable, which specifies the path for storing the compiled image file on the PC.

Env android_product_out = 'pwd' fastboot flashall-W

PWD indicates the current directory




Flash on Windows: Install ADB

Download the corresponding SDK and add the platform-tools path to the environment variable.

You can also download the flashing genie to provide the environment required for flashing.


Enter fastboot Mode

Same as above


Image swiping. imgfile

Change env android_product_out = 'pwd' to set android_product_out = .....

Assume that the storage path of the image file is D:/product/and the android_product_out environment variable is set android_product_out = D:/product/


FAQs and reference blogs

Waiting for device solution:

1. The fastboot driver version does not match or the fastboot driver is not installed.

2. You need to grant the root permission to flash the machine, add sudo to the fastboot command, or switch to the root permission.

ADB version is different, 64 computer download is 32-bit, in Ubuntu system install ia32-libs Method

Sudo cannot find the command: Modify the path of sudo

Fastboot mode upgrade

Error: coshould not load android-info.txt

Recovery Method After incorrect Linux environment variable settings


Perception

1. the wrong file is very time-consuming.

For the SDK downloaded earlier, the platform-Tools Folder is missing for the first download. I thought the tool directory is the platform-tools Directory, which delayed my day. Later, the download was 32-bit, and an error occurred during the flash.


2. Check related knowledge before you start

For example, the previous env android_product_out = 'pwd', I set android_product_out = 'pwd' in windows, the error: cocould not load android-info.txt, I checked a lot of methods, then we found out the meaning of PWD. After correction, the machine was successfully installed. Because of this problem, I have taken many detours. If I find out the purpose of this command in advance, it will not delay so long.


3. Do not trust in authority

Sometimes I ask some experts, maybe their research direction is not in this aspect, even in this aspect, it may also make mistakes. In the past, the word "too superstitious" came to the forefront.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.