openatx / uiautomator2 Goto Github PK
View Code? Open in Web Editor NEWAndroid Uiautomator2 Python Wrapper
License: MIT License
Android Uiautomator2 Python Wrapper
License: MIT License
import uiautomator2 as u2
u2.connect_usb('FSLLLFS')
app_install只返回了包名,没有返回类似 安装J:\apks\jzx\jzx_agent_103652_yyb_ysdk_dalan_177_1.9.2_20180118_16885.apk
pkg: /data/local/tmp/jzx_agent_103652_yyb_ysdk_dalan_177_1.9.2_20180118_16885.apk
Success
假如包有问题,不清楚为什么安装失败。
10-27 17:17:45.125 D/UIAutomatorStub(29836): URI: /jsonrpc/0, Method: POST, params, {NanoHttpd.QUERY_STRING=null}, files: {postData={"params": [{"childOrSiblingSelector": [], "text": "\u5e73\u53f0", "mask": 1, "childOrSibling": []}, 30000], "jsonrpc": "2.0", "id": "2fc32e25165358a0467b6658622d90fd", "method": "waitForExists"}}
10-27 17:17:45.145 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:45.145 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:45.146 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:45.147 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:45.687 I/ThermalEngine( 331): Sensor:batt_temp:334 mC
10-27 17:17:46.051 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:46.053 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:46.054 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:46.055 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:46.213 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:46.215 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:46.215 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:46.216 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:46.669 D/wpa_supplicant( 8787): wlan0: Control interface command 'SIGNAL_POLL'
10-27 17:17:46.686 D/wpa_supplicant( 8787): CTRL-DEBUG: global_ctrl_sock-sendto: sock=11 sndbuf=163840 outq=0 send_len=48
10-27 17:17:46.688 I/ThermalEngine( 331): Sensor:batt_temp:334 mC
10-27 17:17:47.139 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:47.140 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:47.140 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:47.140 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:47.296 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:47.297 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:47.298 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:47.299 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:47.689 I/ThermalEngine( 331): Sensor:batt_temp:334 mC
10-27 17:17:48.219 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:48.219 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:48.220 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:48.220 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:48.379 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:48.380 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:48.380 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:48.381 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:48.691 I/ThermalEngine( 331): Sensor:batt_temp:333 mC
10-27 17:17:49.218 D/UTAnalytics:LogStoreMgr(25456): pid:25456 [store],
10-27 17:17:49.235 D/UTAnalytics:UTSqliteLogStore(25456): pid:25456 sql:SELECT * FROM log ORDER BY time ASC LIMIT 350,
10-27 17:17:49.241 D/UTAnalytics:LogStoreMgr(25456): pid:25456 [get],[],
10-27 17:17:49.246 D/UTAnalytics:UploadEngine(25456): pid:25456 UTDC.bBackground:false,AppInfoUtil.isForeground(UTDC.getContext()) ,true,
10-27 17:17:49.248 D/UTAnalytics:UploadTask(25456): pid:25456 mPeriod:30000,
10-27 17:17:49.286 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:49.286 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:49.287 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:49.287 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:49.468 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:49.469 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:49.470 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:49.470 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:49.692 I/ThermalEngine( 331): Sensor:batt_temp:333 mC
10-27 17:17:49.696 D/wpa_supplicant( 8787): wlan0: Control interface command 'SIGNAL_POLL'
10-27 17:17:49.711 D/wpa_supplicant( 8787): CTRL-DEBUG: global_ctrl_sock-sendto: sock=11 sndbuf=163840 outq=0 send_len=48
10-27 17:17:50.354 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:50.354 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:50.354 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:50.355 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:50.535 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:50.536 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:50.537 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:50.537 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:50.693 I/ThermalEngine( 331): Sensor:batt_temp:333 mC
10-27 17:17:51.448 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:51.448 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:51.449 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:51.449 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:51.604 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:51.604 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:51.605 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:51.605 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:51.694 I/ThermalEngine( 331): Sensor:batt_temp:334 mC
10-27 17:17:52.550 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:52.551 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:52.551 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:52.551 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:52.692 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:52.693 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:52.694 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:52.694 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:52.696 I/ThermalEngine( 331): Sensor:batt_temp:333 mC
10-27 17:17:52.717 D/wpa_supplicant( 8787): wlan0: Control interface command 'SIGNAL_POLL'
10-27 17:17:52.732 D/wpa_supplicant( 8787): CTRL-DEBUG: global_ctrl_sock-sendto: sock=11 sndbuf=163840 outq=0 send_len=48
10-27 17:17:52.742 W/PushService( 2922): 2017-10-27 17:17:52,741 - [WARN::PushService] - [Thread:49] JOB: check the ping-pong.1509095862740
10-27 17:17:53.634 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:53.635 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:53.635 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:53.635 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:53.697 I/ThermalEngine( 331): Sensor:batt_temp:333 mC
10-27 17:17:53.764 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:53.764 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:53.765 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:53.765 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:54.699 I/ThermalEngine( 331): Sensor:batt_temp:333 mC
10-27 17:17:54.711 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:54.712 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:54.712 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:54.713 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:54.843 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:54.844 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:54.845 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:54.845 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:55.010 E/LocSvc_libulp( 1621): I/int ulp_msg_process_system_update(UlpSystemEvent): systemEvent:5
10-27 17:17:55.010 E/LocSvc_libulp( 1621): I/int ulp_msg_process_start_req(), at ulp state = 1
10-27 17:17:55.010 E/LocSvc_api_v02( 1621): I/---> locClientSendReq line 2020 QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02
10-27 17:17:55.014 E/LocSvc_ApiV02( 1621): I/<--- void globalRespCb(locClientHandleType, uint32_t, locClientRespIndUnionType, void*) line 115 QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02
10-27 17:17:55.014 E/LocSvc_libulp( 1621): I/int ulp_brain_process_zpp_position_report(loc_sess_status, LocPosTechMask, UlpLocation*), report ZPP position to providers,report_position = 1
10-27 17:17:55.015 E/IzatSvc_PassiveLocListener( 1621): E/Exiting with error virtual void izat_manager::IzatPassiveLocationListener::onLocationChanged(const izat_manager::IzatLocation*, izat_manager::IzatLocationStatus) line 113 "1"
10-27 17:17:55.285 D/UTAnalytics:CommitTask(25456): pid:25456 check&commit event:65501,
10-27 17:17:55.285 D/UTAnalytics:CommitTask(25456): pid:25456 next:65501,
10-27 17:17:55.285 D/UTAnalytics:CommitTask(25456): pid:25456 check&commit event:65502,
10-27 17:17:55.285 D/UTAnalytics:CommitTask(25456): pid:25456 next:65502,
10-27 17:17:55.285 D/UTAnalytics:CommitTask(25456): pid:25456 check&commit event:65503,
10-27 17:17:55.286 D/UTAnalytics:CommitTask(25456): pid:25456 next:65503,
10-27 17:17:55.700 I/ThermalEngine( 331): Sensor:batt_temp:333 mC
10-27 17:17:55.737 D/wpa_supplicant( 8787): wlan0: Control interface command 'SIGNAL_POLL'
10-27 17:17:55.752 D/wpa_supplicant( 8787): CTRL-DEBUG: global_ctrl_sock-sendto: sock=11 sndbuf=163840 outq=0 send_len=48
10-27 17:17:56.222 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:56.223 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:56.224 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:56.225 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:56.249 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:56.249 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:56.250 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:56.250 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:56.701 I/ThermalEngine( 331): Sensor:batt_temp:333 mC
10-27 17:17:57.310 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:57.312 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:57.313 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:57.313 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:57.331 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:57.331 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:57.332 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:57.332 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:57.703 I/ThermalEngine( 331): Sensor:batt_temp:333 mC
10-27 17:17:58.414 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:58.415 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:58.415 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:58.416 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:58.432 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:58.433 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:58.434 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:58.434 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:58.704 I/ThermalEngine( 331): Sensor:batt_temp:333 mC
10-27 17:17:58.760 D/wpa_supplicant( 8787): wlan0: Control interface command 'SIGNAL_POLL'
10-27 17:17:58.778 D/wpa_supplicant( 8787): CTRL-DEBUG: global_ctrl_sock-sendto: sock=11 sndbuf=163840 outq=0 send_len=48
10-27 17:17:59.519 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:59.520 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:59.521 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:59.521 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:59.552 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:17:59.552 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:17:59.554 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:17:59.554 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:17:59.709 I/ThermalEngine( 331): Sensor:batt_temp:333 mC
10-27 17:18:00.025 I/ProcessStatsService( 1621): Prepared write state in 22ms
10-27 17:18:00.053 I/ProcessStatsService( 1621): Pruning old procstats: /data/system/procstats/state-2017-10-26-10-09-46.bin
10-27 17:18:00.111 W/WtProcessController( 3384): do not trim { PackageName :com.tencent.mm Pid: 25360 Uid: 10131 Start by: activity Score:100 Old score:100 state:0 mBackgroundTimeInMillis:0 WakelockCount:0 wakelogsize:0 ActivityDestroied:false Activity size: 1 PackageInfo:{WhetstonePackageInfo#PacakgeName:com.tencent.mm uid:10131 uiMemoryThresold:0 nonUiMemoryThresold:0 Flag:4160,0x1040 [,TRIMHEAPS,FLAG_DEAL_SCHEDULE] Type:64[,AUTO_START] } tasknum:1439}
10-27 17:18:00.134 W/WtProcessController( 3384): do not trim { PackageName :com.tencent.mm Pid: 25572 Uid: 10131 Start by: service Score:100 Old score:100 state:0 mBackgroundTimeInMillis:0 WakelockCount:0 wakelogsize:0 ActivityDestroied:false Activity size: 0 PackageInfo:{WhetstonePackageInfo#PacakgeName:com.tencent.mm uid:10131 uiMemoryThresold:0 nonUiMemoryThresold:0 Flag:4160,0x1040 [,TRIMHEAPS,FLAG_DEAL_SCHEDULE] Type:64[,AUTO_START] } tasknum:-1}
10-27 17:18:00.136 E/NetlinkEvent( 286): NetlinkEvent::FindParam(): Parameter 'TIME_NS' not found
10-27 17:18:00.136 E/NetlinkEvent( 286): NetlinkEvent::FindParam(): Parameter 'UID' not found
10-27 17:18:00.641 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:18:00.641 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:18:00.642 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:18:00.642 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:18:00.658 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:18:00.659 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:18:00.659 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:18:00.660 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:18:00.710 I/ThermalEngine( 331): Sensor:batt_temp:333 mC
10-27 17:18:01.715 I/ThermalEngine( 331): Sensor:batt_temp:333 mC
10-27 17:18:01.724 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:18:01.725 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:18:01.725 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:18:01.726 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:18:01.746 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:18:01.746 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:18:01.747 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:18:01.747 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:18:01.784 D/wpa_supplicant( 8787): wlan0: Control interface command 'SIGNAL_POLL'
10-27 17:18:01.799 D/wpa_supplicant( 8787): CTRL-DEBUG: global_ctrl_sock-sendto: sock=11 sndbuf=163840 outq=0 send_len=48
10-27 17:18:02.716 I/ThermalEngine( 331): Sensor:batt_temp:332 mC
10-27 17:18:02.832 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:18:02.832 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:18:02.833 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:18:02.833 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:18:02.849 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:18:02.850 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:18:02.850 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:18:02.851 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:18:03.718 I/ThermalEngine( 331): Sensor:batt_temp:333 mC
10-27 17:18:04.250 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:18:04.251 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:18:04.251 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:18:04.252 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:18:04.271 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:18:04.272 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:18:04.273 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:18:04.273 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:18:04.720 I/ThermalEngine( 331): Sensor:batt_temp:332 mC
10-27 17:18:04.808 D/wpa_supplicant( 8787): wlan0: Control interface command 'SIGNAL_POLL'
10-27 17:18:04.825 D/wpa_supplicant( 8787): CTRL-DEBUG: global_ctrl_sock-sendto: sock=11 sndbuf=163840 outq=0 send_len=48
10-27 17:18:05.335 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:18:05.336 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:18:05.336 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:18:05.337 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:18:05.357 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:18:05.357 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:18:05.357 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:18:05.358 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:18:05.721 I/ThermalEngine( 331): Sensor:batt_temp:332 mC
10-27 17:18:06.429 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:18:06.430 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:18:06.430 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:18:06.430 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:18:06.446 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:18:06.447 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:18:06.448 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:18:06.449 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:18:06.723 I/ThermalEngine( 331): Sensor:batt_temp:332 mC
10-27 17:18:07.525 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:18:07.526 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:18:07.528 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:18:07.529 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:18:07.547 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:18:07.547 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:18:07.548 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:18:07.548 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:18:07.724 I/ThermalEngine( 331): Sensor:batt_temp:332 mC
10-27 17:18:07.832 D/wpa_supplicant( 8787): wlan0: Control interface command 'SIGNAL_POLL'
10-27 17:18:07.848 D/wpa_supplicant( 8787): CTRL-DEBUG: global_ctrl_sock-sendto: sock=11 sndbuf=163840 outq=0 send_len=48
10-27 17:18:08.610 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:18:08.611 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:18:08.612 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:18:08.612 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:18:08.632 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:18:08.632 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:18:08.633 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:18:08.633 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:18:08.725 I/ThermalEngine( 331): Sensor:batt_temp:332 mC
10-27 17:18:09.702 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:18:09.702 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:18:09.703 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:18:09.703 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:18:09.721 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:18:09.722 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:18:09.722 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:18:09.723 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:18:09.727 I/ThermalEngine( 331): Sensor:batt_temp:333 mC
10-27 17:18:10.728 I/ThermalEngine( 331): Sensor:batt_temp:332 mC
10-27 17:18:10.807 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:18:10.808 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:18:10.808 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:18:10.809 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:18:10.831 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:18:10.832 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:18:10.833 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:18:10.834 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:18:10.854 D/wpa_supplicant( 8787): wlan0: Control interface command 'SIGNAL_POLL'
10-27 17:18:10.869 D/wpa_supplicant( 8787): CTRL-DEBUG: global_ctrl_sock-sendto: sock=11 sndbuf=163840 outq=0 send_len=48
10-27 17:18:11.729 I/ThermalEngine( 331): Sensor:batt_temp:332 mC
10-27 17:18:12.298 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:18:12.299 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:18:12.300 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:18:12.300 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:18:12.316 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:18:12.316 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:18:12.317 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:18:12.318 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:18:12.393 E/NetlinkEvent( 286): NetlinkEvent::FindParam(): Parameter 'TIME_NS' not found
10-27 17:18:12.393 E/NetlinkEvent( 286): NetlinkEvent::FindParam(): Parameter 'UID' not found
10-27 17:18:12.730 I/ThermalEngine( 331): Sensor:batt_temp:333 mC
10-27 17:18:13.366 I/NetworkDiagnostics_CheckStateManager( 3239): onSignalStrengthChanged: mSignalStrength=5
10-27 17:18:13.370 D/StatusBar.NetworkController( 2816): onSignalStrengthsChanged received on slotId :0signalStrength=SignalStrength: 15 0 -120 -160 -120 -1 -1 99 2147483647 2147483647 2147483647 2147483647 2147483647 gsm|lte level=5 cdmdlevel=0 evdolevel=0
10-27 17:18:13.382 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:18:13.383 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:18:13.383 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:18:13.383 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:18:13.627 D/AndroidRuntime(26685): >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
10-27 17:18:13.636 D/AndroidRuntime(26685): CheckJNI is OFF
10-27 17:18:13.724 D/ICU (26685): No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
10-27 17:18:13.732 I/ThermalEngine( 331): Sensor:batt_temp:332 mC
10-27 17:18:13.815 I/Radio-JNI(26685): register_android_hardware_Radio DONE
10-27 17:18:13.875 D/wpa_supplicant( 8787): wlan0: Control interface command 'SIGNAL_POLL'
10-27 17:18:13.875 D/AndroidRuntime(26685): Calling main entry com.android.commands.monkey.Monkey
10-27 17:18:13.890 D/wpa_supplicant( 8787): CTRL-DEBUG: global_ctrl_sock-sendto: sock=11 sndbuf=163840 outq=0 send_len=48
10-27 17:18:13.945 W/BroadcastQueue( 1621): Skipping deliver [background] BroadcastRecord{8a12e2a u-1 android.net.conn.CONNECTIVITY_CHANGE} to ReceiverList{72da41b 26685 (unknown name)/2000/u-1 remote:e682ccc}: process crashing
10-27 17:18:13.981 I/Timeline(26685): Timeline: Activity_launch_request time:182597765
10-27 17:18:13.991 I/ActivityManager( 1621): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.tencent.mm/.ui.LauncherUI} from uid 2000 on display 0
10-27 17:18:13.996 I/WtEventController( 3384): dispatchSysInfoEvent AM_NEW_INTENT componentName:com.tencent.mm/.ui.LauncherUI
10-27 17:18:14.008 I/SyncSecurityInjector( 1621): filterOutXiaomiAccount: system request, abort.
10-27 17:18:14.012 D/SystemUI.toggleContainer( 2816): updateToggleImage start for 3 status:true last:false isOpen:true
10-27 17:18:14.020 I/SyncSecurityInjector( 1621): filterOutXiaomiAccount: system request, abort.
10-27 17:18:14.023 D/SystemUI.toggleContainer( 2816): skip updateToggleImage for 3 status:false last:true isOpen:false
10-27 17:18:14.047 I/art (26685): System.exit called, status: 0
10-27 17:18:14.047 I/AndroidRuntime(26685): VM exiting with result code 0.
10-27 17:18:14.208 D/SystemUI.toggleContainer( 2816): updateToggleImage for 3 status:false last:true isOpen:true
10-27 17:18:14.394 D/SystemUI.toggleContainer( 2816): updateToggleImage again for 3 status:false last:true isOpen:true
10-27 17:18:14.395 D/SystemUI.toggleContainer( 2816): updateToggleImage start for 3 status:false last:true isOpen:false
10-27 17:18:14.488 W/AD-PLUGIN-AppInstallActivateManager(25315): unRegisterSplashPackageUpdatedListener
10-27 17:18:14.591 D/SystemUI.toggleContainer( 2816): updateToggleImage for 3 status:false last:false isOpen:false
10-27 17:18:14.596 I/XiaomiFirewall( 3239): firewall pkgName:com.tencent.mm, result:0x0
10-27 17:18:14.733 I/ThermalEngine( 331): Sensor:batt_temp:332 mC
10-27 17:18:14.751 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:18:14.751 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:18:14.752 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:18:14.753 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:18:15.734 I/ThermalEngine( 331): Sensor:batt_temp:332 mC
10-27 17:18:15.899 D/StatusBar.NetworkController( 2816): onSignalStrengthsChanged received on slotId :0signalStrength=SignalStrength: 15 0 -120 -160 -120 -1 -1 99 2147483647 2147483647 2147483647 2147483647 2147483647 gsm|lte level=5 cdmdlevel=0 evdolevel=0
10-27 17:18:15.899 I/NetworkDiagnostics_CheckStateManager( 3239): onSignalStrengthChanged: mSignalStrength=5
10-27 17:18:16.309 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:18:16.310 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:18:16.311 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:18:16.312 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:18:16.735 I/ThermalEngine( 331): Sensor:batt_temp:332 mC
10-27 17:18:16.895 D/wpa_supplicant( 8787): wlan0: Control interface command 'SIGNAL_POLL'
10-27 17:18:16.909 D/wpa_supplicant( 8787): CTRL-DEBUG: global_ctrl_sock-sendto: sock=11 sndbuf=163840 outq=0 send_len=48
10-27 17:18:17.212 D/UIAutomatorStub(29836): URI: /jsonrpc/0, Method: POST, params, {NanoHttpd.QUERY_STRING=null}, files: {postData={"params": [{"childOrSiblingSelector": [], "text": "\u786e\u5b9a", "mask": 1, "childOrSibling": []}, 1000], "jsonrpc": "2.0", "id": "1547aec26aac90360e2bc6c33d96e435", "method": "waitForExists"}}
10-27 17:18:17.232 W/ResourceType(25360): No known package when getting name for resource number 0xff000001
10-27 17:18:17.233 W/ResourceType(25360): No known package when getting name for resource number 0xff000002
10-27 17:18:17.233 W/ResourceType(25360): No known package when getting name for resource number 0xff000003
10-27 17:18:17.234 W/ResourceType(25360): No known package when getting name for resource number 0xff000004
10-27 17:18:17.601 D/AndroidRuntime(26719): >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
10-27 17:18:17.611 D/AndroidRuntime(26719): CheckJNI is OFF
10-27 17:18:17.700 D/ICU (26719): No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
10-27 17:18:17.736 I/ThermalEngine( 331): Sensor:batt_temp:333 mC
I see that this supported parent
but not children
yet.
samueldeiMac:jingpin vip$ python -m uiautomator2 init
2018-02-27 21:52:35,393 - main.py:250 - INFO - Device(3207da40) initialing ...
2018-02-27 21:52:35,746 - main.py:106 - DEBUG - install minicap.so
2018-02-27 21:52:35,747 - main.py:108 - INFO - https://github.com/codeskyblue/stf-binaries/raw/master/node_modules/minicap-prebuilt/prebuilt/armeabi-v7a/lib/android-23/minicap.so
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/Library/Python/2.7/site-packages/uiautomator2/main.py", line 310, in
main()
File "/Library/Python/2.7/site-packages/uiautomator2/main.py", line 306, in main
fire.Fire(MyFire)
File "/Library/Python/2.7/site-packages/fire/core.py", line 127, in Fire
component_trace = _Fire(component, args, context, name)
File "/Library/Python/2.7/site-packages/fire/core.py", line 366, in _Fire
component, remaining_args)
File "/Library/Python/2.7/site-packages/fire/core.py", line 542, in _CallCallable
result = fn(*varargs, **kwargs)
File "/Library/Python/2.7/site-packages/uiautomator2/main.py", line 253, in init
ins.install_minicap()
File "/Library/Python/2.7/site-packages/uiautomator2/main.py", line 109, in install_minicap
path = cache_download(url)
File "/Library/Python/2.7/site-packages/uiautomator2/main.py", line 70, in cache_download
r = requests.get(url, stream=True)
File "/Library/Python/2.7/site-packages/requests/api.py", line 72, in get
return request('get', url, params=params, **kwargs)
File "/Library/Python/2.7/site-packages/requests/api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "/Library/Python/2.7/site-packages/requests/sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "/Library/Python/2.7/site-packages/requests/sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "/Library/Python/2.7/site-packages/requests/adapters.py", line 506, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='github.com', port=443): Max retries exceeded with url: /codeskyblue/stf-binaries/raw/master/node_modules/minicap-prebuilt/prebuilt/armeabi-v7a/lib/android-23/minicap.so (Caused by SSLError(SSLError(1, u'[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)'),))
requests.exceptions.ConnectionError: HTTPConnectionPool(host='192.168.20.73', port=7912): Max retries exceeded with url: /ping (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd29b33ce50>: Failed to establish a new connection: [Errno 111] Connection refused',))
检查手机ip及应用,都有开启。为何连不上呢?
可以launch app,执行d.healthcheck() 出错
raise RuntimeError("Uiautomator started failed.")
RuntimeError: Uiautomator started failed.
其他click调用也都是出现这样错误
return self.server.jsonrpc_call(self.method, params, http_timeout)
File "c:\users\pt001\uiautomator2\uiautomator2_init_.py", line 255, in jsonrpc_call
raise UiaError(self._server_jsonrpc_url, data, res.status_code, res.text, "HTTP Return code is not 200", res.text)
uiautomator2.UiaError: ('http://192.168.8.196:7912/jsonrpc/0', b'{"jsonrpc": "2.0", "id": "edc204b38751966bd204eb69b067bd6f", "method": "deviceInfo", "params": {}}', 502, '', 'HTTP Return code is not 200', '')
原因分析.
d.info
中会调用UiDevice.getDisplayRotation()
之后,该函数的实现如下
public int getDisplayRotation() {
Tracer.trace();
waitForIdle();
return getAutomatorBridge().getRotation();
}
waitForIdle为等待当前UI稳定的意思。默认等待时间10s。(实际测试每次都会超时)
另外这里uiautomator2也有bug,参考链接 https://www.ydkf.me/archives/22
将上方的黄色提示框关掉之后。使用IP连接设备,d.info
调用速度恢复正常。
怀疑是上方的提示框影响了waitForIdle函数
测试完成后需要卸载app,我找不到卸载方法。
just like set_context
/usr/local/lib/python2.7/dist-packages/uiautomator2/__init__.py:331: RuntimeWarning: uiautomator2 is down, restart.
warnings.warn("uiautomator2 is down, restart.", RuntimeWarning, stacklevel=1)
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-4-a5c55faeb6c2> in <module>()
----> 1 print (d.info)
/usr/local/lib/python2.7/dist-packages/uiautomator2/__init__.pyc in __getattr__(self, attr)
823
824 def __getattr__(self, attr):
--> 825 return getattr(self._default_session, attr)
826
827 def __call__(self, **kwargs):
/usr/local/lib/python2.7/dist-packages/uiautomator2/__init__.pyc in info(self)
1204 @property
1205 def info(self):
-> 1206 return self.jsonrpc.deviceInfo()
1207
1208 def __call__(self, **kwargs):
/usr/local/lib/python2.7/dist-packages/uiautomator2/__init__.pyc in __call__(self, *args, **kwargs)
320 http_timeout = kwargs.pop('http_timeout', HTTP_TIMEOUT)
321 params = args if args else kwargs
--> 322 return self.server.jsonrpc_retry_call(jsonrpc_url, self.method, params, http_timeout)
323
324 return JSONRpcWrapper(self)
/usr/local/lib/python2.7/dist-packages/uiautomator2/__init__.pyc in jsonrpc_retry_call(self, *args, **kwargs)
331 warnings.warn("uiautomator2 is down, restart.", RuntimeWarning, stacklevel=1)
332 # for XiaoMi, want to recover uiautomator2 must start app:com.github.uiautomator
--> 333 self.healthcheck(unlock=False)
334 return self.jsonrpc_call(*args, **kwargs)
335
/usr/local/lib/python2.7/dist-packages/uiautomator2/__init__.pyc in healthcheck(self, unlock)
458 return True
459 time.sleep(.5)
--> 460 raise RuntimeError("Uiautomator started failed.")
461
462 def app_install(self, url, installing_callback=None):
RuntimeError: Uiautomator started failed.
ip,
usb连接不了。
把python uiautomator測試腳本改成� 2.0
原先為安卓6.0,如以下語法這樣原先1.0大概1~2秒定位
d(text="下一頁").click()
但安卓升級成7.0後
uiautomator也換成2.0定位時間居然會到5~6秒甚至更久,請問是什麼問題呢?
2018-02-27 17:23:27,394 - main.py:243 - INFO - Device(EUSSNRQK8DLJCMFA) init
ialing ...
Traceback (most recent call last):
File "C:\Users\zybang\AppData\Local\Programs\Python\Python36\lib\runpy.py", li
ne 193, in run_module_as_main
"main", mod_spec)
File "C:\Users\zybang\AppData\Local\Programs\Python\Python36\lib\runpy.py", li
ne 85, in run_code
exec(code, run_globals)
File "C:\Users\zybang\AppData\Local\Programs\Python\Python36\lib\site-packages
\uiautomator2_main.py", line 305, in
main()
File "C:\Users\zybang\AppData\Local\Programs\Python\Python36\lib\site-packages
\uiautomator2_main.py", line 301, in main
fire.Fire(MyFire)
File "C:\Users\zybang\AppData\Local\Programs\Python\Python36\lib\site-packages
\fire\core.py", line 127, in Fire
component_trace = Fire(component, args, context, name)
File "C:\Users\zybang\AppData\Local\Programs\Python\Python36\lib\site-packages
\fire\core.py", line 366, in Fire
component, remaining_args)
File "C:\Users\zybang\AppData\Local\Programs\Python\Python36\lib\site-packages
\fire\core.py", line 542, in CallCallable
result = fn(*varargs, **kwargs)
File "C:\Users\zybang\AppData\Local\Programs\Python\Python36\lib\site-packages
\uiautomator2_main.py", line 246, in init
ins.install_minicap()
File "C:\Users\zybang\AppData\Local\Programs\Python\Python36\lib\site-packages
\uiautomator2_main.py", line 108, in install_minicap
path = cache_download(url)
File "C:\Users\zybang\AppData\Local\Programs\Python\Python36\lib\site-packages
\uiautomator2_main.py", line 73, in cache_download
raise Exception("status code", r.status_code)
Exception: ('status code', 404)
来源与testerhome上的回复
https://testerhome.com/topics/11546
目前想法:可以断开之后,直接再自动解锁屏幕,强制恢复wlan。
import uiautomator2 as u2
d = u2.connect('192.168.21.160')
我看代码返回的d是一个object,但是我不知道连接成功还是失败
监视器写好了,没反应。。
是不是要加上d.watchers.run(),还是说写好监视器,他就会直接运行,
我连上两台手机,执行init之后,返回的一个是本机ip,一个是127.0.0.1,本机ip可以连上用,但是127.0.0.1不能再python中使用。。
首先通过getprop获取到设备的manufacturer
ro.product.manufacturer]: [Genymotion]
[ro.product.model]: [Google Nexus 6 - 7.0.0 - API 24 - 1440x2560]
[ro.product.model.geny-def]: [Genymotion 'Phone' version]
[ro.product.name]: [vbox86p]
[ro.product.name.geny-def]: [vbox86p]
如果是genymotion,输入改成
if manufacturer == 'Genymotion' and self(focused=True, className="android.widget.EditText").exists:
self(focused=True, className="android.widget.EditText").send_keys(text)
链接上了设备但是运行print (d.press('home')
的时候报错
Traceback (most recent call last):
File "C:\Users\Glority\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen
chunked=chunked)
File "C:\Users\Glority\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 387, in _make_request
six.raise_from(e, None)
File "<string>", line 2, in raise_from
File "C:\Users\Glority\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 383, in _make_request
httplib_response = conn.getresponse()
File "C:\Users\Glority\Anaconda3\lib\http\client.py", line 1331, in getresponse
response.begin()
File "C:\Users\Glority\Anaconda3\lib\http\client.py", line 297, in begin
version, status, reason = self._read_status()
File "C:\Users\Glority\Anaconda3\lib\http\client.py", line 258, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "C:\Users\Glority\Anaconda3\lib\socket.py", line 586, in readinto
return self._sock.recv_into(b)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Glority\Anaconda3\lib\site-packages\requests\adapters.py", line 440, in send
timeout=timeout
File "C:\Users\Glority\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 639, in urlopen
_stacktrace=sys.exc_info()[2])
File "C:\Users\Glority\Anaconda3\lib\site-packages\urllib3\util\retry.py", line 357, in increment
raise six.reraise(type(error), error, _stacktrace)
File "C:\Users\Glority\Anaconda3\lib\site-packages\urllib3\packages\six.py", line 685, in reraise
raise value.with_traceback(tb)
File "C:\Users\Glority\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen
chunked=chunked)
File "C:\Users\Glority\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 387, in _make_request
six.raise_from(e, None)
File "<string>", line 2, in raise_from
File "C:\Users\Glority\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 383, in _make_request
httplib_response = conn.getresponse()
File "C:\Users\Glority\Anaconda3\lib\http\client.py", line 1331, in getresponse
response.begin()
File "C:\Users\Glority\Anaconda3\lib\http\client.py", line 297, in begin
version, status, reason = self._read_status()
File "C:\Users\Glority\Anaconda3\lib\http\client.py", line 258, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "C:\Users\Glority\Anaconda3\lib\socket.py", line 586, in readinto
return self._sock.recv_into(b)
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Glority\Anaconda3\lib\site-packages\uiautomator2\__init__.py", line 791, in press
return self.jsonrpc.pressKey(key)
File "C:\Users\Glority\Anaconda3\lib\site-packages\uiautomator2\__init__.py", line 211, in __call__
return self.server.jsonrpc_call(self.method, params, http_timeout)
File "C:\Users\Glority\Anaconda3\lib\site-packages\uiautomator2\__init__.py", line 230, in jsonrpc_call
data=data)
File "C:\Users\Glority\Anaconda3\lib\site-packages\requests\sessions.py", line 555, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "C:\Users\Glority\Anaconda3\lib\site-packages\uiautomator2\__init__.py", line 154, in request
resp = super(TimeoutRequestsSession, self).request(method, url, **kwargs)
File "C:\Users\Glority\Anaconda3\lib\site-packages\requests\sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\Glority\Anaconda3\lib\site-packages\requests\sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "C:\Users\Glority\Anaconda3\lib\site-packages\requests\adapters.py", line 490, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))
但是我这边并没有链接啊,我应该强制关掉哪个链接=。=
目前还有那些不足, 我测试一下, 速度很快。 想知道还有那些不足.
感谢强大, 项目维护者.
print(d.info)
File "/usr/local/lib/python2.7/site-packages/uiautomator2/init.py", line 376, in getattr
return getattr(self._default_session, attr)
File "/usr/local/lib/python2.7/site-packages/uiautomator2/init.py", line 620, in info
return self.jsonrpc.deviceInfo()
File "/usr/local/lib/python2.7/site-packages/uiautomator2/init.py", line 154, in call
return self.server.jsonrpc_call(self.method, params)
File "/usr/local/lib/python2.7/site-packages/uiautomator2/init.py", line 173, in jsonrpc_call
data=data)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 535, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/adapters.py", line 487, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='cb5125l786', port=7912): Max retries exceeded with url: /jsonrpc/0 (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x10f35e690>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',))
sess(text=u"哈哈哈 哎呦呦").long_click()
sess(text=u"删除回复").click()
本来长按一个回复内容,弹出框,想点击“删除回复”。
但是实际效果:弹出框也弹了,但是又有一个点击操作,点击了回复内容,
使得页面跳到另外一个页面了。
sess(text=u"删除回复").click()就点击不到了。
访问外网时需要代理,目前是手动修改了__main__.py的代码。
Hi ,
I download this uiautomator2-master.zip and install it in windows7, but I meet an error by using "pip install -e .":
Complete output from command python setup.py egg_info:
ERROR:root:Error parsing
Traceback (most recent call last):
File "d:\uiautomator\uiautomator2.eggs\pbr-3.1.1-py2.7.egg\pbr\core.py", line 111, in pbr
attrs = util.cfg_to_args(path, dist.script_args)
File "d:\uiautomator\uiautomator2.eggs\pbr-3.1.1-py2.7.egg\pbr\util.py", line 249, in cfg_to_args
pbr.hooks.setup_hook(config)
File "d:\uiautomator\uiautomator2.eggs\pbr-3.1.1-py2.7.egg\pbr\hooks_init_.py", line 25, in setup_hook
metadata_config.run()
File "d:\uiautomator\uiautomator2.eggs\pbr-3.1.1-py2.7.egg\pbr\hooks\base.py", line 27, in run
self.hook()
File "d:\uiautomator\uiautomator2.eggs\pbr-3.1.1-py2.7.egg\pbr\hooks\metadata.py", line 26, in hook
self.config['name'], self.config.get('version', None))
File "d:\uiautomator\uiautomator2.eggs\pbr-3.1.1-py2.7.egg\pbr\packaging.py", line 755, in get_version
name=package_name))
Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's a
e that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project
mator2 was given, but was not able to be found.
error in setup command: Error parsing D:\Uiautomator\uiautomator2\setup.cfg: Exception: Versioning for this project requ
an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package
up.cfg and the argument given to pbr.version.VersionInfo. Project name uiautomator2 was given, but was not able to be found.
How I can resolve it ? thanks~
1.pip install --pre uiautomator2已执行成功
2.连接设备谷歌nexus Android 8.1
3.日志如下:
D:\uiautomator2>python -m uiautomator2 init
2018-01-08 17:05:28,703 - main.py:236 - INFO - Device(84B5T15A10013698) initialing ...
D:\python\lib\site-packages\urllib3\util\ssl_.py:339: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
SNIMissingWarning
D:\python\lib\site-packages\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecurePlatformWarning
D:\python\lib\site-packages\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecurePlatformWarning
�[Kminicap.so |################################| 23.0 KiB / 23.0 KiB
�[?25h2018-01-08 17:05:31,944 - main.py:115 - INFO - install minicap
D:\python\lib\site-packages\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecurePlatformWarning
D:\python\lib\site-packages\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecurePlatformWarning
�[Kminicap |################################| 566.5 KiB / 566.5 KiB
�[?25h2018-01-08 17:05:54,605 - main.py:122 - INFO - install minitouch
D:\python\lib\site-packages\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecurePlatformWarning
D:\python\lib\site-packages\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecurePlatformWarning
�[Kminitouch |################################| 33.8 KiB / 33.8 KiB
�[?25h2018-01-08 17:06:03,450 - main.py:143 - INFO - app-uiautomator.apk(1.0.6) installing ...
D:\python\lib\site-packages\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecurePlatformWarning
D:\python\lib\site-packages\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecurePlatformWarning
�[Kapp-uiautomator.apk | | 16.0 KiB / 1.6 MiB�[Kapp-uiautomator.apk | | 32.0 KiB / 1.6 MiB�[Kapp-uiautomator.apk | | 48.0 KiB / 1.6 MiB�[Kapp-uiautomator.apk |# | 64.0 KiB / 1.6 MiB�[Kapp-uiautomator.apk |# | 80.0 KiB / 1.6 MiB�[Kapp-uiautomator.apk |# | 96.0 KiB / 1.6 MiB�[Kapp-uiautomator.apk |## | 112.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |## | 128.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |## | 144.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |### | 160.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |### | 176.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |### | 192.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |### | 208.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |#### | 224.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |#### | 240.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |#### | 256.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |##### | 272.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |##### | 288.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |##### | 304.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |###### | 320.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |###### | 336.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |###### | 352.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |####### | 368.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |####### | 384.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |####### | 400.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |####### �[Kapp-uiautomator.apk |#####�[Kapp-uiautomator.apk |########## | 576.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |########### | 592.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |########### | 608.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |########### | 624.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |############ | 640.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |############ | 656.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |############ | 672.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |############# | 688.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |############# | 704.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |############# | 720.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |############## | 736.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |############## | 752.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |############## | 768.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |############## | 784.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |############### | 800.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |############### | 816.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |############### | 832.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |################ | 848.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |################ | 864.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |################ | 880.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |################# | 896.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |################# | 912.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |################# | 928.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |################## | 944.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |################## | 960.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |################## | 976.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |################## | 992.0 KiB / 1.6 Mi�[Kapp-uiautomator.apk |################### | 1008.0 KiB / 1.6 M�[Kapp-uiautomator.apk |############################## | 1.6 MiB / 1.6 MiB
操作:
d(text=u"数码家电").click()
错误信息:
Traceback (most recent call last):
File "C:\Python\Python35\lib\site-packages\weditor_main_.py", line 297, in post
ret = eval(code, {'d': d})
File "", line 1, in
File "C:\Python\Python35\lib\site-packages\uiautomator2_init_.py", line 1194, in inner
return fn(self, *args, **kwargs)
File "C:\Python\Python35\lib\site-packages\uiautomator2_init_.py", line 1237, in click
self.session.click(x, y)
File "C:\Python\Python35\lib\site-packages\uiautomator2_init_.py", line 972, in click
ret = self.jsonrpc.click(x, y)
File "C:\Python\Python35\lib\site-packages\uiautomator2_init_.py", line 322, in call
return self.server.jsonrpc_retry_call(jsonrpc_url, self.method, params, http_timeout)
File "C:\Python\Python35\lib\site-packages\uiautomator2_init_.py", line 329, in jsonrpc_retry_call
return self.jsonrpc_call(*args, **kwargs)
File "C:\Python\Python35\lib\site-packages\uiautomator2_init_.py", line 373, in jsonrpc_call
raise err
uiautomator2.JsonRpcError: -32001 Server error: java.lang.SecurityException
[Finished in 1.085s]
image = d.screenshot()
image.save("home.jpg")
我在pycharm 下创建一个项目。运行这两句的话,图片会存在根目录下面。
我新建一个pic文件夹。想把截图放在里面。
image.save("pic\home.jpg")
发现这样是不行...
测试需要,我需要logcat日志
目前範例只有:
import uiautomator2 as u2
但此方式只能連接一台
是否有連接多台裝置的範例Code,感謝
Traceback (most recent call last):
File "D:/Django/project/OneKeyTest/Backend/UIAutomator/OpenSDKUIAuto.py", line 128, in <module>
print d.info
File "D:\Django\python\lib\site-packages\uiautomator2\__init__.py", line 523, in __getattr__
return getattr(self._default_session, attr)
File "D:\Django\python\lib\site-packages\uiautomator2\__init__.py", line 809, in info
return self.jsonrpc.deviceInfo()
File "D:\Django\python\lib\site-packages\uiautomator2\__init__.py", line 192, in __call__
return self.server.jsonrpc_call(self.method, params)
File "D:\Django\python\lib\site-packages\uiautomator2\__init__.py", line 216, in jsonrpc_call
raise UiaError(self._server_jsonrpc_url, data, res.status_code, res.text, "HTTP Return code is not 200", res.text)
uiautomator2.UiaError: ('http://127.0.0.1:60334/jsonrpc/0', '{"params": {}, "jsonrpc": "2.0", "id": "c55179c4c0cb2c166427bb3d61963236", "method": "deviceInfo"}', 504.
手机型号为MI 6,MIUI 9.2系统,Android版本7.1.1,报错信息如下:
>>> import uiautomator2 as ui2
>>> d = ui2.connect('192.168.0.104')
>>> d.info
/home/smartguo/lib/anaconda3/lib/python3.6/site-packages/uiautomator2/__init__.py:325: RuntimeWarning: uiautomator2 is down, restart.
warnings.warn("uiautomator2 is down, restart.", RuntimeWarning, stacklevel=1)
Traceback (most recent call last):
File "/home/smartguo/lib/anaconda3/lib/python3.6/site-packages/uiautomator2/__init__.py", line 323, in jsonrpc_retry_call
return self.jsonrpc_call(*args, **kwargs)
File "/home/.../anaconda3/lib/python3.6/site-packages/uiautomator2/__init__.py", line 351, in jsonrpc_call
raise GatewayError(res, "gateway error, time used %.1fs" % (time.time() - request_start))
uiautomator2.GatewayError: uiautomator2.GatewayError(gateway error, time used 0.1s)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/.../anaconda3/lib/python3.6/site-packages/uiautomator2/__init__.py", line 771, in __getattr__
return getattr(self._default_session, attr)
File "/home/..../anaconda3/lib/python3.6/site-packages/uiautomator2/__init__.py", line 1152, in info
return self.jsonrpc.deviceInfo()
File "/home/.../anaconda3/lib/python3.6/site-packages/uiautomator2/__init__.py", line 316, in __call__
return self.server.jsonrpc_retry_call(jsonrpc_url, self.method, params, http_timeout)
File "/home/smartguo/lib/anaconda3/lib/python3.6/site-packages/uiautomator2/__init__.py", line 327, in jsonrpc_retry_call
self.healthcheck(unlock=False)
File "/home/.../anaconda3/lib/python3.6/site-packages/uiautomator2/__init__.py", line 430, in healthcheck
raise RuntimeError("Uiautomator started failed.")
RuntimeError: Uiautomator started failed.
test.apk may failed to install. For example in Xiaomi
$ python -m uiautomator2 init
2018-01-22 17:03:44,749 - main.py:241 - INFO - Device(ZX1G22KJB2) initialing ...
2018-01-22 17:03:45,654 - main.py:120 - INFO - install minicap
2018-01-22 17:03:46,246 - main.py:127 - INFO - install minitouch
2018-01-22 17:03:49,286 - main.py:148 - INFO - app-uiautomator.apk(1.0.9) installing ...
Traceback (most recent call last):
File "D:\Python27\lib\runpy.py", line 174, in run_module_as_main
"main", fname, loader, pkg_name)
File "D:\Python27\lib\runpy.py", line 72, in run_code
exec code in run_globals
File "D:\Python27\lib\site-packages\uiautomator2_main.py", line 290, in
main()
File "D:\Python27\lib\site-packages\uiautomator2_main.py", line 286, in main
fire.Fire(MyFire)
File "C:\Users\uc\AppData\Roaming\Python\Python27\site-packages\fire\core.py", line 127, in Fire
component_trace = Fire(component, args, context, name)
File "C:\Users\uc\AppData\Roaming\Python\Python27\site-packages\fire\core.py", line 366, in Fire
component, remaining_args)
File "C:\Users\uc\AppData\Roaming\Python\Python27\site-packages\fire\core.py", line 542, in CallCallable
result = fn(*varargs, **kwargs)
File "D:\Python27\lib\site-packages\uiautomator2_main.py", line 246, in init
ins.install_uiautomator_apk(apk_version, reinstall)
File "D:\Python27\lib\site-packages\uiautomator2_main.py", line 149, in install_uiautomator_apk
path = cache_download(app_url)
File "D:\Python27\lib\site-packages\uiautomator2_main.py", line 80, in cache_download
r = requests.get(url, stream=True)
File "D:\Python27\lib\site-packages\requests\api.py", line 72, in get
return request('get', url, params=params, **kwargs)
File "D:\Python27\lib\site-packages\requests\api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "D:\Python27\lib\site-packages\requests\sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "D:\Python27\lib\site-packages\requests\sessions.py", line 640, in send
history = [resp for resp in gen] if allow_redirects else []
File "D:\Python27\lib\site-packages\requests\sessions.py", line 218, in resolve_redirects
**adapter_kwargs
File "D:\Python27\lib\site-packages\requests\sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "D:\Python27\lib\site-packages\requests\adapters.py", line 508, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='github-production-release-asset-2e65be.s3.amazonaws.com', port=443): Max retries exceeded with url: /53296967/afe654de-fbc9-11e7-87ef-84b9b7c1d21d?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20180122%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20180122T090355Z&X-Amz-Expires=300&X-Amz-Signature=c6f4bfa9dab0a92044c9c03f55e6cb32a4bfa050dc8951052c17796bf1360a3f&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dapp-uiautomator.apk&response-content-type=application%2Fvnd.android.package-archive (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x034021F0>: Failed to establish a new connection: [Errno 10060] ',))
http://192.168.168.116:7912/version
可以回显0.0.6版本
不能打印d.info
d.press('back')
File "/home/jet/wtm/uiautomator2/uiautomator2/init.py", line 485, in press
return self.jsonrpc.pressKey(key)
File "/home/jet/wtm/uiautomator2/uiautomator2/init.py", line 151, in call
return self.server.jsonrpc_call(self.method, params)
File "/home/jet/wtm/uiautomator2/uiautomator2/init.py", line 175, in jsonrpc_call
raise UiaError(self._server_jsonrpc_url, data, res.status_code, res.text, "HTTP Return code is not 200", res.text)
uiautomator2.UiaError: ('http://192.168.168.116:7912/jsonrpc/0', '{"params": ["back"], "jsonrpc": "2.0", "id": "3c437a0a91cb550457002078bf9a6eed", "method": "pressKey"}', 502, u'', 'HTTP Return code is not 200', u'')
华为mate9
uiautomator2.UiaError: ('http://192.168.168.111:7912/jsonrpc/0', '{"params": {}, "jsonrpc": "2.0", "id": "0cb0b4a2b27f2377e139075a549b60bf", "method": "deviceInfo"}', 502, u'', 'HTTP Return code is not 200')
对于这个异常是否有超时设置?
是否有重启ATX-Agent的函数?
锤子M1。运行游戏的时候uiautomator apk被杀
相关logcat日志
12-04 18:31:26.158 1371 1404 D UidCpuTracker: mCleanBadBgApp add and mSuspectedUids.remove: 10287
12-04 18:31:26.209 1371 1405 I ActivityManager: Killing 1151:com.github.uiautomator/u0a287 (adj 0): busy background ap
p
12-04 18:31:26.210 1371 1405 I Process : killProcessQuiet pid=1151
12-04 18:31:26.210 1371 1405 I Process : java.lang.RuntimeException
12-04 18:31:26.210 1371 1405 I Process : at android.os.Process.killProcessQuiet(Process.java:1161)
12-04 18:31:26.210 1371 1405 I Process : at com.android.server.am.ProcessRecord.kill(ProcessRecord.java:592)
12-04 18:31:26.210 1371 1405 I Process : at com.android.server.am.ActivityManagerService.removeProcessLocked(Acti
vityManagerService.java:7002)
12-04 18:31:26.210 1371 1405 I Process : at com.android.server.am.UidCpuTrackerRunner$3.run(UidCpuRunner.java:933
)
12-04 18:31:26.210 1371 1405 I Process : at android.os.Handler.handleCallback(Handler.java:739)
12-04 18:31:26.210 1371 1405 I Process : at android.os.Handler.dispatchMessage(Handler.java:95)
12-04 18:31:26.210 1371 1405 I Process : at android.os.Looper.loop(Looper.java:148)
12-04 18:31:26.210 1371 1405 I Process : at android.os.HandlerThread.run(HandlerThread.java:61)
12-04 18:31:26.210 1371 1405 I Process : at com.android.server.ServiceThread.run(ServiceThread.java:46)
12-04 18:31:26.227 1371 2255 W WindowManager: Attempted to remove non-existing token: android.os.Binder@c83af2b
12-04 18:31:26.228 1371 2255 W AccessibilityManagerService: Skipping accessibilty service com.cootek.smartinputv5.smar
tisan/com.cootek.smartinput5.TouchPalAccessibilityService: it does not require the permission android.permission.BIND_AC
CESSIBILITY_SERVICE
12-04 18:31:26.231 1371 1405 D ActivityManager: cleanUpApplicationRecord -- 1151
12-04 18:31:26.232 1371 1405 W ActivityManager: Crash of app com.github.uiautomator running instrumentation ComponentI
nfo{com.github.uiautomator.test/android.support.test.runner.AndroidJUnitRunner}
12-04 18:31:26.236 1371 1405 I ActivityManager: appId 10287 get for package com.github.uiautomator
12-04 18:31:26.237 1371 1405 I ActivityManager: Force stopping com.github.uiautomator appid=10287 user=0: finished ins
t
12-04 18:31:26.238 1371 1405 I UidCpuTracker: remove busy background app=ProcessRecord{9b2df88 0:com.github.uiautomato
r/u0a287}
12-04 18:31:26.239 1371 2938 W ActivityManager: Spurious death for ProcessRecord{9b2df88 0:com.github.uiautomator/u0a2
87}, curProc for 1151: null
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.