做一个帮你备份优化 iPhone 相册和应用空间的 cli 会不会有人用呢

5 小时 39 分钟前
 plane

0x01

不知道大家用过 mole 吗,很棒的一款终端软件可以帮你清理和优化 mac 电脑的存储空间。但是他只支持 mac ,而我主要困惑是手机,而对于我们这种 iPhone 手机常年处于存储满了,iCloud 也早就满了,不想花钱拼车或换手机改硬盘,老是得删东西才能下新的应用的人来说,太难受了,而且这么多年了,没有什么好用的免费的软件可以帮忙。

所以我就想做一个 iPhone 版本的 mole ,我把他命名为:iMole

0x02

他的使用非常简单,把你的 iPhone 连接上你的电脑(最好是 mac 电脑),然后让 agent 自己使用 iMole 帮你检测优化,或者你自己去执行都可以。

直接把 github 地址丢给你的 agent 去安装,或者执行:

npm install -g @getimole/imole

然后,你可以开始使用了。

使用示例:

# 查看存储占用
imole scan --summary

# 找出最大的视频文件
imole scan --top 20 --only videos

# 备份 90 天前的视频
imole backup --to ~/iphone-backup --only videos --older-than 90d --dry-run
imole backup --to ~/iphone-backup --only videos --older-than 90d

# 删除已备份的文件
imole clean --manifest ~/iphone-backup/manifest.json --yes

查看空间统计:

imole scan --summary

Scanning media…
Querying app storage…
iMole Storage Summary

Media:     28.9GiB · 9960 files
  Photos:  10.3GiB · 6579 files
  Videos:  18.6GiB · 3261 files
  Top video: IMG_7523.MOV · 327.7MiB
Device:   ███████████████░  99.2% 1.9GiB free

Apps:      35.9GiB · 49 apps
  App code: 13.9GiB
  App data: 22.0GiB
  Top app:  网易云音乐 · 3.2GiB

Recommended next steps:
  imole scan --top 30 --only videos
  imole scan apps --top 20

查看占用最多的图片或视频:

imole scan --top 10 --only videos

Scanning device… (may take ~15 s for USB)
Device ready: imagecapture:山哥本山
Top 30 Videos

 1. IMG_7523.MOV                 327.7MiB  2025-07-30
 2. IMG_7510.MOV                 306.8MiB  2025-07-29
 3. IMG_4109.MOV                 270.8MiB  2024-09-15
 4. IMG_9441.MOV                 267.3MiB  2026-04-06
 5. VRQA7650.MP4                 260.3MiB  2025-07-20
 6. XCGC7110.MP4                 172.9MiB  2025-07-18
 7. IMG_4113.MOV                 151.7MiB  2024-09-15
 8. AYXW6719.MP4                 143.3MiB  2025-07-18
 9. IMG_5865.MOV                 142.3MiB  2025-01-11
10. IMG_7036.MOV                 141.8MiB  2025-06-15

0x03

开源不易,如果感兴趣或者能帮助到你,欢迎点赞转发!

地址: https://github.com/chenhg5/imole

加入 telegram 群一起交流: https://t.me/+ZpgBu1dlmCszODBl

173 次点击
所在节点    分享创造
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1216833

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX