我正在尝试使用uiautomation查看器。当我连接到它并按“设备屏幕截图”按钮时,我得到:
adb未检测到android设备
错误获取设备 截图
资源:
//First set state
state = {
isResponse: false
}
function get() {
axios.get('url')
.then(response => this.setState({isResponse: true}))
.catch(err => console.log(err))
}
componentDidMount(){
//Set the number of trials
var numberOfTrials = 10
//Set the initial value
var n = 0
while(this.state.isResponse === false && n < numberOfTrials) {
get();
//Append everytime until reaches the numberOfTrials and stop
n += 1
}
}
服务器adb
的Windows 10(主机)"adb -a nodaemon server"
设备并获取设备的ID(到目前为止非常好)。在Linux上,我安装了Android Studio,并尝试通过adb
运行sdk>tool>bin
查看器。
到目前为止,该怎么做:(根据网上的答案)
将uiautomationviewer文件中的路径更改为:
uiautomation
(在/ bin中,我们有uiautomationvewr文件。
adb的路径为(“ adb which”)-Dcom.android.uiautomator.bindir=/home/ohad/Android/Sdk/tools