Objective
Part of the real machine may appear each run code, start the app will be repeatedly installed unlock and appium setting these two gadgets, some phones will automatically install, this is OK.
Some phones will pop up an installation confirmation box each time (such as some millet and vivo appear), so it is more troublesome, do not manually go to the point, you can not continue to execute the code.
Note: Appium older versions 1.4 and Appium desktop v1.7 after the installation path is not the same, there are differences
Appium Desktop (more than 1.7 version) as an example of the small series
My environment:
Appium Desktop version
1. First look at the Appium Desktop installation version, for example, my version is v1.7.1
2. After double-click the installation, will be installed to the C drive, you can search directly: Appium desktop, and then the following levels to find Android-helpers.js modify the following several places
\appium-desktop\resources\app\node_modules\appium\node_modules\appium-android-driver\lib
修改如下几个地方:1.注释掉355行 // await adb.install(unicodeIMEPath, false); 2.注释掉522行 // await helpers.pushSettingsApp(adb);3. 注释掉526行 // await helpers.pushUnlock(adb);
3. Continue to find the Android-helpers.js file under Build\lib
\appium-desktop\resources\app\node_modules\appium\node_modules\appium-android-driver\build\lib
修改如下几个地方:1.注释掉919行,然后加一行代码 // return _regeneratorRuntime.awrap(adb.install(_appiumAndroidIme.path, false)); return context$1$0.abrupt('return', defaultIME);2.注释掉1366行,然后加一行代码 // return _regeneratorRuntime.awrap(helpers.pushSettingsApp(adb)); return context$1$0.abrupt('return', defaultIME);3.注掉1380行,然后加一行代码 // return _regeneratorRuntime.awrap(helpers.pushUnlock(adb)); return context$1$0.abrupt('return', defaultIME);
Save after modifying, then restart Appium, re-execute code, will not repeat installation unlock and appium setting
Appium Desktop command-line version
1. If the Appium command-line version is installed via NPM, my command-line version is 1.8.1, then search in C: NPM, then find the following path on the layer
\npm\node_modules\appium\node_modules\appium-android-driver
2. Open changes in \npm\node_modules\appium\node_modules\appium-android-driver\lib\android-helpers.js
修改如下几个地方:1.注释掉358行 // await adb.install(unicodeIMEPath, false); 2.注释掉570行 // await helpers.pushSettingsApp(adb);3. 注释掉581行 // await helpers.pushUnlock(adb);
3. Continue to open changes in \npm\node_modules\appium\node_modules\appium-android-driver\build\lib\android-helpers.js
修改如下几个地方:1.注释掉782行,然后加一行代码 // return _regeneratorRuntime.awrap(adb.install(_appiumAndroidIme.path, false)); return context$1$0.abrupt('return', defaultIME);2.注释掉1285行,然后加一行代码 // return _regeneratorRuntime.awrap(helpers.pushSettingsApp(adb)); return context$1$0.abrupt('return', defaultIME);3.注掉1321行,然后加一行代码 // return _regeneratorRuntime.awrap(helpers.pushUnlock(adb)); return context$1$0.abrupt('return', defaultIME);
This article is mainly to solve appium1.7 above version, different version number code line number will be a little bit different
Appium+python Automated 55-appium Desktop installation unlock and Appium setting issues every time you start