Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
307 views
in Technique[技术] by (71.8m points)

android - Can hierarchyviewer be used with a real device other than the Nexus?

I'd really like to use hierarchyviewer with my Samsung Galaxy S. Is there any way to turn it into a developer phone?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

RomainGuy is correct, but since he had developed the debug ViewServer you can use HierarchyViewer for your own application on ANY phone now. To do this simply add RomainGuy's ViewServer into your application.

https://github.com/romainguy/ViewServer

From ViewServer JavaDoc:

This class can be used to enable the use of HierarchyViewer inside an application. HierarchyViewer is an Android SDK tool that can be used to inspect and debug the user interface of running applications. For security reasons, HierarchyViewer does not work on production builds (for instance phones bought in store.) By using this class, you can make HierarchyViewer work on any device. You must be very careful however to only enable HierarchyViewer when debugging your application.

To use this view server, your application must require the INTERNET permission.

If you use Android Annotations library, it's even simpler - just annotate your activity with @HierarchyViewerSupport annotation.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...