也是用的 ORICO,尝试了 2 级级联 (1 个 Hub 上再连一个 Hub),稳定性可以接受。
@isotopeX 可以试试通过 node 启动 appium 进程,可以设置内存大小
node --max_old_space_size=2047 /appium安装路径/main.js -p portNum
appium 进程的内存使用达到多少了?
@lucasluo 感谢分享,请问安装过程中的系统弹框有什么好的处理机制不?
多谢多谢。
感谢楼主分享,请教一下 uiautomator2 的 python 库是怎么安装的?
这里说的是闪退,不是 ANR,所以不应该去找 traces 文件;
日志通过 logcat + grep 获取,如果需要更精准的,查看 PID 的变化,定位更精确的闪退位置。
另外一种做法,可能比较慢,HostA 通过 ssh 连接 B 和 C(ssh 配置 token,免登陆)
ssh -q username@HostBIP "/home/test/android-sdk-linux/platform-tools/adb -s udid install TEST.apk"
@seveniruby 感谢你的工具!请教个问题,当某个界面上,uiautomator 获取 dump 文件遇到问题时,appium 会遇到 500 error,此时 appcrawler 会出 exception。
想问一下此时如果想直接 fail 该动作,然后自动 back,再继续,如果要达到这样的效果,我需要怎么配置?
appium exception log:
debug] [MJSONWP] Responding to client with driver.getWindowSize() result: {"width":480,"height":854}
[HTTP] <-- GET /wd/hub/session/a66cad36-4901-4154-adba-cf2499cc194d/window/current/size 200 13 ms - 98
[HTTP] --> GET /wd/hub/session/a66cad36-4901-4154-adba-cf2499cc194d/source {}
[debug] [MJSONWP] Calling AppiumDriver.getPageSource() with args: ["a66cad36-4901-4154-adba-cf2499cc194d"]
[debug] [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"source","params":{}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"source","params":{}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: source
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Command returned error:java.lang.RuntimeException: Failed to Dump Window Hierarchy
[debug] [AndroidBootstrap] Received command result from bootstrap
[HTTP] <-- GET /wd/hub/session/a66cad36-4901-4154-adba-cf2499cc194d/source 500 204 ms - 154
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"value":"Failed to Dump Window Hierarchy","status":13}
appcrawler exception log:
2017-09-20 14:26:03 ERROR [AppiumClient.asyncTask.150] exception
2017-09-20 14:26:03 ERROR [AppiumClient.asyncTask.151] org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 91 milliseconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'sh-jikun.zenmen.corp', ip: '10.241.53.72', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_131'
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities [{appPackage=com.halo.wifikey.wifilocating, reuse=3, noReset=true, dontStopAppOnReset=true, deviceName=8b26684b, platform=LINUX, deviceUDID=8b26684b, androidInstallTimeout=180000, desired={app=, appPackage=com.halo.wifikey.wifilocating, reuse=3, appium=http://10.241.19.57:4821/wd/hub, noReset=true, dontStopAppOnReset=true, deviceName=10.241.19.57:4821, launchTimeout=120000, appActivity=com.lantern.launcher.ui.MainActivity, androidInstallTimeout=180000, newCommandTimeout=120, autoLaunch=true, platformVersion=, automationName=Appium, autoWebview=false, platformName=Android, udid=8b26684b}, newCommandTimeout=120, platformVersion=4.4.4, webStorageEnabled=false, automationName=Appium, takesScreenshot=true, javascriptEnabled=true, autoWebview=false, platformName=Android, udid=8b26684b, deviceManufacturer=OPPO, app=, deviceScreenSize=480x854, networkConnectionEnabled=true, appium=http://10.241.19.57:4821/wd/hub, warnings={}, databaseEnabled=false, launchTimeout=120000, appActivity=com.lantern.launcher.ui.MainActivity, autoLaunch=true, locationContextEnabled=false, deviceModel=A31c}]
Session ID: a66cad36-4901-4154-adba-cf2499cc194d
2017-09-20 14:26:03 ERROR [AppiumClient.asyncTask.152] java.util.concurrent.FutureTask.report(FutureTask.java:122)
java.util.concurrent.FutureTask.get(FutureTask.java:206)
com.testerhome.appcrawler.driver.WebDriver$$anonfun$2.apply(WebDriver.scala:135)
scala.util.Try$.apply(Try.scala:192)
com.testerhome.appcrawler.driver.WebDriver$class.asyncTask(WebDriver.scala:126)
com.testerhome.appcrawler.driver.AppiumClient.asyncTask(AppiumClient.scala:24)
com.testerhome.appcrawler.driver.AppiumClient$$anonfun$getPageSource$1.apply$mcVI$sp(AppiumClient.scala:302)
scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:166)
com.testerhome.appcrawler.driver.AppiumClient.getPageSource(AppiumClient.scala:301)
com.testerhome.appcrawler.Crawler.refreshPage(Crawler.scala:538)
com.testerhome.appcrawler.Crawler.start(Crawler.scala:140)
com.testerhome.appcrawler.AppCrawler$.startCrawl(AppCrawler.scala:342)
com.testerhome.appcrawler.AppCrawler$.parseParams(AppCrawler.scala:310)
com.testerhome.appcrawler.AppCrawler$.main(AppCrawler.scala:90)
com.testerhome.appcrawler.AppCrawler.main(AppCrawler.scala)
Exception in thread "main" java.lang.NullPointerException
at scala.collection.immutable.StringOps$.length$extension(StringOps.scala:48)
at scala.collection.immutable.StringOps.length(StringOps.scala:48)
at scala.collection.IndexedSeqOptimized$class.isEmpty(IndexedSeqOptimized.scala:27)
at scala.collection.immutable.StringOps.isEmpty(StringOps.scala:30)
at scala.collection.TraversableOnce$class.nonEmpty(TraversableOnce.scala:109)
at scala.collection.immutable.StringOps.nonEmpty(StringOps.scala:30)
at com.testerhome.appcrawler.Crawler.refreshPage(Crawler.scala:541)
at com.testerhome.appcrawler.Crawler.start(Crawler.scala:140)
at com.testerhome.appcrawler.AppCrawler$.startCrawl(AppCrawler.scala:342)
at com.testerhome.appcrawler.AppCrawler$.parseParams(AppCrawler.scala:310)
at com.testerhome.appcrawler.AppCrawler$.main(AppCrawler.scala:90)
at com.testerhome.appcrawler.AppCrawler.main(AppCrawler.scala)
手动使用 uiautomatorview 获取问题页面遇到如下异常,其它页面正常
Error while parsing UI hierarchy XML file: Invalid ui automator hierarchy file.
请教一下,cmd.find('install') 这个是用到哪个第三方工具么?