google / EarlGrey

:tea: iOS UI Automation Test Framework
http://google.github.io/EarlGrey/
Apache License 2.0
5.61k stars 740 forks source link

Host background port not assigned #1678

Closed ileon12 closed 2 years ago

ileon12 commented 2 years ago

I cloned EarlGrey project to my machine and pointed my Podfile to the local development path:

workspace 'TestWorkspace.xcworkspace'
project 'TestProject/TestProject.xcodeproj/'
platform :ios, '15.0'
use_frameworks!

target 'TestProject' do
  pod 'EarlGreyApp', path: '/Users/{my_username}/test_dir/EarlGrey'
end
target 'TestProjectUITests' do
  pod 'EarlGreyTest', path: '/Users/{my_username}/test_dir/EarlGrey'
end

After doing the installation and successfully compiling the project, when I try to use EarlGrey to tap on a view with:

EarlGrey.selectElement(with: grey_accessibilityID(viewId!))
            .perform(grey_tap())

I get the following error:

Fatal failure: Host background port not assigned. Application under test may have failed to launch and/or does not link to EarlGrey's AppFramework. in /Users/{my_username}/test_dir/EarlGrey/TestLib/DistantObject/GREYTestApplicationDistantObject.m:245
dyld4 config: DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libMainThreadChecker.dylib

Am I missing something?

tirodkar commented 2 years ago

What's your Xcode / MacOS version? Did the app launch at all before crashing?

ileon12 commented 2 years ago

What's your Xcode / MacOS version? Did the app launch at all before crashing?

@tirodkar Xcode 13 and MacOS Big Sur 11.6.1. Yes, the app did launch before crashing, it is only after I attempt to tap on a view that I get the "Host background port not assigned" error.