Android uses a real machine to debug programs through USB

Source: Internet
Author: User

My host is very old and it takes several minutes to start an android simulator. But thanks to the fact that there is an android real machine, debugging directly on the Android phone is also a good choice. Next I will introduce how to use Android mobile phones to debug Android applications.ProgramSteps required:(Typical Hello World Program)

1. Connect your mobile phone to your computer through a data cable

2. Set the Android phone to USB debugging mode. Steps:Choose menu> Settings> Application> development, and select USB debugging]

3. If Windows is used, the system will prompt you to install the driver:

Select the correct android SDK installation directory and click Next. The system will start to install the driver.

4,
After the driver is installed, restart the computer (the system usually prompts "install a new driver and restart it to take effect ").

5. Repeat steps 1st and 2nd to open the command window and check whether the mobile phone device has been identified, as shown below:

"Ht99ylg11834 device" is the detected mobile phone device.

6. Next, we will start debugging the android program on Eclipse,Right-click the android project and choose run as> Android Application., The following window is displayed: (this happens only after the system is restarted)

7. Select the mobile phone device, click OK, and the program will start to be installed on the real machine. The console outputs the following information:

[22:24:49-helloworld] uploading helloworld.apk onto device 'ht99ylg11834 ′
[22:24:49-helloworld] installing helloworld.apk...
[22:24:53-helloworld] success!
[22:24:53-helloworld] Starting activity com. eightqiu. activity. statsresultactivity on Device
[22:24:57-helloworld] activitymanager: Starting: intent {
Act = Android. Intent. Action. Main cat = [Android. Intent. Category. Launcher]
CMP = com. eightqiu. Activity/. statsresultactivity} 8. Run this application so that you can use your mobile phone to test it.
    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.