How to turn on Viewserver on the root phone so that hierachyviewer can connect

Source: Internet
Author: User

Implementation principle

Hierarchy Viewer: Get the current mobile phone real-time UI information, convenient for mobile phone automation testing;

The subprocess in Python. Popen (): Call system command;

Uiautomator tool: Get interface control information;

ADB command: To operate the mobile phone;

Test environment

1. Hierarchyviewer will map the next Android device's 4939 port to the 4939 port of the PC

ADB devices View mobile device number

Adb-s Mobile device number forward tcp:4939 tcp:4939

2, determine whether the phone has opened the view server, if not turned on the open

Adb-s Mobile device Number Shell service Call window 3

View by return value

"Result:parcel (00000000 00000000 ' ... ')--not open

"Result:parcel (00000000 00000001 ' ... ')--open

Open View Server

Adb-s Mobile device Number Shell Service Call window 1 i32 4939

Close View server

Adb-s Mobile device Number Shell service Call window 2 i32 4939

Note: Only the emulator or root phone can open the view service, the actual operation of the root phone to open the view service is not the command to complete, so first use the simulator to test

About the real-machine open reference the following link: brush into a brick machine is not responsible

Http://maider.blog.sohu.com/255448342.html

How to turn on Viewserver on the root phone so that hierachyviewer can connect

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.