解决appium-desktop 定位元素页提示:Could not obtain source: {"cause":{"sessionId":"6367bdd3-0a2a-4ab0......的问题

    近期上线的app,在跑脚本时开始报错,appium也定位不到页面,但是定位其他app时都正常,因此困扰了我一点时间,看过很多博客后,一点一点的发现解决的所在  首先在appium desktop配置中加入"automationName": "uiautomator2" ,uiautomator2驱动我在此以前单独下载过,具体要不要下载大家可以再试,之后我启动appium desktop提示:An unknown server-side error occurred while processing the command. Original error: Could not find aapt Please set the ANDROID_HOME environment variable with the Android SDK root directory path.现在问题是环境变量有问题,之后我用输入appium-doctor,发现ANDROID_HOME is not set,然后查看环境变量,当时配置名字时照着网上复制,我的变量名是ANDROID_SDK_HOME,这个路径appium不认,最后我改成ANDROID_HOME,关闭设备在重启,appium就可以正常定位到元素页面。

    注意点1.添加:"automationName": "uiautomator2",2.环境变量名:ANDROID_HOME

解决appium-desktop 定位元素页提示:Could not obtain source: {"cause":{"sessionId":"6367bdd3-0a2a-4ab0......的问题