gpt4 book ai didi

android - uiautomatorviewer 不适用于最新的 MacOS

转载 作者:行者123 更新时间:2023-12-04 14:12:47 26 4
gpt4 key购买 nike

我正在尝试在 MacOS 10.15 上使用 uiautomatorviewer。我收到以下错误。

enter image description here

我在 MacOS 10.13 上测试了 uiautomatorviewer。它工作得很好。

这是错误信息:

Unexpected error while obtaining UI hierarchy java.lang.reflect.InvocationTargetException  on latest Mac OS

这是日志的详细信息

Unhandled event loop exception during blocked modal context.
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Unknown Source)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:173)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:388)
at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)
at com.android.uiautomator.actions.ScreenshotAction.run(ScreenshotAction.java:85)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at ialogs.ProgressMonitorDialog$ProgressMonitor.subTask(ProgressMonitorDialog.java:234)

最佳答案

此问题发生在 SDK 版本中。我通过执行以下操作解决了我的问题-

将您的 Java 版本降级为“1.8.0_231”,您可以在此处获取:https://www.oracle.com/java/technologies/javase/javase8u211-later-archive-downloads.html

在你的 bash_profile 中设置环境。这样做

go to MAC DISK and find ".bash_profile"Open,edit and set the path

例子:

export ANDROID_HOME=~/Library/Android/sdk
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home

export PATH=$PATH:$JAVA_HOME/bin
export PATH=$PATH:$JAVA_HOME/lib
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/build-tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/tools/lib/x86_64

退出终端并重新打开输入“uiautomatorviewer”并回车...

就是这样。

关于android - uiautomatorviewer 不适用于最新的 MacOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63033104/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com