// tap photo auth entrance
XCUIElement *collectionView = app.collectionViews.firstMatch;
XCUIElement *authCell = [collectionView.cells elementBoundByIndex:2];
[authCell tap];
// springboard click allow
XCUIApplication *springboard = [[XCUIApplication alloc] initWithBundleIdentifier:@"com.apple.springboard"];
XCUIElement *button = [[springboard.alerts.firstMatch buttons] elementBoundByIndex:1];
BOOL exist = [button waitForExistenceWithTimeout:5];
XCTAssertEqual(exist, YES, @"photo auth alert not exist");
[button tap];
It works fine on my iphone12(iOS15.4), but it not works on another iphone12-Pro(iOS15.4)
error: *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil (NSInvalidArgumentException)
How should I solve this problem? Thanks a lot!