I'm looking to use the command line (Terminal or iTerm2) to export a long conversation to PDF or HTML in monthly chunks. I want to be able to do this regularly so I can make a regular backup and maybe I can find a nice pretty way to display it on the web or via Google Drive or Dropbox. Who knows..

If I have to write some code to do that, I think I can handle it. According to my research, those chat messages are stored as an SQLite database hidden somewhere in the application data directories for the 'Messages' application.

Are there any existing tools for this? I suspect because the SQLite method I mentioned is not an "official" way to access that data, it's likely not published on the web anywhere?

I've tried some of the commercial products but they are okay at best. Would like to get to the raw data if I can. Out of the commercial projects I've tried:

  • iExplorer
  • PhoneView
  • Decipher TextMessage

At this point I tried using iExplorer to export one huge PDF (2.5k pages). What I would ideally want (and what this question is asking for) is to be able to run a regular job via Terminal to update the HTML or PDF representation of the chat log.

UPDATE: For anyone else who has the same problem, I've been using iExplorer which apparently does work it just takes FOREVER because my file is huge. I want something that's iterative so I can run this process on a regular basis.

  • 1
    Are you trying to split the PDF still on the iPhone? iPhones don't have command line to my knowledge, so it seems to me your question has some information it doesn't need (the iPhone bit) and is lacking some information it does need (what sort of computer you're working on right now. Your question will attract close vote right now because mobile devices are off topic. If you're working on a computer though, it doesn't matter where the PDF originated, and therefore the question would be on topic. Please EDIT your question to clarify. Jun 29, 2018 at 18:27
  • I'm looking for a way to export the data from my iPhone via command line if possible. There are lots of GUI tools to do this none that I've found that use the command line. I would like the finished product to be a PDF but if it's in some format I can convert to PDF that's fine too. Jun 29, 2018 at 18:30
  • Via what command line? To what sort of computer running what sort of OS? Jun 29, 2018 at 18:45
  • I'm on a Mac, but I'm not afraid to use a virtual machine if the tools are for Windows. And from what I understand compiling Linux on Mac is often doable. Jun 29, 2018 at 18:47
  • Could you add that information about the computer you're working on to the original question? This will help keep drive-by close votes as it will be more clear that you are working on a computer issue. That said, another question: Have you been able to get the PDF to the Mac at all, or is getting it to the computer part of the problem? Have you tried whatever normal file transfer options there are for iPhone to Mac? What about DropBox or another cloud storage solution? How large is the file (in MB)? Jun 29, 2018 at 19:22

1 Answer 1


This is not a complete answer but this blog post[1] is a possible lead. Apparently this guy found out where some of the files are located. I have yet to try his solution. I will post back here after I've tried it.

[1] https://linuxsleuthing.blogspot.com/2015/01/getting-attached-apple-messaging.html

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .