[Python]Uiautomator2以及一些简单命令

[Python]Uiautomator2以及一些简单命令

2023年7月13日发(作者:)

[Python]Uiautomator2以及⼀些简单命令# python-U1import uiautomator——from uiautomator import ——d=Device(“SN”)——# python-U2import uiautomatro2 as u2——d = t("IP/SN")——# 打开uiautomator2—weditorpython –m uiautomator2 init / python –m weditor# 打开weditor若出现 error : python –m weditor 删掉,重新进⾏命令输⼊# 连接电脑查看⼿机之间连接ipadb shell > ifconfig p2p0

# 连接电脑查看⼿机连接⽆线ipadb shell > ifconfig wlan0# 强制删除某⽂件adb shell > rm –rf <⽂件名># Linux查看java版本update-alternatives –config java# Linux更新电脑证书sudo update-ca-certificates –f# python2 python 3 兼容(pip2 list / pip3 list)py -2 –m pip list / py -3 –m pip list# 创建/删除qq⽂件夹mkdir qq / rmdir qq# adb查看设备fingerprint信息adb shell getprop | grep fingerprint# 在android studio底部的Terminal窗⼝中输⼊: netstat -aon|findstr 5037 如下图,会列出哪些进程占⽤了这个端⼝ 1指向的是输⼊命令,2指向的是搜索结果,表⽰有这些进程占⽤了这个端⼝netstat -aon|findstr 5037# 查询在⽤的端⼝netstat –ant# python获取系统时间①#!/usr/bin/python

import timeprint e( ime(()) )②print me('%Y-%m-%d %H:%M:%S',ime(()))③print "%s" % ()④from datetime import datetimeprint ()print ()输出结果:①Wed Dec 12 09:23:02 2018②2018-12-12 09:23:27③Wed Dec 12 09:23:40 2018④2018-12-12 09:24:10.106502 2018-12-12 01:24:34.444605# python输出时间戳import timeimport datetimet = ()print (t) #原始时间数据print (int(t)) #秒级时间戳print (int(round(t * 1000))) #毫秒级时间戳输出结果:1499825149.26499825149257

发布者:admin,转转请注明出处:http://www.yc00.com/xiaochengxu/1689198910a219845.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信