54

A program logs some message in directory /var/mobile/Containers/Data/Application on iPhone. Is there any way I can get access to this directory without jailbreaking iPhone? If no, is there any directory on iPhone that I can log into and read my logs without jailbreaking?

ZigZagZebra
  • 1,349
  • 3
  • 14
  • 25

1 Answers1

164

If this is your app, if you connect the device to your computer, you can use the "Devices" option on Xcode's "Window" menu and then download the app's data container to your computer. Just select your app from the list of installed apps, and click on the "gear" icon and choose "Download Container".

enter image description here

Once you've downloaded it, right click on the file in the Finder and choose "Show Package Contents".

Rob
  • 415,655
  • 72
  • 787
  • 1,044
  • I found that the data container only has three most recent logs. Is there any way that I can get older logs? – ZigZagZebra Jun 27 '16 at 23:39
  • 1
    AFAIK, that container contains everything on the device. Maybe app was reinstalled at some point. Or maybe the logs were purged at some point due to storage constraints. But I'm pretty sure this container contains everything that is available. – Rob Jun 27 '16 at 23:42
  • Oh, yeah. I reinstalled the app during this time. Thanks. – ZigZagZebra Jun 27 '16 at 23:52
  • 1
    @Rob Is there a way to access the shared "/Shared/AppGroup/" location too without the jailbreak ? – user3752049 Apr 11 '17 at 19:51
  • is there a way to do that for release builds? – Priyal Feb 16 '18 at 07:13
  • @Priyal - This process of downloading the container works fine for both debug and release builds (that you launch from Xcode, at least). Or are you talking about apps installed via the store or some other mechanism? If it's not working for you, I'd suggest you just post your own question with more details, as diagnosing this in comments here is probably not the right place to do that... – Rob Feb 16 '18 at 19:57
  • Wow, really nice. Thanks! @Rob – atereshkov Jun 12 '18 at 12:20