In the Android simulator of eclipse, DDMS does not see the solution of the device and sometimes does not print the Log, and you have to make minor changes.

Source: Internet
Author: User

After starting the simulator AVD in eclipse, you will see the related devices in the console when you are just starting, and there will also be a list of devices in DDMS, which is only offline,
However, when the device is fully started, there is nothing in DDMS, and there is no device to view the device with the adb command adb devices.

Generally, restart the computer.
What I want to talk about is not to restart the computer:
1. Open the cmd command line and switch to the adb command directory. If you have added environment variables, you can save the effort to switch the directory.

2. Enter the command adb kill-server, and adb is killed.

3. Enter the command adb start-server to restart adb.

4. Run the adb devices command again to check whether the device is displayed.

This method is applicable not only to simulators, but also to physical devices.

No Log Printing

Problem: after connecting the mobile phone to the computer, the driver is correctly installed and the USB debugging mode is enabled. The device and its process information can be seen in DDMS, but no information is output in logcat.
Cause: logcat is disabled by default in some rom
Problem description: In ddms, the display of the device name as a question mark does not affect, that is, the display of adb get-serialno as a question mark does not affect.
Solution:
1. root permission required (not required for some rom)
2. Open logcat, set the level, and run the following command (after android upgrade, adb is in platform-tools, not in tools)
Adb shell
Echo 1>/sys/kernel/logger/log_main/enable
Note: 1 is written to the log switch file, 1 is on, and 0 is off.
Echo 2>/sys/kernel/logger/log_main/priority
Description: writes level 2 to priority files.
3. Restart adb. If eclipse is used, disable eclipse, restart adb, and then start eclipse.
Adb kill-server
Adb start-server
4. logcat should be able to work now. If it still does not work, update adb
Android update adb
5. Repeat Step 3. At this time, logcat should be able to work. If it still does not work, find the android directory in your home directory, such as C: \ Documents ents and Settings \ Administrator \. android.
Find the adb_usb.ini file in this directory. The content of the file is only three lines by default, all of which are comments. Add a line after it and the content is 0x12d1.
6. Repeat Step 3. logcat should be ready to work now.

The above is still useless for debugging and printing logs on mobile phones. I don't know if this person has tried to use mobile phone debugging to print information. I tried it but it didn't work. It would be nice to use a simulator, you can use the above method. But the simulator is not omnipotent. Yesterday I ran a program I wrote on the simulator, but it was impossible to install it on a real machine, after debugging, I found that I used the testing machine of the company to do the experiment. I didn't place the number card on the testing machine, so I got an empty number string on the real machine, I want to remove "+ 86" in the program. When intercepting the character length, a serious array out-of-bounds error occurs. Find the modification and OK. However, some function simulators are not available. The Gravity Sensors, direction sensors, and distance sensors on mobile phones are not available on the simulator and can only be tried on the real machine, however, the android simulator is quite powerful and can be used for most development.


Today, I solved the above problem. I updated the ADT 18 version to 20. I can see the printed result on my mobile phone.

Related Article

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.