iOS自动化常用命令

摘要:
目录brew命令摘要idevice命令摘要xcrun通用命令brew命令概要安装brewinstallgit卸载brewuninstallgit搜索brewsearch/git*/Help brew--helpmanbrew显示已安装的包brewlist更新所有本地安装的包brewupdate查看需要更新的已安装包brewuupdated更新单个包brewupgrade查看包信息b

目录

brew命令总结

  • 安装

brew install git

  • 卸载

brew uninstall git

  • 搜索

brew search /git*/

  • 帮助

brew --help
man brew

  • 显示已经安装的包

brew list

  • 更新本地所有安装的软件包

brew update

  • 查看已安装的哪些软件包需要更新

brew outdated

  • 更新单个软件包

brew upgrade

  • 查看软件包信息

brew info git

  • 清理所有已安装软件包的历史老版本

brew cleanup

  • 清理单个已安装软件包的历史版本

brew cleanup git

idevice 命令总结

  • 安装ipa包
    ideviceinstaller -i xxx
  • 覆盖安装ipa包
    ideviceinstaller -g xxx
  • 打印已安装app列表,com.xxx是bundleid
    ideviceinstaller -l
  • 卸载ipa包
    ideviceinstaller -U
  • 查看设备信息
    ideviceinfo
  • 查看设备udid
    idevice_id -l
  • 查看iOS系统版本号
    ideviceinfo -k ProductVersion
  • 查看系统日志
    idevicesyslog
  • 将日志导入到iphone.log文件中
    idevicesyslog >> iphone.log &
  • tail -f和grep查看报错log
    tail -f iphone.log
    tail -f iphone.log | grep '搜索内容'

获取设备的的UDID

  • idevice_id --list # 显示当前所连接设备的 udid
  • instruments -s devices # 列出所有设备,包括真机、模拟器、mac
  • ideviceinfo 可以在返回的数据中找到 udid
  • ideviceinstaller -i apppath 安装apppath下的app
  • ideviceinstaller -u [udid] -i [xxx.ipa] # xxx.ipa 为应用在本地的路径
  • ideviceinstaller -u [udid] -U [bundleId]卸载应用
    查看设备已安装的应用
  • ideviceinstaller -u [udid] -l # 查看设备安装的第三方应用
  • ideviceinstaller -u [udid] -l -o list_user # 同上,查看设备安装的第三方应用
  • ideviceinstaller -u [udid] -l -o list_system # 查看设备安装的系统应用
  • ideviceinstaller -u [udid] -l -o list_all # 查看设备安装的所有应用获取设备信息
  • idevicedate 获取设备时间
  • ideviceinfo -u [udid] # 获取设备信息
  • ideviceinfo -u [udid] -k DeviceName # 获取设备名称 同命令 idevicename
  • idevicename # 同上
  • ideviceinfo -u [udid] -k ProductVersion # 获取设备版本 10.3.3
  • ideviceinfo -u [udid] -k ProductType # 获取设备类型 iPhone 8,1
  • ideviceinfo -u [udid] -k ProductName # 获取设备系统名称
    其他系统文件信息
  • ideviceinfo # 获取设备所有信息
  • idevicesyslog # 获取设备日志
  • idevicesyslog -u [udid] > /Users/home/Desktop/log.log # 将日志输出到指定路径
  • idevicecrashreport -e test # 获取设备 crashlog,test 是文件夹需新建
  • idevicediagnostics # 管理设备状态 - 重启、关机、睡眠等
    ios-deploy 常用命令
  • ios-deploy -c # 查看当前链接的设备
  • ios-deploy --[xxx.app] # 安装APP
  • ios-deploy --id [udid] --uninstall_only --bundle_id [bundleId] # 卸载应用
  • ios-deploy --id [udid] --list_bundle_id # 查看所有应用
  • ios-deploy --id [udid] --exists --bundle_id # 查看应用是否安装
    列举设备安装的应用:
  • ideviceinstaller -l则可以列出手机上所有的用户安装的app
    运行某个app
  • idevicedebug run 'APP_BUNDLE_ID'可以直接launch某个app,当然,这个app必须是你通过development证书build到手机上的才行。
    获取手机的设备版本:
  • Ideviceinfo -k ProductVersion
    获取手机的设备名:
  • ideviceinfo -k ProductType
    截图:
  • idevicescreenshot
  • idevicescreenshot /Users/medivh/Desktop/a.png # 将文件输入到指定路径
    录像:
  • xrecord --quicktime --list
  • xrecord --quicktime --name="iPhone" --out="/Users/blah/video/iphone.mp4" --force
    手机关机:idevicediagnostics shutdown # shutdown device
    重启手机:idevicediagnostics restart # restart device
    休眠(熄屏灭屏): idevicediagnostics sleep # 类似于断开adb . (disconnects from host)

xcrun常用命令

- bundleID
unzip xxx.ipa
cd Payload/xxx.app
defaults read `pwd`/Info CFBundleIdentifier
- show SDK
xcodebuild -showsdks  # 查看本机sdk版本
- 开启指定模拟器
xcrun instruments -w 'iPhone 7 Plus (11.4) [$uuid]'
- 安装指定app
xcrun simctl install booted <app path>
- 运行指定app (com.example.app)
xcrun simctl launch booted <bundleID>
- 卸载指定应用
xcrun simctl uninstall booted <bundleID>
- inspector
app-inspector -u uuid/udid

windows使用tidevice
参考:https://github.com/alibaba/taobao-iphone-device
main_test、wda_tidevice是配合tidevice启动wda的使用

安装
pip3 install -U tidevice

启动wda
tidevice xctest -B .xctrunner
wda崩溃自动重启指令
tidevice wdaproxy -B com.xia.WebDriverAgentRunner.xctrunner

常用命令

  • 安装应用
    $ tidevice install example.ipa
  • 指定设备安装
    $ tidevice --udid $UDID install https://example.org/example.ipa
  • 卸载应用
    $ tidevice uninstall com.example.demo
  • 启动应用
    $ tidevice launch com.example.demo
  • 停止应用
    $ tidevice kill com.example.demo
  • 查看已安装应用
    $ tidevice applist
  • 查看运行中的应用
  • tidevice ps
    $ tidevice ps --json output as json

免责声明:文章转载自《iOS自动化常用命令》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇windows下nginx的安装及使用Win7 打开访问共享目录时输入正确密码仍然提示密码错误下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

iOS开发之沙盒机制

iOS应用储存分以下几种: 一、沙盒基本机制 二、plist储存 三、偏好设置 四、NSKeydeArchiver归档 一、沙盒基本机制(sandbox) iOS系统相对于Android系统,或者相对于Windows系统来说比较安全的原因很多,其中有一点就是苹果推出的沙盒机制,每个应用都有自己对应的沙盒,每个应用程序之间不能相互访问非本程序的沙盒,所以,...

软件工程知识点总结

软件的概念: 软件是计算机系统中与硬件相互依存的另一部份,是程序、数据、以及相关文件的完整集合。程序是事先设计的功能要求执行的序列。数据是使得程序能征程操作信息的数据结构。文档是程序开发,维护和利用的有关图文和材料。软件的表现形式分为有形和无形,软件的有形表现在软件的的文档、程序、代码、用户界面、输出表报、等。软件的无形部分表现在:软件的内部逻辑,是软件自...

Flask结合ECharts实现在线可视化效果,超级详细!

点击上方 蓝字 关注我,带你学习Python 大家好,我是阿辰,今天教大家如何利用Flask框架结合ECharts,将采集的数据实现在线可视化效果(可以将可视化效果放到网页上,分享给其他小伙伴) 一、Flask框架基本使用 在开始可视化之前,先让大家对Flask有一个大概了解和基本使用 Flask和Django都是Python最常用的两个网站框架,...

Beyond Compare乱码问题汇总

如果你每天都有大量的文件需要进行比较,那么你一定需要一款比较神器来助你摆脱繁杂的工作,Beyond Compare 中文版就是这样一款专业的文件和文件夹比较工具。如果你以为找到这款对比神器就万事大吉了,其实更让人苦恼的问题还在后面。 当使用Beyond Compare软件比较文件时,乱码问题时常出现,首先需要明确的是这并不是软件自身的漏洞,而是我们没有正确...

关于IAR软件的Go to Definition of功能问题的解决方法

关于IAR软件的Go to Definition of功能问题的解决方法 首先,工程文件必须放在没有中文的路径下,如果路径里有中文应把中文该成英文 如:C:UsersABCDesktop新建文件夹 则把“新建文件夹”改为"new" 1、 Go to Definition of是灰色的 Tools → Options → Project�勾选Generate...

pip安装使用详解

#yuminstallwget #wget'https://bootstrap.pypa.io/get-pip.py' #pythonget-pip.py #pipinstallpyopensslndg-httpsclientpyasn1 #pipinstall'requests[security]' #wgethttps://pypi.python.or...