Question: Getting files from Linux to iOS (iPhone)
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Question: Getting files from Linux to iOS (iPhone)
I'm trying to get files to an iPhone without using iTunes, which is not supported on Linux.
I can physically get the files to the iPhone (I'm using WebDAV and a client app on the iPhone for this). But I can't figure out how to get the files to the correct location.
Specifically, I'm trying to put an audiobook (an .m4b file) into a place on the iPhone where the default iBooks app can access it. I can get the file to some directory on the iPhone (iOS seems to work really really hard to obliterate the concept of files and directories). So I don't know where on the iPhone I actually got this file to. However, the WebDAV client that I used to move it from Linux can access the audiobook file. So I know it's on the iPhone ... somewhere. But the iBooks app cannot access the audiobook. Probably because it's walled off somewhere within iOS.
So my question is, (1) How do I move this audiobook from Linux to the iPhone where iBooks can access it (but without iTunes, since we don't have that on Linux)?, or, alternately, (2) How do I move it to the correct place for iBooks after I've already successfully gotten it down to the iPhone (but in what directory I have it in now, I haven't a clue). Looking into alternate (2), I've tried some "file manager" apps on the iPhone (most recently one named "Documents"), but these apps seem to be quite limited in how they can access the filesystem - no doubt this is iOS saying "my way, or the highway" - but I don't really know this for sure, it could be some user error on my part. I am brand new to iOS.
fat chance with every upgrade IOs does it outdates ilibimobile whatever that/them files are called that allows Linux to talk to iPhone. I did have a script I found On the internet using ifuse to mount the iPhone. Don't know if that still works. or where it is at even. Let me go look,
Code:
#!/bin/sh
#
# mount-iphone.sh
# This script attempts to mount or unmount the first connected ipod/iphone.
# Usage: ./mount-iphone.sh [mount | umount | echo_serial]
# It should be dash-friendly
#
# Written by Mohamed Ahmed, Dec 2010
#
# Refactored and extended by David Emerson, Feb 2012
#
# You can configure send_msg to use either a console echo, or notify-send.
# notify-send is part of the debian package, libnotify-bin
# The apple pictures in /usr/share/pixmaps are part of the gnome-desktop-data package
#
# uncomment the following if you want to see the mount command used:
# show_mount_cmd=1
# you can uncomment this line to see all the commands sh executes:
# set -x
show_msg ()
{
# notify-send -t 4000 -u normal "mount-iphone" "$1" -i "/usr/share/pixmaps/apple-$2.png"
echo "$1" >&2
}
get_device_ids ()
{
# get the Apple vendor id (idVendor) from lsusb
idVendor=$(lsusb -v 2>/dev/null | awk '/idVendor.*Apple/{print $2; exit}')
[ -z "$idVendor" ] && { show_msg "Cannot find any Apple device" "red"; exit 1; }
# get the device serial number (iSerial)
iSerial=$(lsusb -v -d $idVendor: 2>/dev/null | awk '/iSerial/{print $3; exit}')
[ -z "$iSerial" ] && { show_msg "Cannot find serial number of Apple device $idVendor" "red"; exit 1; }
}
is_mounted ()
{
gvfs-mount -l | grep -i "mount.*$1" >/dev/null
}
mount_iphone ()
{
[ -z $show_mount_cmd ] || echo gvfs-mount afc://$1/ >&2
if gvfs-mount afc://$1/; then
show_msg "mounted iphone with serial $1" "green"
else
show_msg "iphone mount failed" "red"
exit 1
fi
}
unmount_iphone ()
{
## now gvfs unmount the device
[ -z $show_mount_cmd ] || echo gvfs-mount -u afc://$1/ >&2
if gvfs-mount -u afc://$1/; then
show_msg "unmounted iphone with serial $1" "red"
else
show_msg "iphone umount failed" "red"
exit 1
fi
}
case $1 in
mount)
get_device_ids
is_mounted && { show_msg "$iSerial is already mounted" 'green'; exit; }
mount_iphone $iSerial
;;
umount|unmount)
get_device_ids
is_mounted || { show_msg "$iSerial is not mounted" 'red'; exit; }
unmount_iphone $iSerial
;;
echo_serial)
get_device_ids
echo $iSerial
;;
'')
get_device_ids
is_mounted && show_msg "$iSerial is mounted" 'green' || show_msg "$iSerial is not mounted" 'red'
;;
*)
echo "Usage: $0 [mount | umount | echo_serial]"
exit 1
;;
esac
exit 0
give it a try...
as far as putting stuff in like you're trying to do, I do believe they keep a xml type file that keeps track of that stuff added to the iPhone as well. I have not been able to get into my iPhone on Linux in a long while whenever I did to go looking around inside of it to see where everything is at. So I couldn't tell you.
Airdroid supports IOS. I've been using it on my Android for several years, primarily for file transfer, and it works quite nicely. I have no way of testing it on an iPhone, though, as I refuse to enter the walled orchard. (I entered the Googleplex instead.)
You can use Airdroid locally without creating an Airdroid account. When you start Airdroid on your phone, it grabs an ip address from your wireless router; open that ip address in a browser on a computer and point it to port 8888 (eg., xxx.xxx.xxx.xxx:8888), and you can transfer files to and from computers in your LAN.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.