Xcode 6.3: Cannot use xcappdata package in simulator

Number:rdar://20622011 Date Originated:20-Apr-2015 01:40 PM
Status:Duplicate/18050217 Resolved:28-Apr-2015 01:17 PM
Product:Developer Tools Product Version:6.3 (6D570)
Classification:Other Bugs Reproducible:Always
Prior to Xcode 6, we could extract an xcappdata package from a device and use it in either a device or simulator to prepopulate data. This was useful for stress/scale testing, migration testing, or reproducing pathological cases. I described its use in a blog post here: http://corporationunknown.com/blog/2014/07/10/preloading-development-data-into-your-ios-app/

In Xcode 6, the ability to use the package on a simulator broke (possibly due to the simulator disk directory rearrangement?) and would repeatedly post an alert saying the data couldn't be loaded, but will on next launch of the app in the simulator. Unfortunately, relaunching would simply present the same alert, again and again.

Now in Xcode 6.3, it doesn't even seem to try. The xcappdata package is not installed in the simulator, and no alert is presented. It just silently fails.

Steps to Reproduce:
1. Create a new project using the “Master-Detail Application” template that uses Core Data.
2. Run the application on a device.
3. Add 5 items.
4. You may stop running the application on your device—the following steps aren’t affected by it running or not.
5. Open the Xcode Organizer, select the “Applications” section of your device under the Devices tab.
6. Select your test application. You should see a bunch of folders and files populate the “Data files in Sandbox”. (This may not populate right away, so be patient.)
7. Click the “Download” button at the bottom and save the xcappdata package to your Desktop, giving it a descriptive name like 'v0 - 5 items.xcappdata'.
8. Click “Delete” to remove the application from the device—we will try to start with a clean install for the next steps.
9. Create a new Group in your project. I name mine “Test Data”.
10. Add v0 - 5 items.xcappdata to the group.
11. Select “Copy items into group folder”.
12. Do not add it to any targets.
13. Launch the app while holding the Option key—either Option-clicking the Run button, or Option-Command-R. A scheme configuration sheet will appear.
14. In the Options tab, select v0 - 5 items.xcappdata from the Application Data menu and click “Run”.

Expected Results:
The app would launch with 5 records pre-installed, based on the xcappdata package.

Actual Results:
The app always launches fresh.

Xcode 6.3 (6D570), OS X 10.10.3 (14D136)

A similar report is known to have been filed as rdar://20621826


'AppDataTest.zip' was successfully uploaded.


Same issue with Xcode 7.3 beta

Still doesn't work on Xcode 7.2

By jacob.wallstrom at Dec. 17, 2015, 8:32 a.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!