Comments (9)
@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.
@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.
@KrauseFx commented |
You can still download localised data from your app, since you can easily detect the locale while running the app.
from fastlane.
@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.
@hanneskaeufler commented |
Did any of you guys manage to replace an empty .sqlite
with a prefilled one for a CoreData
backed app?
from fastlane.
@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.
@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.
@KrauseFx commented |
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.
@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)
- fastlane sigh download_all and "Error parsing provisioning profile at path..."
- fastlane match HOT 4
- bundler: command not found: fastlane
- Individual API Key not supported HOT 3
- fastlane deliver init is not working in CLI
- JEG2/highline should be updated to avoid warning of abbrev missing in standard lib for ruby 3.3.0
- How to get raw exit code from Fastlane HOT 3
- Match import to s3 Crash on encrypting. HOT 2
- Provisioning profile expiration comparison compares Time and DateTime
- AvailableTerritories is deprecated and fastlane is not upgraded to new api endpoints HOT 5
- Match managing provisioning profiles for DriverKit HOT 1
- curb-1.0.0/lib/curl/easy.rb - Failed to read/open file HOT 1
- `match` behaves differently in v2.220.0: `wrong final block length` HOT 14
- Can't upload build to Test Flight; [!] undefined method `refresh!' HOT 2
- A parameter has an invalid value - 'prices' is not a valid relationship name HOT 12
- I run the command 'fastlane match development'. and i got the following error: Looking for related GitHub issues on fastlane/fastlane... Found no similar issues. To create a new issue, please visit: https://github.com/fastlane/fastlane/issues/new Run fastlane env to append the fastlane environment to your issue [!] The request could not be completed because: This request is forbidden for security reasons - You currently don't have access to this membership resource. Contact your team's Account Holder, or an Admin.
- Build_for_testing fails sporadically with error 'Could not find or use auto-linked framework' HOT 2
- Can fastlane support filling in China’s ICP registration number?
- [match] provisioning profile generated via match blocks release installation on TestFlight (or on device) HOT 1
- if and switch expressions Swift HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastlane.