51Testing软件测试论坛

标题: appium setCapability (MobileCapabilityType.AUTOMATION_NAME, AutomationName.AN... [打印本页]

作者: 测试积点老人    时间: 2019-9-2 10:47
标题: appium setCapability (MobileCapabilityType.AUTOMATION_NAME, AutomationName.AN...
appium setCapability (MobileCapabilityType.AUTOMATION_NAME, AutomationName.ANDROID_UIAUTOMATOR2) 命令行报错扒了很久网站信息未得到解决,未设置ui2属性情况下,命令行启动server,脚本运行正常,而且很奇怪的是在桌面ui版appium-server下设置UI2属性是运行正常的
具体报错日志如下,有没有朋友也遇到过相同的坑? 目前排查跟zipalign.exe这个工具无关:
  1. [debug] [ADB] 1 device(s) connected
  2. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  3. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","shell","getpro
  4. p","ro.product.model"]
  5. [debug] [ADB] Current device property 'ro.product.model': Google Nexus 5X - 6.0.
  6. 0 - API 23 - 1080x1920
  7. [debug] [ADB] Getting connected devices...
  8. [debug] [ADB] 1 device(s) connected
  9. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  10. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","shell","getpro
  11. p","ro.product.manufacturer"]
  12. [debug] [ADB] Current device property 'ro.product.manufacturer': Genymotion
  13. [debug] [ADB] Getting connected devices...
  14. [debug] [ADB] 1 device(s) connected
  15. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  16. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","shell","am","f
  17. orce-stop","io.appium.uiautomator2.server"]
  18. [ADB] Checking whether aapt is present
  19. [ADB] Using aapt.exe from C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\build-
  20. tools\27.0.3\aapt.exe
  21. [debug] [ADB] Getting install status for io.appium.uiautomator2.server
  22. [debug] [ADB] Getting connected devices...
  23. [debug] [ADB] 1 device(s) connected
  24. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  25. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","shell","pm","l
  26. ist","packages","io.appium.uiautomator2.server"]
  27. [debug] [ADB] App is installed
  28. [debug] [ADB] Getting install status for io.appium.uiautomator2.server.test
  29. [debug] [ADB] Getting connected devices...
  30. [debug] [ADB] 1 device(s) connected
  31. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  32. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","shell","pm","l
  33. ist","packages","io.appium.uiautomator2.server.test"]
  34. [debug] [ADB] App is installed
  35. [debug] [ADB] Getting package info for io.appium.uiautomator2.server
  36. [debug] [ADB] Getting connected devices...
  37. [debug] [ADB] 1 device(s) connected
  38. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  39. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","shell","dumpsy
  40. s","package","io.appium.uiautomator2.server"]
  41. [debug] [UiAutomator2] Waiting up to 20000ms for instrumentation 'io.appium.uiau
  42. tomator2.server.test/android.support.test.runner.AndroidJUnitRunner' to be avail
  43. able
  44. [debug] [ADB] Getting connected devices...
  45. [debug] [ADB] 1 device(s) connected
  46. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  47. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","shell","pm","l
  48. ist","instrumentation"]
  49. [debug] [UiAutomator2] Instrumentation 'io.appium.uiautomator2.server.test/andro
  50. id.support.test.runner.AndroidJUnitRunner' available
  51. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  52. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","wait-for-devic
  53. e"]
  54. [debug] [ADB] Getting connected devices...
  55. [debug] [ADB] 1 device(s) connected
  56. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  57. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","shell","echo",
  58. "ping"]
  59. [debug] [AndroidDriver] Pushing settings apk to device...
  60. [debug] [ADB] Getting install status for io.appium.settings
  61. [debug] [ADB] Getting connected devices...
  62. [debug] [ADB] 1 device(s) connected
  63. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  64. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","shell","pm","l
  65. ist","packages","io.appium.settings"]
  66. [debug] [ADB] App is installed
  67. [debug] [ADB] Getting package info for io.appium.settings
  68. [debug] [ADB] Getting connected devices...
  69. [debug] [ADB] 1 device(s) connected
  70. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  71. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","shell","dumpsy
  72. s","package","io.appium.settings"]
  73. [ADB] Checking whether aapt is present
  74. [ADB] Using aapt.exe from C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\build-
  75. tools\27.0.3\aapt.exe
  76. [debug] [ADB] The installed 'io.appium.settings' package does not require upgrad
  77. e ('2.3.0' >= '2.3.0')
  78. [debug] [ADB] Getting connected devices...
  79. [debug] [ADB] 1 device(s) connected
  80. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  81. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","shell","ps"]
  82. [debug] [AndroidDriver] io.appium.settings is already running. There is no need
  83. to reset its permissions.
  84. [debug] [ADB] Device API level: 23
  85. [debug] [ADB] Getting connected devices...
  86. [debug] [ADB] 1 device(s) connected
  87. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  88. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","shell","appops
  89. ","set","io.appium.settings","android:mock_location","allow"]
  90. [AndroidDriver] setDeviceLanguageCountry requires language or country.
  91. [AndroidDriver] Got language: 'null' and country: 'null'
  92. [debug] [Logcat] Starting logcat capture
  93. [debug] [AndroidDriver] Enabling Unicode keyboard support
  94. [debug] [AndroidDriver] Pushing unicode ime to device...
  95. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  96. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","install","C:\\
  97. Users\\samfu.KAISER\\AppData\\Roaming\\npm\\node_modules\\appium\\node_modules\\
  98. _appium-android-ime@2.0.0@appium-android-ime\\bin\\UnicodeIME-debug.apk"]
  99. [debug] [ADB] Install command stdout: [100%] /data/local/tmp/UnicodeIME-debug.ap
  100. k
  101. C:\Users\samfu.KAISER\AppData\Roaming\npm\node_modules\appium\node_modules\_appi
  102. um-android-ime@2.0.0@appi...deIME-debug.apk: 1 file pushed. 0.5 MB/s (36795 byte
  103. s in 0.065s)
  104.         pkg: /data/local/tmp/UnicodeIME-debug.apk
  105. Failure [INSTALL_FAILED_ALREADY_EXISTS]
  106. [debug] [ADB] Application 'C:\Users\samfu.KAISER\AppData\Roaming\npm\node_module
  107. s\appium\node_modules\_appium-android-ime@2.0.0@appium-android-ime\bin\UnicodeIM
  108. E-debug.apk' already installed. Continuing.
  109. [debug] [ADB] Getting connected devices...
  110. [debug] [ADB] 1 device(s) connected
  111. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  112. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","shell","settin
  113. gs","get","secure","default_input_method"]
  114. [debug] [AndroidDriver] Unsetting previous IME com.android.inputmethod.latin/.La
  115. tinIME
  116. [debug] [AndroidDriver] Setting IME to 'io.appium.android.ime/.UnicodeIME'
  117. [debug] [ADB] Getting connected devices...
  118. [debug] [ADB] 1 device(s) connected
  119. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  120. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","shell","ime","
  121. enable","io.appium.android.ime/.UnicodeIME"]
  122. [debug] [ADB] Getting connected devices...
  123. [debug] [ADB] 1 device(s) connected
  124. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  125. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","shell","ime","
  126. set","io.appium.android.ime/.UnicodeIME"]
  127. [debug] [AndroidDriver] Pushing unlock helper app to device...
  128. [debug] [ADB] Getting install status for io.appium.unlock
  129. [debug] [ADB] Getting connected devices...
  130. [debug] [ADB] 1 device(s) connected
  131. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  132. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","shell","pm","l
  133. ist","packages","io.appium.unlock"]
  134. [debug] [ADB] App is installed
  135. [debug] [ADB] Getting package info for io.appium.unlock
  136. [debug] [ADB] Getting connected devices...
  137. [debug] [ADB] 1 device(s) connected
  138. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  139. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","shell","dumpsy
  140. s","package","io.appium.unlock"]
  141. [ADB] Checking whether aapt is present
  142. [ADB] Using aapt.exe from C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\build-
  143. tools\27.0.3\aapt.exe
  144. [debug] [ADB] The installed 'io.appium.unlock' package does not require upgrade
  145. ('2.0.0' >= '2.0.0')
  146. [debug] [UiAutomator2] Forwarding UiAutomator2 Server port 6790 to 8200
  147. [debug] [ADB] Forwarding system: 8200 to device: 6790
  148. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  149. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","forward","tcp:
  150. 8200","tcp:6790"]
  151. [debug] [ADB] Getting connected devices...
  152. [debug] [ADB] 1 device(s) connected
  153. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  154. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","shell","dumpsy
  155. s","window"]
  156. [AndroidDriver] Screen already unlocked, doing nothing
  157. [debug] [AndroidDriver] Extracting strings from apk C:\Users\samfu.KAISER\IdeaPr
  158. ojects\apptest\apps\ContactManager.apk null C:\Users\SAMFU~1.KAI\AppData\Local\T
  159. emp\com.example.android.contactmanager
  160. [debug] [ADB] Extracting strings for language: default
  161. [debug] [ADB] Device API level: 23
  162. [debug] [ADB] Getting connected devices...
  163. [debug] [ADB] 1 device(s) connected
  164. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  165. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","shell","getpro
  166. p","persist.sys.locale"]
  167. [debug] [ADB] Current device property 'persist.sys.locale':
  168. [debug] [ADB] Getting connected devices...
  169. [debug] [ADB] 1 device(s) connected
  170. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  171. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","shell","getpro
  172. p","ro.product.locale"]
  173. [debug] [ADB] Current device property 'ro.product.locale': en-US
  174. [debug] [ADB] No strings.xml for language 'en', getting default strings.xml
  175. [debug] [ADB] Reading strings from converted strings.json
  176. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  177. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","push","C:\\Use
  178. rs\\SAMFU~1.KAI\\AppData\\Local\\Temp\\com.example.android.contactmanager\\strin
  179. gs.json","/data/local/tmp"]
  180. [debug] [ADB] Checking app cert for C:\Users\samfu.KAISER\IdeaProjects\apptest\a
  181. pps\ContactManager.apk
  182. [ADB] Using apksigner.bat from C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\b
  183. uild-tools\27.0.3\apksigner.bat
  184. [ADB] Using apksigner.bat from C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\b
  185. uild-tools\27.0.3\apksigner.bat
  186. [debug] [ADB] Patching 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\build-to
  187. ols\27.0.3\apksigner.bat' for Windows...
  188. [debug] [ADB] Starting patched 'C:\Users\SAMFU~1.KAI\AppData\Local\Temp\201821-8
  189. 736-yhnhf.c2sbjg\apksigner.bat' with args 'verify,C:\Users\samfu.KAISER\IdeaProj
  190. ects\apptest\apps\ContactManager.apk'
  191. [debug] [ADB] 'C:\Users\samfu.KAISER\IdeaProjects\apptest\apps\ContactManager.ap
  192. k' is already signed.
  193. [debug] [UiAutomator2] Deleting UiAutomator2 session
  194. [debug] [UiAutomator2] Deleting UiAutomator2 server session
  195. [UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error
  196. was: Error: Trying to proxy a session command without session id
  197. [debug] [UiAutomator2] Resetting IME to 'com.android.inputmethod.latin/.LatinIME
  198. '
  199. [debug] [ADB] Getting connected devices...
  200. [debug] [ADB] 1 device(s) connected
  201. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  202. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","shell","ime","
  203. set","com.android.inputmethod.latin/.LatinIME"]
  204. [debug] [ADB] Getting connected devices...
  205. [debug] [ADB] 1 device(s) connected
  206. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  207. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","shell","am","f
  208. orce-stop","com.example.android.contactmanager"]
  209. [debug] [Logcat] Stopping logcat capture
  210. [debug] [ADB] Removing forwarded port socket connection: 8200
  211. [debug] [ADB] Running 'C:\Users\samfu.KAISER\AppData\Local\Android\Sdk\platform-
  212. tools\adb.exe' with args: ["-P",5037,"-s","192.168.198.101:5555","forward","--re
  213. move","tcp:8200"]
  214. [MJSONWP] Encountered internal error running command: TypeError: helpers.install
  215. ApkRemotely is not a function
  216.     at AndroidUiautomator2Driver.initAUT$ (../../lib/driver.js:387:21)
  217.     at tryCatch (C:\Users\samfu.KAISER\AppData\Roaming\npm\node_modules\appium\n
  218. ode_modules\_babel-runtime@5.8.24@babel-runtime\regenerator\runtime.js:67:40)
  219.     at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\samfu.KAISER\App
  220. Data\Roaming\npm\node_modules\appium\node_modules\_babel-runtime@5.8.24@babel-ru
  221. ntime\regenerator\runtime.js:315:22)
  222.     at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\U
  223. sers\samfu.KAISER\AppData\Roaming\npm\node_modules\appium\node_modules\_babel-ru
  224. ntime@5.8.24@babel-runtime\regenerator\runtime.js:100:21)
  225.     at GeneratorFunctionPrototype.invoke (C:\Users\samfu.KAISER\AppData\Roaming\
  226. npm\node_modules\appium\node_modules\_babel-runtime@5.8.24@babel-runtime\regener
  227. ator\runtime.js:136:37)
  228.     at <anonymous>
  229. [HTTP] <-- POST /wd/hub/session 500 7712 ms - 181
复制代码




作者: qqq911    时间: 2019-9-3 10:46
没遇到过
作者: jingzizx    时间: 2019-9-3 12:02
帮顶
作者: litingting0214    时间: 2019-9-3 15:14
没有




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2