google / EarlGrey

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

Host background port not assigned. Application under test may have failed to launch #1341

Open Sundea opened 4 years ago

Sundea commented 4 years ago

Xcode 11.5. iOS 13.5. iPhone Xs

I have installed EarlGrey 2.0 using Cocoapods. But it's doesn't work. When I started test run have an error "Host background port not assigned. Application under test may have failed to launch" And such strings in host app logs: dyld: warning: could not load inserted library '@executable_path/Frameworks/AppFramework.framework/AppFramework' into hardened process because no suitable image found. Did find: /private/var/containers/Bundle/Application/0C66B96A-8CB4-42F2-A1E7-43B7EABF3B08/Performance.app/Frameworks/AppFramework.framework/AppFramework: no matching architecture in universal wrapper /private/var/containers/Bundle/Application/0C66B96A-8CB4-42F2-A1E7-43B7EABF3B08/Performance.app/Frameworks/AppFramework.framework/AppFramework: no matching architecture in universal wrapper

khandpur commented 4 years ago

Can you check DividePerformance.app bundle and make sure AppFramework is present there? Also can you paste the result of file command on these two binaries? I'd like to see what all architectures they're built. for:

file DividePerformance.app/DividePerformance and file DividePerformance.app/Frameworks/AppFramework.framework/AppFramework

tirodkar commented 4 years ago

For installing - has EarlGreyApp been added to the application process as well?

Sundea commented 4 years ago

Can you check DividePerformance.app bundle and make sure AppFramework is present there? Also can you paste the result of file command on these two binaries? I'd like to see what all architectures they're built. for:

file DividePerformance.app/DividePerformance and file DividePerformance.app/Frameworks/AppFramework.framework/AppFramework

How I can check that AppFramework is present there?

khandpur commented 4 years ago

You go into the BUILT_PRODUCTS_DIR folder where Xcode put the final artifact, cd into it and run the two commands.

Sundea commented 4 years ago

You go into the BUILT_PRODUCTS_DIR folder where Xcode put the final artifact, cd into it and run the two commands.

.../Library/Developer/Xcode/DerivedData/Divide-dxzaigfxtxvhgsaamojkalkazgsm/Build/Products/Debug-iphoneos/DividePerformance.app/Frameworks/AppFramework.framework/AppFramework: Mach-O universal binary with 2 architectures: [i386:Mach-O dynamically linked shared library i386] [x86_64] .../Library/Developer/Xcode/DerivedData/Divide-dxzaigfxtxvhgsaamojkalkazgsm/Build/Products/Debug-iphoneos/DividePerformance.app/Frameworks/AppFramework.framework/AppFramework (for architecture i386): Mach-O dynamically linked shared library i386 .../Library/Developer/Xcode/DerivedData/Divide-dxzaigfxtxvhgsaamojkalkazgsm/Build/Products/Debug-iphoneos/DividePerformance.app/Frameworks/AppFramework.framework/AppFramework (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64

.../Library/Developer/Xcode/DerivedData/Divide-dxzaigfxtxvhgsaamojkalkazgsm/Build/Products/Debug-iphoneos/DividePerformance.app/DividePerformance: Mach-O 64-bit executable arm64

Sundea commented 4 years ago

For installing - has EarlGreyApp been added to the application process as well?

It was added as a pod to proper target.

tirodkar commented 4 years ago

no matching architecture in universal wrapper are you running this on a device with architecture armv7e or so?

Sundea commented 4 years ago

no matching architecture in universal wrapper are you running this on a device with architecture armv7e or so?

The device is iPhone XS, arm64e as I know

tirodkar commented 4 years ago

Correction - yes I meant arm64e. In the current CocoaPods release for EG 2, we haven't added arm64e. This will be fixed in the next CocoaPods EarlGrey 2.0 release which will happen soon.

EarlGreyApp/AppFramework.framework/AppFramework: Mach-O universal binary with 4 architectures: [i386:Mach-O dynamically linked shared library i386] [x86_64] [arm_v7] [arm64]
EarlGreyApp/AppFramework.framework/AppFramework (for architecture i386):    Mach-O dynamically linked shared library i386
EarlGreyApp/AppFramework.framework/AppFramework (for architecture x86_64):  Mach-O 64-bit dynamically linked shared library x86_64
EarlGreyApp/AppFramework.framework/AppFramework (for architecture armv7):   Mach-O dynamically linked shared library arm_v7
EarlGreyApp/AppFramework.framework/AppFramework (for architecture arm64):   Mach-O 64-bit dynamically linked shared library arm64