(iphone) access device's documents directory from mac?

前端 未结 8 972
心在旅途
心在旅途 2020-12-01 09:02

I\'m trying to access the documents directory at iphone device to see a log file that I saved while executing the app.

I know this can be done for simulator. (you

8条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-01 09:33

    iOS provides a framework to share documents between your application & iTunes. Check out the Core Services Layer section of the Apple docs, specifically the File-Sharing Support section. It explains how to do this:

    1. Add the UIFileSharingEnabled key to your application’s Info.plist file and set the value of the key to YES.
    2. Put whatever files you want to share in your application’s Documents directory.

    On a side note, if this is just for debugging, you can always print logs using the default NSLog function and check the output using OS X's Console.

提交回复
热议问题