libimobiledevice
#### 安装与卸载
```bash
ideviceinstaller -i xxx.ipa # 安装
ideviceinstaller -u [bundleID] # 卸载
ideviceinstaller -u [udid] -l # 查看指定设备安装的第三方应用
ideviceinstaller -u [udid] -l -o list_system # 查看指定设备安装的系统应用
ideviceinstaller -u [udid] -l -o list_all # 查看指定设备安装的所有应用
```
#### 列出本机模拟器及连接设备的信息
```bash
instruments -s devices
```
#### 查看连接设备信息
```bash
idevice_id -l # 打印当前已连接设备的udid
ideviceinfo # 打印设备信息
ideviceinfo -k ProductVersion # 获取连接设备的系统版本号
ideviceinfo -u [udid] # 指定设备,获取设备信息
ideviceinfo -u [udid] -k DeviceName # 指定设备,获取设备名称:iPhone6s
idevicename -u [udid] # 指定设备,获取设备名称:iPhone6s
ideviceinfo -u [udid] -k ProductVersion # 指定设备,获取设备版本:10.3.1
ideviceinfo -u [udid] -k ProductType # 指定设备,获取设备类型:iPhone8,1
ideviceinfo -u [udid] -k ProductName # 指定设备,获取设备系统名称:iPhone OS
```
#### 备份
```bash
idevicebackup
```
#### 获取系统崩溃日志
```bash
idevicecrashreport
```
#### 远程调试代理
```bash
idevicedebugserverproxy
```
#### 获取设备时间
```bash
idevicedate
```
#### 重启设备
```bash
idevicedignostices restart
```
#### 截屏
```bash
idevicescreenshot /Users/medivh/Desktop/a.png # 将文件输入到指定路径
```
#### 日志
```bash
idevicesyslog # 日志输出到屏幕
idevicesyslog -u [udid] > /Users/home/Desktop/log.log # 将日志输出到指定路径
```
#### bundleID
```bash
unzip xxx.ipa
cd Payload/xxx.app
defaults read `pwd`/Info CFBundleIdentifier
```
#### show SDK
```bash
xcodebuild -showsdks # 查看本机sdk版本
```
#### 开启指定模拟器
```bash
xcrun instruments -w 'iPhone 7 Plus (11.4) [$uuid]'
```
#### 安装指定app
```bash
xcrun simctl install booted <app path>
```
#### 运行指定app (com.example.app)
```bash
xcrun simctl launch booted <bundleID>
```
#### 卸载指定应用
```bash
xcrun simctl uninstall booted <bundleID>
```
### appium inspector 这个基本没法用
```bash
app-inspector -u $uuid/udid
```
### appium-desktop inspector 这个最好用了
```
1、打开appium-desktop,start;
2、菜单栏->Appium->new session window;
3、saved capabillity sets中设置参数, host:127.0.0.1:4723/wd/hub,
devices = {
"platformName": "iOS",
"deviceName": "iPhone 6",
"platformVersion": "11.0",
"bundleId": "com.chezhubang",
"automationName": "XCUITest",
"udid": "2aeda56a9b8c38eacb6ff8055ecce4998174cd0f"};
4、start session;
```
### xcodebuild
```bash
UDID=$(idevice_id -l)
xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination "id=$UDID" test
```
### wda inspector 这个相对好用一点
```bash
UDID=$(idevice_id -l)
xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination "id=$UDID" test
https://[ip]/inspector
```
### iproxy
```bash
iproxy [port] [port]
```
### 查看设备的描述文件
```bash
ideviceprovision list
```
作者:medivhxu
出处:https://www.cnblogs.com/medivhxu/p/10939588.html
版权:本作品采用「署名-非商业性使用-相同方式共享 4.0 国际」许可协议进行许可。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库