Giter VIP home page Giter VIP logo

Comments (9)

fastlanebot avatar fastlanebot commented on May 4, 2024
@KrauseFx commented

That's a good question. You could help me with this:

Put something inside the /tmp/snapshot/build/[AppName].app by right clicking there and click on Show package content.
You'd have to do this after building is finished and the tests are already running.

from fastlane.

fastlanebot avatar fastlanebot commented on May 4, 2024
@muZZkat commented

For now, I added a empty Documents.zip file to the project target and wrote a script that uses curl to download different Document.zip files from the web and replaces the empty Documents.zip file in the project just before it starts the build. (I didn't want my 35MB sample database to be in my git repo)

I'm interested in testing out injecting it into the .app after build as this will allow me to use localised workout data for different regions (eg. a Run in Japan or a Bike in London.

Thanks for the great tool!

from fastlane.

fastlanebot avatar fastlanebot commented on May 4, 2024
@KrauseFx commented

You can still download localised data from your app, since you can easily detect the locale while running the app.

from fastlane.

fastlanebot avatar fastlanebot commented on May 4, 2024
@KrauseFx commented

I just successfully integrated it - in your Snapfile do the following:

folder_name = "ExampleDocuments"

setup_for_language_change do |lang, device|
  puts "Copying example files to .app"

  app_path = "/tmp/snapshot/build/app_name.app/"

  FileUtils.mkdir_p(File.join(app_path, folder_name))

  Dir.glob(File.join(example_files, '*')).each do |example_path|
    FileUtils.cp_r(example_path, File.join(app_path, folder_name)) rescue nil # in case the file already exists
  end
end

from fastlane.

fastlanebot avatar fastlanebot commented on May 4, 2024
@hanneskaeufler commented

Did any of you guys manage to replace an empty .sqlite with a prefilled one for a CoreData backed app?

from fastlane.

fastlanebot avatar fastlanebot commented on May 4, 2024
@buscarini commented

I think the documentation is quite lacking in this regard. It took me a long time to get this working. The current example could use some data from the Documents folder, and use this hook to populate it for screenshots.

Anyway, in case someone needs help: I used the script in the previous comment, putting it into "test_data", and then I did this in my app delegate did finish launching:

#ifdef SNAPSHOT
    [[SDStatusBarManager sharedInstance] enableOverrides];

    NSError *error = nil;
    NSURL *url = [[NSBundle mainBundle] URLForResource:@"test_data" withExtension:nil];
    NSArray *fileUrls = [[NSFileManager defaultManager] contentsOfDirectoryAtURL:url includingPropertiesForKeys:nil options:0 error:nil];
NSString *docsPath = [BMFUtils applicationDocumentsDirectory];
for (NSURL *fileUrl in fileUrls) {
    NSURL *finalUrl = [NSURL fileURLWithPath:[docsPath stringByAppendingPathComponent:fileUrl.lastPathComponent]];
    if (![[NSFileManager defaultManager] copyItemAtURL:fileUrl toURL:finalUrl error:&error]) {
        DDLogError(@"Error copying test data: %@",error);
    }
}
#endif

I think this should work for Core Data databases too.

from fastlane.

fastlanebot avatar fastlanebot commented on May 4, 2024
@hanneskaeufler commented

Interesting, I was messing with xcappdata packages lately (I use a seperate Scheme for snapshot), which is a dead end because xcappdata loading is currently broken in XCode 6.3 http://stackoverflow.com/questions/29717611/xcode-is-not-loading-the-xcappdata-into-the-app

from fastlane.

fastlanebot avatar fastlanebot commented on May 4, 2024
@KrauseFx commented

@buscarini @hanneskaeufler

Take a look at how MindNode implements the Snapfile.

How could I improve the documentation? With more sample code and how it works?

from fastlane.

fastlanebot avatar fastlanebot commented on May 4, 2024
@hanneskaeufler commented

I want to avoid having any CoreData importing code in the app, as I really don´t need it otherwise. xcappdata would be perfect for the snapshot Scheme imho.

Sure, maybe linking to the mind node example here could help. https://github.com/KrauseFx/snapshot#custom-callbacks-to-prepare-your-app

I was a little disappointed to see ./prepareDatabase.sh and then not find any documentation about actually preparing a (sqlite/coredata) database to be honest.

from fastlane.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.