(4) Simple Android Application Development-android real machine debugging

Source: Internet
Author: User

From: http://lizanhong2011.blog.163.com/blog/static/18028516720115255556461/

 

 

The speed of the Android mobile phone simulator is too slow to be tolerated. It is not only slow to start, but also card-and-card to run, which is a word of crash.

 

If you have an Android phone, it would be great. We can connect the phone to the computer through the data cable and directly use the real machine for debugging. The slow speed problem will be solved. I have a meizu M9 mobile phone (20) on hand. Like other Android phones, I can also debug Android applications through the USB interface.

 

To use a real machine for debugging, install the andorid 2.3 USB driver. There is no difference between installing the driver and common hardware. You can simply install the driver in the Device Manager. In addition, the specific methods for different mobile phones may be different. Please refer to the official documentation.

 

Determine whether the Android phone is found. Open the "command prompt" window, enter the <Android>/platform-tools directory, and enter the ADB devices command to view the installed mobile phone, as shown in Figure 21.

 

 

Figure 20: meizu M9 mobile phone I purchased

 

 

Figure 21: View installed mobile phones

 

In Figure 21, m9w1b00aka1ko02582 is the S/N of the mobile phone, and emulator-5554 is the started simulator. ADB finds two Android devices.

 

Finally, there is another important task to do. You must enable "USB debugging" in the mobile phone settings. Take M9 as an example. The configuration location is "Settings-> USB and development mode ", other mobile phones may be slightly different in brand and model, as shown in Figure 22.

 

 

Figure 22: Enable USB debugging

 

During the development process, we may find that the screen is automatically locked after 1 second (or several seconds, depending on the phone settings), and the system is in sleep state, which is inconvenient for us to develop. At this time, you can enable "Stay awake.

 

Now, when running the Android Application, you can publish the program to your mobile phone to run and view the effect.

 

 

 

 

If you do not use the 4.1 feature, you can modify Android: minsdkversion in androidmanifest. XML to 8, and then run it on Android 2.2.

 

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.