While i'm learning automation tools, Fastlane is very impressive and ideal to help each other task than regular way, i'm started with create app screenshot by Fastlane but this thread in not focus on how to do that bcoz the official was written good to go here. This thread will fix thing that i found an error of setting with React-Native. You can adapt to Native also.
When you follow up the setting Fastlane version 2.123.0 with React-Native it's not gonna be like Native 100% something need to understanding i will write down one-by-one. When you try to create screenshot and struggle you can back to check from my reason here.
- fastlane init : this command if you using under root project directory, it cause of an error not found iOS project, so this mean to be using fastlane init under each platform project ios and android directory one-by-one. If you've using under root project, this gonna be happen to you.

- short description : for me it's not good at all, who newbie will fall in trouble, you'll lose time without benefits. Look below and answer your self, is this clear enough for follow up. And DON'T PRESS ENTER.

- for iOS 1) UI Testing Bundle : open file.xcodeproj, i'm using Xcode (10.2.1), goto menu File > New > Target... and choose as below image and Next

- for iOS Target : React-Native (iOS) is base on "Objective-C" not "Swift" the problem is you can't use swift in objective-c, so just pickup Language for "Objective-C" and make sure your target is main app target. We wan to use UI Testing Bundle to capture UI Main Target.

- for iOS Scheme : goto menu Product > Scheme > New Scheme... and pickup like below, the UI Testing need to know how to proceed by using Scheme to telling it.

- for iOS Edit Scheme : extra stuff after create new Scheme, you need to config and make sure about Scheme doing right process, 1. Parallelize Build - unchecked , 2. Run - checked, 3. Shared - checked See below. Then close.

- for iOS 2) SnapshotHelper.swift : as i mention about React-Native (iOS) base on "Objective-C" so helper with "Swift" need to do extra stuff, drag SnapshotHelper.swift over area of panel scope of yourprojectUITests and release. Then choose like below and click Finish.

choose "Create Bridging Header"
- for iOS Terminal Enter : now you can enter from terminal that waiting your action long time, Enter until end up.
- for iOS Header : check header by click root project goto Build Settings, click under TARGET projectUITests, search by keyword 'swift' and check name as below image. You need "projectUITests-Swift.h" using next extra stuff.

- for iOS Import : import swift to objective-c, it's confusing in mind but do it as below image. Open projectUITests.m, at the top of file import header swift file and you'll get an error "projectUITests-Swift.h" file not found.

- for iOS Re-Import : remove SnapshotHelper.swift by right-click on file and choose delete, then choose "Remove Reference". And drag SnapshotHelper.swift to same place again, repeat from 2) once again. It's very slow to sync new reference.

wait a while then do next step (don't curious if it's still error file not found, it gonna be fixing after you do next step and xcode will be sync up), file not found error gone.
- for iOS Comment Out : back to project projectUITests.m and comment function "setUp" till "tearDown".

- for iOS Add Snapshot Process : then adding snapshot launcher base on "Objective-C" and other detail you can follow up like official manual of Native iOS.

- for iOS End
I wonder why it's too long again, LOL, i thought it will be short thread but at last it's huge again, i hope who founded issue like me can using this extra stuff to fix Fastlane with React-Native iOS Snapshot working like a charm. Hope you enjoy and see ya next thread :)
No Like, No Thumbs Up, No Bell, Just support me by click ads, thank you...
No Like, No Thumbs Up, No Bell, Just support me by click ads, thank you...

Comments
Post a Comment