google / google/EarlGrey

earlgrey-2: Application crashes in simulator when not launched from XCode

Open
#1,635 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Objective-C
Stars
5.7k
Forks
737
Avg merge
1d 20h
Merged PRs (30d)
5

Description

Hi,

Post integration of Earlgrey 2 into an app, i've noticed the app crashes when not launched via XCode, even if the prior launch through XCode was succesful(both if prior launch is directly through the app scheme or through ui tests scheme).

This is the crash log i was able to capture post the crash..

```
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY

Application Specific Information:
abort() called
CoreSimulator 772.1 - Device: iPhone 12 (****) - Runtime: iOS 14.5 (18E182) - DeviceType: iPhone 12

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff6030992e __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff603435bd pthread_kill + 263
2 libsystem_c.dylib 0x00007fff200fbcb5 abort + 120
3 com.google.earlgrey.AppFramework 0x0000000103ccfa9c +[GREYHostApplicationDistantObject testPort] + 204
4 com.google.earlgrey.AppFramework 0x0000000103cd599e -[GREYAppConfiguration init] + 366
5 com.google.earlgrey.AppFramework 0x0000000103cd5823 GREYCreateConfiguration + 35
6 com.google.earlgrey.AppFramework 0x0000000103d2bdb5 __40+[GREYConfiguration sharedConfiguration]_block_invoke + 21
7 libdispatch.dylib 0x00007fff201078df _dispatch_client_callout + 8
8 libdispatch.dylib 0x00007fff20108b16 _dispatch_once_callout + 20
9 com.google.earlgrey.AppFramework 0x0000000103d2bd74 +[GREYConfiguration sharedConfiguration] + 84
10 com.google.earlgrey.AppFramework 0x0000000103ca6853 -[NSObject(GREYApp) greyswizzled_performSelector:withObject:afterDelay:inModes:] + 227
11 com.apple.UIKitCore 0x00007fff23acaf37 -[UIApplication(UIKitApplicationAccessibility) _accessibilityInit] + 83
12 com.apple.UIKitCore 0x00007fff23aca516 _UIAccessibilityInitialize + 34
13 com.apple.UIKitCore 0x00007fff246c1171 -[UIApplication _run] + 34
14 com.apple.UIKitCore 0x00007fff246c639c UIApplicationMain + 101
15 com.salesforce.internal.kona 0x0000000101a9297d main + 125 (main.m:18)
16 libdyld.dylib 0x00007fff2025abbd start + 1
```

Is there a way to prevent this from happening?

Contributor guide

Open the contributing guide

Research direction

Start with the crash path through +[GREYHostApplicationDistantObject testPort], -[GREYAppConfiguration init], and GREYCreateConfiguration, then reproduce the simulator launch outside Xcode using the reported setup. Check the behavior around main.m:18 and compare launches from the app and UI test schemes. Done means the integrated app no longer aborts when launched outside Xcode.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, objective-c
Domain
mobile, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.