Pycharm 一跑总提示:
[35m[W3C]�[39m Encountered internal error running command:Error: JAVA_HOME is not set currently. Please set JAVA_HOME.
[debug]�[35m[W3C]�[39m at getJavaHome (/usr/local/lib/node_modules/appium/node_modules/appium-adb/lib/helpers.js:141:9)
[debug]�[35m[W3C]�[39m at /usr/local/lib/node_modules/appium/node_modules/appium-adb/lib/helpers.js:125:23
[debug]�[35m[W3C]�[39m at memoized (/usr/local/lib/node_modules/appium/node_modules/lodash/lodash.js:10552:27)
[debug]�[35m[W3C]�[39m atADB.signWithDefaultCert(/usr/local/lib/node_modules/appium/node_modules/appium-adb/lib/tools/apk-signing.js:76:22)
[debug]�[35m[W3C]�[39m atADB.sign(/usr/local/lib/node_modules/appium/node_modules/appium-adb/lib/tools/apk-signing.js:175:5)
[debug]�[35m[W3C]�[39m atObject.helpers.signApp(/usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-driver/lib/helpers.js:41:3)
[debug]�[35m[W3C]�[39m atUiAutomator2Server.installServerApk(/usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-driver/lib/uiautomator2.js:99:11)
[debug]�[35m[W3C]�[39m atAndroidUiautomator2Driver.initUiAutomator2Server(/usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-driver/lib/driver.js:440:7)
[debug]�[35m[W3C]�[39m atAndroidUiautomator2Driver.startUiAutomator2Session(/usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-driver/lib/driver.js:338:5)
[debug]�[35m[W3C]�[39m atAndroidUiautomator2Driver.createSession(/usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-driver/lib/driver.js:212:7)
[debug]�[35m[W3C]�[39m atAppiumDriver.createSession(/usr/local/lib/node_modules/appium/lib/appium.js:358:35)
但实际上echo $JAVA_HOME是正常的。
但是去操作底层配置是发现无法修改配置文件,这个配置文件是之前拷贝机的权限。所以拷贝有风险啊。