如何在 Ubuntu 和 iPhone 之间移动文件

如何在 Ubuntu 和 iPhone 之间移动文件

我最近买了一部 iPhone 6s。有没有办法在 Ubuntu 和手机之间传输文件(音乐、照片、PDF 或实际上任何东西)?它不应该涉及通过互联网服务同步,因为我可能需要传输大型或私人文件。另外,我不想越狱该设备。

使用 Google 搜索时会出现一些结果,但似乎都不是最新的。

答案1

我不知道不同版本之间是否存在差异,但当我的 iPhone 5s 通过 USB 插入时(使用 AFC 协议),我可以简单地通过文件管理器访问其中的文件。

我使用的是 iOS 9.2 测试版,不知道它是否适用于 9.1 或更早的版本。我可以从 Nautilus 的侧边栏访问该设备,如果它没有显示,请尝试导航到以下地址:

afc://<your iPhone's UDID>/

此外,大多数音乐播放器(至少 Rythmbox、Banshee 和 Clementine)都支持通过 AFC(Apple File Conduit)同步音乐。

编辑:我刚刚了解到我可以使用 gThumb 之类的工具轻松同步我的图片。

答案2

Apple 不断破坏 Linux 应用程序对 iPhone 的访问。截至 2019 年,上传和下载文件的最佳方式是在 iOS 上使用第三方应用程序。显然,您上传的文件只能由该第三方应用程序访问。

Phone Drive 是一款很好的应用。首先,记下 iPhone 的 IP 地址,然后,当 PhoneDrive 处于前台时,从连接到同一局域网的 PC 输入 iPhone 的 IP 地址,您将看到一个可以上传和下载文件的网站。您还可以在同一个 iPhone IP 地址上使用 FTP 协议。Phone Drive 支持播放许多视频和音乐格式。

https://itunes.apple.com/us/app/phone-drive-file-storage-sync/id431033044

答案3

libimobiledevice 可以通过图形包 mgr. 或终端安装。

sudo apt install usbmuxd libimobiledevice6 libimobiledevice-utils
mkdir ~/iPhone
ifuse ~/iPhone

(挂载目录)

这里

QRCP 链接

答案4

对我来说,最好的免费方法是在本地机器上安装一个网络服务器,然后通过 iPhone 上的 Safari 浏览器共享所有内容,步骤 YMMV

sudo apt install nginx php-fpm git
mkdir ~/iphoneFiles
sudo nano /etc/nginx/sites-available/default

删除其中的所有内容并添加类似的内容,记得修改 <YOUR-USER> 并在必要时更改 php 版本php7.4-fpm.sock

server {
    listen 80;
    server_name localhost;

    root /home/<YOUR-USER>/iphoneFiles/elFinder;

    index elfinder.src.html;

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
     }
}

安装https://github.com/Studio-42/elFinder

cd ~/iphoneFiles
git clone https://github.com/Studio-42/elFinder.git

配置 elFinder

mv elFinder/php/connector.minimal.php-dist connector.minimal.php

为上传文件夹设置(可能)正确的权限

sudo usermod -a -G www-data $USER
sudo chown -R $USER:www-data elFinder/files/
sudo chmod a+rwx,o-rwx,ug+s elFinder/files/
ln -s ~/iphoneFiles/elFinder/files/ ~/Documents/iphoneFiles

让 nginx 加载新的 set 指令

sudo service nginx reload

现在获取你的本地网络 IP

hostname -i | awk '{print $1}'

使用你的 iPhone 输入该 IP 并开始上传图片或任何你想要的内容

注意:您需要修改 elFinder 设置以允许上传所有类型的文件

sed -i 's/.*uploadDeny.*/'uploadDeny' => array(''),/' elFinder/php/connector.minimal.php
sed -i 's/.*uploadDeny.*/'uploadAllow' => array('all'),/' elFinder/php/connector.minimal.php

如果你一切顺利,你的文件应该位于:

~/Documents/iphoneFiles

相关内容