View logs generated by the xcode simulator and real machine (required for iOS)

Source: Internet
Author: User

ActualCodeSome plist files are generated during development. But how can I check whether these plist files are successfully generated and the generated content is correct during debugging?

How can I view the logs generated by the simulator and those generated by the real machine?

 

Demo

Generate a plist file first

Nsarray * paths = nssearchpathfordirectoriesindomains (nsdocumentdirectory, nsuserdomainmask, yes );

Nsstring * documentsdirectroy = [paths objectatindex: 0];

Nsstring * filename = @ "1. plist ";

Nsstring * filepath = [tmpfolder stringbyappendingpathcomponent: Filename];

Nsmutabledictionary * DIC = [[nsmutabledictionary alloc] init];

[DIC setvalue: @ "11111" forkey: @ "1"];

[DIC writetofile: filepath atomically: True];

 

View simulator logs

Okay. Now you need to debug it on the simulator.Program:

Run the simulator;

Open Finder, press and hold option, and select "go"-"resource library" in the menu bar"

Select the first "Application Support"-"iPhone Simulator"-"5.0" (if the version generated by the simulator is 5.0, if the version is not selected)

-"" Application "-> at this time, a bunch of directories with similar guids will be found one by one, and a directory with the project name is found.

-"Go to the" documents "directory, and you can see the newly created plist file. Open it and check whether the content is correct.

 

View real machine logs

Select to debug to the real machine (I will not accept the certificate-related configuration, there are many online)

Run the real machine program to generate logs

You need to use a tool to view the log "iPhone Explorer" for real machine logs. Open "iPhone Explorer" and find the project name directory under the "application" directory,

Open "documents" and you will be able to see the newly created plist file. However, if you cannot open the file at this time and drag the file to the desktop, you can view it.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.