Monkeyrunner _ use monkeyrunner to connect to a mobile device

Source: Internet
Author: User

Today, I encountered a problem, that is, using the simulator that monkeyrunner always runs, and the phone I connect to does not respond at all. This is quite strange, so I checked the information and solved it now.

1. The name of the connected device obtained through ADB devices should display the simulator name and mobile phone name.

For example:

ADB Devices

List of devices attached
M9w1b08akduhxo2991 Device
Emulator-5554 Device

From Com. Android. monkeyrunner import monkeyrunner, monkeydevice
Device = monkeyrunner. waitforconnection (5, 'phone name') # Name of the phone 'm9w1b08akduhxo2991'

In this way, you can connect to the mobile phone instead of the simulator. It's very easy. Try it now!

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.