error: Unhandled error: ReferenceError: grep is not defined
> at [object Object].ADB.shell (E:\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:192:46)
> at [object Object].<anonymous> (E:\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:942:16)
> at [object Object].<anonymous> (E:\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:180:9)
> at ChildProcess.exithandler (child_process.js:742:7)
> at ChildProcess.emit (events.js:110:17)
> at maybeClose (child_process.js:1016:16)
> at Process.ChildProcess._handle.onexit (child_process.js:1088:5) context: [POST /wd/hub/session {"capabilities":{"firstMatch":[{"platformName":"Android","appium:deviceName":"127.0.0.1:62001","appium:platformVersion":"5.0","appium:appPackage":" com.tencent.mm","appium:appActivity":"com.tencent.mm]
出現這個錯誤一般是appium 版本過低(1.4.16),此時升級appium:
npm update -g appium
如果出現錯誤,
則可以
那麼就先卸載appium
步驟一:cmd命令行中 執行npm uninstall -g appium (卸載appnium)
步驟二:cmd命令行中執行 npm cache clean (清理cache緩存)
步驟三:cmd命令行中執行 npm install -g appium (安裝appium)
如果還是不行,寫在appium後,刪除appium下的所有文件,在使用npm install -g appium 安裝appium
此時的版本號是:1.15.1
然後此問題可以得到解決