To use the uiautomator and uiautomatorviewer tools, you must have the following versions of the Android development tools installed:
- Android SDK Tools, Revision 21 or higher
- Android SDK Platform, API 16 or higher
Update Android SDK Tools to revision 21 and Android SDK Platform-tools to revision 16 from Android SDK Manager.
You will get uiautomatorviewer.bat in your \android-sdk\tools directory.
Then you can run the uiautomatorviewer.
Hope this will help.