28

I want to preload the app in the simulator with a set of data (a core data app) downloaded from my iPhone 5s. The steps I took were:

  1. Run the app on my device connected to Xcode
  2. Download my data through the devices panel.
  3. Name the .xcappdata "simple.xcappdata" and pulled it into my Xcode project
  4. Select "simple.xcappdata" as the Application Data in the scheme I´m running
  5. Running the app, I have no data in the list view.

The steps I took are outline here: http://corporationunknown.com/blog/2014/07/10/preloading-development-data-into-your-ios-app/

Is this a known bug in Xcode, am I doing something wrong, missing something?

I verified that the .xcappdata contains entries in the sqlite database. I´m running Version 6.3 (6D570) of XCode. iOS 8.3 SDK. The app is in the store, so I know the list view and core data stack to be working.

Scheme

picciano
  • 22,341
  • 9
  • 69
  • 82
user1777136
  • 1,746
  • 14
  • 28
  • Can I suggest a different approach? If the only reason you want to preload the app in simulator is to have the core data sql file from iphone5s, you can bundle it in app and then when the app starts just copy it to the normal location. – pteofil Apr 28 '15 at 09:58
  • I want to avoid this, because none of that needs to be deployed to the AppStore. This is only about automated tests and screenshots. – user1777136 Apr 28 '15 at 12:44

2 Answers2

7

It seems to be a bug in Xcode 6.

The person writing to blog that you used as reference updated the blog with this:

Update 2015-04-20: This worked great in Xcode 5. Unfortunately Xcode 6 (through 6.3 as of this writing) does not behave as described for the Simulator (it does load a device just fine). Versions <6.3 will tell you “The application data package will be installed the next time you run your app in the Simulator”—every time. Version 6.3 will just silently fail to load the package. I have reported this as rdar://20622011 / Open Radar

pteofil
  • 4,133
  • 17
  • 27
2

I don't know if it is a bug, but it works on the device (I am using Xcode 6.4). In the simulator, there is no error message nor message indicating it works only on device.

onekiloparsec
  • 2,013
  • 21
  • 32