pymobiledevice3使用介绍(安装、常用命令、访问iOS沙盒目录)

项目地址:https://github.com/doronz88/pymobiledevice3

首先先介绍一下pymobiledevice3,

pymobiledevice3是用Python3 实现的,用于处理 iDevices(iPhone 等)。它可以跨平台使用,支持:windows、Linux、macOS。

【安装】

git clone git@github.com:doronz88/pymobiledevice3.git

cd pymobiledevice3

python3 -m pip install -U -e .

【常用命令】

pymobiledevice3提供的命令如下:

1、查看iOS设备的udid:pymobiledevice3 usbmux list

这个命令类似于idb的 idb list-targets和libimobiledevice的 idevice_id -l:

2、查看app的bundle id,通过输入命令:

pymobiledevice3 apps list --udid f89d929e8c45a81c0fe2d2xxxxxxxxxxxxxxxxxxxf

可以查看手机安装app的info.plist中的部分信息,如:

这个命令类似于idb的 list-apps,

idb list-apps --udid f89d929e8c45a81c0fe2d2xxxxxxxxxxxxxxxxf

类似于libimobiledevice的ideviceinstaller -u f89d929e8c45a81c0fe2d2xxxxxxxxxxxxxxxf -l

3、安装应用:

pymobiledevice3 apps install /Users/testmanzhang/Downloads/axxx_app_ios_internal_global_debug_3.x.x.xxxx.ipa

这个命令类似于idb的install,

idb install /Users/testmanzhang/Downloads/axxx_app_ios_internal_global_debug_x.x.x.xxxx.ipa

类似于libimobiledevice的ideviceinstaller,

ideviceinstaller -i /Users/testmanzhang/Downloads/axxx_app_ios_internal_global_debug_x.x.x.xxxx.ipa

4、卸载应用:

pymobiledevice3 apps uninstall com.xxxxxxx.ios

类似于idb的uninstall,idb uninstall com.xxxxxx.ios

类似于libimobiledevice的ideviceinstaller,

ideviceinstaller -U com.xxxxxxx.ios

5、查看系统日志:

pymobiledevice3 syslog collect /Users/testmanzhang/Downloads/11111.logarchive

生成的日志文件到达948M后收集停止,在mac上使用console.app打开查看

这个命令类似于idb log、libimobiledevice的idevicesyslog

6、重启设备命令:pymobiledevice3 diagnostics restart

7、截图命令:pymobiledevice3 developer screenshot /Users/testmanzhang/Downloads/2222.png

8、访问应用的沙盒目录:pymobiledevice3 apps afc com.xxxxxxx.ios,

启动的是xonsh-afc shell,它是在xonsh的基础上增加了afc,即Apple File Conduit。

进入shell后界面如下:

它提供的命令有:

例如,ls,显示的就是iOS对应应用ios.glazero.ios的沙盒目录:

例如,cd进入Documents/Logs目录,可以将目录下的文件拉取到本地:

pull xxxxxx_app_ios_20241014.log /Users/testmanzhang/Downloads

也可以使用cat和grep查看该日志文件

cat xxxxxx_app_ios_20241014.log | grep "addDpUpdateDelegate"

相关推荐
Digitally16 小时前
如何将大型音频文件从 iPhone 发送到不同的设备
ios·iphone
吴Wu涛涛涛涛涛Tao20 小时前
Flutter 实现「可拖拽评论面板 + 回复输入框 + @高亮」的完整方案
android·flutter·ios
搜狐技术产品小编20231 天前
CAEmitterLayer:iOS 中创建炫酷粒子效果的魔法工具
macos·ios·objective-c·cocoa
00后程序员张2 天前
iOS App 混淆与资源保护:iOS配置文件加密、ipa文件安全、代码与多媒体资源防护全流程指南
android·安全·ios·小程序·uni-app·cocoa·iphone
咕噜签名分发冰淇淋2 天前
内测分发是什么?
ios
2501_916007472 天前
Transporter App 使用全流程详解:iOS 应用 ipa 上传工具、 uni-app 应用发布指南
android·ios·小程序·https·uni-app·iphone·webview
白玉cfc2 天前
【OC】单例模式
开发语言·ios·单例模式·objective-c
Digitally2 天前
比较 iPhone:全面比较 iPhone 17 系列
android·ios·iphone
2501_915909062 天前
HTTPS 错误解析,常见 HTTPS 抓包失败、443 端口错误与 iOS 抓包调试全攻略
android·网络协议·ios·小程序·https·uni-app·iphone