1. 程式人生 > >Appium升級後安裝UnicodeIME-debug.apk 提示

Appium升級後安裝UnicodeIME-debug.apk 提示

invoke orf b-s 找到 tab pos AS and pda

使用appium1.8 ,啟動app過程中報錯:

2018-05-08 17:09:16:890 - [W3C] Encountered internal error running command: Error: [100%] /data/local/tmp/UnicodeIME-debug.apk

2018-05-08 17:09:16:890 - [W3C] /usr/local/lib/node_modules/appium/node_modules/[email protected]@appium-android-ime/bin/UnicodeIME-debug.apk: 1 file pushed. 4.5 MB/s (36795 bytes in 0.008s)

2018-05-08 17:09:16:890 - [W3C] pkg: /data/local/tmp/UnicodeIME-debug.apk

2018-05-08 17:09:16:891 - [W3C] Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]

2018-05-08 17:09:16:893 - [W3C] at ADB.executeInstall$ (/usr/local/lib/node_modules/appium/node_modules/[email protected]@appium-adb/lib/tools/apk-utils.js:398:13)

2018-05-08 17:09:16:893 - [W3C] at tryCatch (/usr/local/lib/node_modules/appium/node_modules/[email protected]@babel-runtime/regenerator/runtime.js:67:40)

2018-05-08 17:09:16:894 - [W3C] at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/[email protected]@babel-runtime/regenerator/runtime.js:315:22)

2018-05-08 17:09:16:894 - [W3C] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/[email protected]@babel-runtime/regenerator/runtime.js:100:21)

2018-05-08 17:09:16:894 - [W3C] at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/[email protected]@babel-runtime/regenerator/runtime.js:136:37)

2018-05-08 17:09:16:894 - [W3C] at <anonymous>

2018-05-08 17:09:16:895 - [HTTP] <-- POST /wd/hub/session 500 5747 ms - 1834

按照提示,實在按裝apk時報錯,apk位置。/usr/local/lib/node_modules/appium/node_modules/[email protected]@appium-android-ime/bin/UnicodeIME-debug.apk

報錯:INSTALL_FAILED_UPDATE_INCOMPATIBLE

這個提示原因是簽名發生改變,看樣子是升級到appium 1.8 。而手機以前安裝過這個app,簽名不一致導致的。在手機界面一時也找不到這個app來協助。就只有通過安裝adb 命令來卸載這個app。命令卸載要知道這個app的包名,包名可以通過aapt命令查詢。而aapt 命令在ANDROID_HOME目錄下的 build-tools/27.0.3/目錄中,可以把這個命令拷貝到ANDROID_HOME/tools/目錄下,這樣就不會提示 aapt command not found。找到appt命令,就可以獲取apk的報名了

執行命令:aapt dump badging /usr/local/lib/node_modules/appium/node_modules/[email protected]@appium-android-ime/bin/UnicodeIME-debug.apk

可以看到第一行

package: name=‘io.appium.android.ime‘ versionCode=‘1‘ versionName=‘1.0‘ platformBuildVersionName=‘4.4.2-1456859‘

其中 的io.appium.android.ime就是包名

執行adb uninstall io.appium.android.ime 刪除這個應用後再執行安裝

adb install /usr/local/lib/node_modules/appium/node_modules/[email protected]@appium-android-ime/bin/UnicodeIME-debug.apk 就可以安裝成功,appium 就可以再繼續正常運行了

Appium升級後安裝UnicodeIME-debug.apk 提示