objective c - Testing without simulator using xctool -


i'm trying run unit tests without simulator using xctool. set 'host application' none in test target's general tab, following directions this comment .

when run xctool -project myproject.xcodeproj/ -scheme myproject test error.

<unknown>:0: failed: caught "nsinvalidargumentexception", "could not find storyboard named 'main' in bundle nsbundle  </applications/xcode.app/contents/developer/platforms/iphonesimulator.platform/ developer/sdks/iphonesimulator9.2.sdk/developer/usr/bin> (loaded)" 

i made sure main.storyboard member of test target. why happening , how can fix it?

figured out, this post helped.

my test case set method initialized storyboard this

uistoryboard *storyboard = [uistoryboard storyboardwithname:devmainstoryboardname  bundle:nil]; 

problem passing nil bundle parameter, uses main bundle not used in test target -- have specify want use test bundle writing

uistoryboard *storyboard = [uistoryboard storyboardwithname:devmainstoryboardname  bundle:[nsbundle bundleforclass:[self class]]]; 

then don't forget include storyboard member of target.


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -