Open onmyway133 opened 6 years ago
I can't seem to get this to work in Xcode 9.4.1.. Am I missing something here?
@onmyway133 My AppDelegate is in ObjC, so I'm not sure what I'd do:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSURL *jsCodeLocation;
#ifdef DEBUG
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; // works in both simulator AND connected phone on network via IP
#else
jsCodeLocation = [CodePush bundleURL];
#endif
//jsCodeLocation = [CodePush bundleURL];
// jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"Pushkah"
initialProperties:nil
launchOptions:launchOptions];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
if ([[[NSProcessInfo processInfo] arguments] containsObject:@"--UITests"]) {
// DISABLE SOMEHOW?
} else {
printf("oops, animtions STILL GOING!!!!!!!!!!!!! =(");
}
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
return YES;
}
Today I was writing tests and get this error related to
app idle
It turns out that the project uses a HUD that is performing some progress animation. Even it was being called
HUD.hide()
, the problem still exists.No matter how I call
sleep,
wait`, still the problemThe fix is to disable animation. Start with setting argument when running tests
Then in
AppDelegate