How can I open/view iOS OSLogs stored on device?

前端 未结 2 1085
时光说笑
时光说笑 2021-01-07 14:23

I\'m creating logs using Apple\'s os.log framework. I\'m just making logs like:

os_log(\"Update: Lat: %{public}f | Long:  %{private}f | Remaini         


        
2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-07 14:27

    After following the suggestions of this answer I was able to redirect the logs into the documents directory for my app's sandbox, then I was able to download my container/sandbox using this answer.

    Once I clicked on show package contents I had this:

    I opened the log files using console and the results I got were:

    The Longitude should have showed up as private but since I had it ran through Xcode ie debug mode still the field was rendered public.


    You can also retrieve the logs remotely without any specific setup.

    • trigger a sysdianose.
    • use Airdrop and share the sysdiagnose to your mac
    • unarchive the sysdiagnose file. It will look like this:

    • open the system_logs.logarchive with Console.app
    • it will be as if you're connected to the Console.app. You can filter by subsystem, log level, category and time. It will look like this:

    Note: Searching and filtering is quite slow. Sometimes it takes 2 minutes. It might help if you filter out the dates you don't care about. You can do that by using the filer at the bottom. You have to wait until the loading archive spinner at the bottom right is done loading

提交回复
热议问题