XCODE6 Simulator Path Change description

Source: Internet
Author: User
Tags tmp folder

Xcode6 released, there have been a lot of changes, functional changes, here do not do too much to repeat, in the WWDC Apple has been told, there are many articles on the Internet, here to introduce is not too easy to find, but very important small place.
1. Change of Xcode6 Simulator path
In Xcode5 and previous versions, Xcode's emulator path was:/users/username/library/application Support/iphone Simulator. Under this folder, you can view all the emulator versions, and then click inside to see the app sandbox situation.
In development, it is recommended that you drag the file shortcut path to the left-hand side of the finder to easily open the View app sandbox.
In Xcode6, the location of the simulator has been changed, the address is as follows:/users/username/library/developer/coresimulator, when opened, you will find the following conditions:
Here, the Apple to encode the simulator, not in the simulator system version of the naming and classification, but the Xcode6 of all the simulator to distinguish, the inside of the 16 folders corresponding to the Xcode6 of the 16 simulator, then how to according to this seemingly garbled folder, What kind of simulator are you judging?
When a file is selected, open will see a folder named Data, and Device.plist configuration file, after opening the Device.plist profile, you will see the emulator Udid, device type, system version, name and so on. This allows you to know the device and system version of the simulator. Open, will find that the front of the seemingly garbled file name, is actually the simulator device Udid, although from here can get simulator Udid, Apple also use it to carry out classification simulator, but in the actual programming, if you want to finally publish to the App Store, or give up Udid bar, This is also a more overbearing apple, of course, is also in the protection of the privacy of users to make.

2. Change of application sandbox address
After getting the simulator path, or using a lot of different, the application sandbox address is also different from before.
In Xcode5 and previous versions, the sandbox address is as follows:/users/username/library/application SUPPORT/IP Hone Simulator/7.0.3/applications, In applications, the application's sandbox will be found.
After you open the app sandbox, there are application files, document folders, library folders, and TMP folders. As for the role of these folders do not repeat here.
In Xcode6, the four files of the application file, document folder, library folder, tmp folder are placed in different directories. Application file path:/users/username/library/developer/coresimulator/devices/simulator udid/data/containers/bundle/, Application folder, document folder, Library folder, tmp folder path:/users/username/library/developer/coresimulator/devices/ Emulator under the Udid/data/containers/data/,application file. Unfortunately, these two paths are opened with file names that are encoded, and the file names of the application files in the same app and the folders where the D, L, and T folders are located are different. Can only find their own.

3. nsuserdefault File storage location change
Nsuserdefault is a localized data storage method provided by iOS that automatically creates a. plist profile in the sandbox, saves the data, and receives it in a nsdictionary dictionary when read
In Xcode5 and previous versions, the specific path is:/users/shifengwei/library/application support/iphone simulator/7.0.3/applications/ Under the C9588981-3d82-49bc-92b8-f5ba72185629/library,preferences folder, the name is plist file for the program bundle identifier. After you delete the program in the emulator, the plist file in the Library folder is deleted accordingly.
In Xcode6, the program replaces the location of the plist file created with the Nsuserdefault method, with the following path:/users/username/library/developer/coresimulator/devices/ Emulator under the Udid/data/library,preferences folder.
In particular, if you follow the path that is open in the Finder, it is not, but through the finder, go to the folder, through the path to find it can be found. The path address described above is obtained by looking at the display of the Preferences folder.
Through the above path can be seen through the Nsuserdefault created by the Plist folder or under the library file, but the difference is that the actual location of the change, into the emulator's database folder, such a change in the changes are, When we delete an application in the emulator, the plist file is still preserved and will not be deleted.
So, since the position in the simulator has changed, what is the difference in this respect after the upgrade to IOS8? Let's talk about the difference between debugging in a real machine.
1, organizer, in the XCODE5, is devices, Projects, archives three columns, and in Xcode6, alone will devices took out, became and organizer lateral, in the Xcode menu bar, window. If you know that Xcode upgrade from 4.X to 5 o'clock, you will know, organizer at that time also changed, from the original four columns into three columns, will help to remove the document.
2, in the real machine debugging, will open the real machine application sandbox, to view, in Xcode, open devices application, you can download the application of the sandbox, by right-click to display the contents of the package to view the sandbox information. But there was a difference between iOS8 and iOS7.
For the same application in different systems performance, the left image is iOS8, download down the sandbox content, the right picture is iOS7.0.4, download down the sandbox content, it is clear that in iOS8, through the devices downloaded sandbox content can not view the contents of the sandbox.
We through the third party software, where the use of the Ifunbox, find the application, open discovery can view the contents of the sandbox, copied to the local, found that the original 5 files, only 3, that is, the document folder, library folder, tmp folder three.
In particular, the above mentioned, in the simulator, through the Nsuserdefault automatically created by the plist file, after the removal of the software, will be retained, but in the real machine, it will be deleted, The path to the corresponding plist file is not retained after the application is removed by the Preferences folder under the exported Library folder. This should be considered a difference between a real machine and a simulator.
This difference will cause a situation, if you can also use Nsuserdefault? As far as the author at present, not to discard Nsuserdefault, after all, it is only in the simulator will appear to delete the application of the situation, in the real machine will not, and Nsuserdefault in the development, as data persistence, in the preservation of data, is still very useful. Of course, there are developers will not adapt to this situation, fear in the real machine will appear, if there are developers think not adapt, you can create a plist file in the sandbox, instead, but if the use of Nsuserdefault in the application is more, not recommended, After all, the apple-packaged nsuserdefault is still very useful. After the emulator can delete the file, in the folder to save the plist file, delete the plist file, more than one step, at least for now, in the real machine is still the same as before.
Of course, in iOS, in addition to Nsuserdefault will automatically generate files for data preservation, archiving is the same, because the author did not test, in order to avoid misleading, here does not say, after testing, to summarize the release.

Turn on or off the Mac's hidden files command.
Open mac hidden files command: Defaults write Com.apple.finder appleshowallfiles-bool true
Close Mac hidden files command: Defaults write Com.apple.finder Appleshowallfiles-bool false
Method: In the terminal, enter the command, carriage return, and then in the forced exit, restart the Finder, you can.

XCODE6 Simulator Path Change description

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.