Xcode6 simulator path

Source: Internet
Author: User
Tags tmp folder
After the release of xcode6, there have been many changes and functional changes. I will not repeat them too much here. On WWDC, Apple has already talked about it and there are many articles on the Internet, here we will introduce some small things that are not easy to find, but very important.
1. xcode6 simulator path change
In xcode5 and earlier versions, the path of the xcode simulator is/users/username/library/Application Support/iPhone simulator. In this folder, you can view all the simulator versions. Click it to view the application sandbox.
During development, we recommend that you drag the shortcut path to the personal favorites on the left side of the Finder to conveniently open and view the application sandbox.
In xcode6, the simulator location is changed. The address is as follows:/users/username/library/developer/coresimulator. The following information is displayed when it is enabled:
Here, Apple codes the simulator, not by naming and classifying the simulator system version, but by distinguishing all the simulators in xcode6, the 16 folders correspond to 16 simulators in xcode6 respectively. How can we determine which simulator is based on this seemingly garbled folder?
After a file is selected, a folder named data and device are displayed. plist configuration file, open device. after the plist configuration file, you will see the simulator's udid, device type, system version, name, and so on. This allows you to know the device and system version of the simulator. After opening the file, you will find that the preceding seemingly garbled file name is actually the device udid of the simulator. Although you can obtain the simulator udid from here, Apple also uses it for classification simulators, however, in actual programming, if you want to release the app to the App Store, you should give up the udid, which is also a more aggressive aspect of apple, of course, it is also made to protect user privacy.
2. Change the sandbox address
After obtaining the simulator path, there are still many differences, and the sandbox address of the application is also different from the previous one.
In xcode5 and earlier versions, the sandbox address is as follows:/users/username/library/Application Support/IP hone simulator/7.0.3/applications. In the Applications Section, the Sandbox of the application is found.
After opening the application sandbox, there will be Application Files, document folders, library folders, and TMP folders. The roles of these folders are not described here.
In xcode6, four files, application file, document folder, library folder, and TMP folder, are stored in different directories. Application file path:/users/username/library/developer/coresimulator/devices/simulator udid/data/containers/bundle/, under the application folder; document folder, library folder, and TMP folder path:/users/username/library/developer/coresimulator/devices/simulator udid/data/containers/data/, under the application file. However, unfortunately, the names of opened files in these two paths are encoded, the application files in the same application are different from those in the folders D, L, and T. You can only find it by yourself.
3. nsuserdefault file storage location change
Nsuserdefault is a localized data storage method provided by ios. A. plist configuration file is automatically created in the sandbox to save the data and receive the data in the nsdictionary dictionary during reading.
In xcode5 and earlier versions, the path is/users/shifengwei/library/Application Support/iPhone simulator/7.0.3/applications/C9588981-3D82-49BC-92B8-F5BA72185629/Library, under the preferences folder, the plist file named bundle identifier. After a program in the simulator is deleted, the plist file in the library folder is deleted accordingly.
In xcode6, the Program replaced the location of the plist file created using nsuserdefault. The specific path is: /users/username/library/developer/coresimulator/devices/simulator udid/data/Library, under the preferences folder.
In particular, this is not the case if you look at the path opened in the finder, but you can find the path through the finder and go to the folder. The preceding path address is obtained by viewing the overview of the preferences folder.
From the above path, we can see that the plist folder created through nsuserdefault is still under the library file, but the difference is that the actual storage location has changed to under the simulator database folder, the change is that after we delete the application in the simulator, the plist file will still be retained and will not be deleted.
So, since the positions in the simulator have changed, what are the differences after the upgrade to ios8? Next we will talk about the differences in debugging on a real machine.
1. In organizer, in xcode5, there are three columns: devices, projects, and archives. In xcode6, devices is obtained separately, which is at the same level as organizer. In the xcode menu bar, window. If you have learned about xcode from 4. when upgrading X to 5, you will know that the organizer was changed at that time, from the original four columns to three columns, and the help document was removed.
2. When debugging a real machine, the sandbox of the application program in the real machine is opened for viewing. In xcode, open the application of devices, you can download the sandbox of the application and view the sandbox information by right-clicking the package content. However, there are differences between ios8 and ios7.
The content of the sandbox downloaded for the same application in different systems is shown in the figure on the left under ios8. The content of the sandbox downloaded in the figure on the right is under ios7.0.4. Obviously, in ios8, the content in the sandbox downloaded through devices cannot be viewed.
Through third-party software, ifunbox is used here. After finding the application, you can view the content of the sandbox and copy it to the local device. Then, you can find the original five files, there are only three folders: Document folder, library folder, and TMP folder.
Specifically, the plist file automatically created through nsuserdefault in the simulator will be retained after the software is deleted, but it will be retained in the real machine, it will also be deleted. The path of the corresponding plist file is under the preferences folder under the exported library folder. After the application is deleted, it will not be retained. This should be regarded as a real machine and a simulator.
This difference may cause a situation. Can nsuserdefault be used? As far as the author is concerned, nsuserdefault will not be discarded. After all, it will only delete the application retained in the simulator, but not in the real machine, and nsuserdefault will be used as data persistence during development, it is useful when saving data. Of course, some developers will not adapt to this situation and worry that it will appear in the real machine. If some developers think it is not appropriate, they can create a plist file in the sandbox instead, however, we do not recommend that you use nsuserdefault in applications. After all, nsuserdefault encapsulated by Apple is still very useful. After deleting a file in the simulator, you can delete the plist file in the folder where the plist file is saved. There are multiple steps. At least for now, the plist file is still the same in the real machine as before.
Of course, in iOS, apart from the fact that nsuserdefault will automatically generate a file for data storage, the archive is also the same. Since I did not perform a test, I will not talk about it here to avoid misleading it, after the test, summarize and release.

PS: At last, add the command to open or close a hidden file on Mac.
Open the Mac hide file command: Defaults write com. Apple. Finder appleshowallfiles-bool true
Run the "defaults write com. Apple. Finder appleshowallfiles-bool" command to disable Mac hiding files.
Method: Enter the command in the terminal, press enter, and then force exit. Restart the finder.

Xcode6 simulator path

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.