i am getting below error while trying to open uiautomatorviewer from both terminal and try to open file itself.
MacBook-Pro:~ aalpesh81$ uiautomatorviewer -Djava.ext.dirs=/Users/aalpesh81/Library/Android/sdk/tools/lib/x86_64:/Users/aalpesh81/Library/Android/sdk/tools/lib is not supported. Use -classpath instead. Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.
uiautomatorvieweronly compatible with java 8. But there is another problem with mac. Even if you will be able to open the uiautomatorviewer, it won't work.Below screenshot for reference.UI automator and running in terminal
However you can switch of appium inspector