Xcode6 simulator path, xcode6 simulator path
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.
How to add an iOS6 simulator to xcode6
The corresponding SDK is required for Simulators of different versions. If you want to install an IOS6 simulator, you must have an IOS6 SDK. Xcode6 does not support IOS6. But there are also # solutions #. Your next Xcode5, two simulators can be installed on your computer at the same time, and Xcode5 is enabled when iOS6 is required. Here is a detail. If you feel that Xcode5 is slow to download, and if you used a Time Machine backup on Mac, you can click Xcode6 and select a time machine to restore Xcode6, at that time, you will be asked to replace and retain the two, and choose to retain the two, so you can coexist Xcode6 and Xcode5! There is also a detail. When Xcode5 exists, its name is displayed as Xcode5 (original). After the upgrade, Xcode will replace both Xcode5 (original) and Xcode6. Once Xcode is upgraded, xcode5 (original) will disappear! So in the future, if you want to add Xcode5 again, you still have to perform the response operation! This is my answer. It is not copied or pasted on the Internet. I hope my answer will be helpful to you. If you feel helpful, click the "adoption" button, your adoption is an encouragement for me to continue answering questions !!
Why is the sdk missing in the xcode6 beta5 simulator?
You can use the latest and the next version to represent the SDK, but you can run the simulator to check whether the running program is normal. You can download the document only from the Components tab.