Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove test frameworks in Frameworks and add device local references as rpath for real devices #780

Merged
merged 10 commits into from
Sep 25, 2023

Conversation

KazuCocoa
Copy link
Member

@KazuCocoa KazuCocoa commented Sep 24, 2023

it seems like packages built with Xcode 14.5 do not work on iOS 17 real devices as XCTest framework's internal changes. The app process crashed then. Xcode 15 build with embedded test frameworks, or below method with Xcode 14.5 works.

Then, once we remove test packages in WebDriverAgentRunner-Runner.app/Frameworks work. It seems like test packages refer to the system local's one then instead of the embedded ones. It makes sense to keep referencing the device local's XCTest framework for real devices. For tvOS, the removal was not necessary. It seems like we should add the device local references as rpath. iOS is not necessary in my testing, but lets add the same to reduce diffs.

Thus, this pr:

  • remove Frameworks for real devices
  • use Xcode 15.0 in building packages <= no matched Xcode found error came by GH. will do something as another pr if needed
  • Add device local references

I have tested iOS 14, 15, 16 and 17 and tvOS 16 with https://github.com/appium/WebDriverAgent/actions/runs/6291729735 , or locally built with Xcode 14.3.1 packages (as the same, they do not have XCTest frameworks' references), thus it should be ok...


Additional node:

Initially I thought #775 was necessary, but seems not for iPhone. Probably this is because the below option in Xcode could be related. The value is resolved as YES so let me explicitly set it as YES as well.

Screenshot 2023-09-24 at 10 31 01 AM

[Update]
It seems like the system references are necessary for TVs. I guess iOS take care about some references automatically probably for historical reasons? so maybe not necessary to add system references explicitly.

@KazuCocoa KazuCocoa changed the title ci: use xcode 15 ci: use xcode 15 and remove test frameworks in Frameworks for real devices Sep 24, 2023
@KazuCocoa KazuCocoa marked this pull request as draft September 24, 2023 09:06
@KazuCocoa KazuCocoa changed the title ci: use xcode 15 and remove test frameworks in Frameworks for real devices ci: remove test frameworks in Frameworks for real devices Sep 24, 2023
@@ -2414,7 +2414,6 @@
641EE6C02240C5CA00173FCB /* XCUIApplication+FBHelpers.h in Headers */,
641EE6C12240C5CA00173FCB /* _XCTestObservationCenterImplementation.h in Headers */,
714EAA0E2673FDFE005C5B47 /* FBCapabilities.h in Headers */,
716F0DA22A16CA1000CDD977 /* NSDictionary+FBUtf8SafeDictionary.h in Headers */,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems like Xcode generated this diff automatically...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed this file is not built in tvOS, so added it in tvOS as well

@KazuCocoa KazuCocoa changed the title ci: remove test frameworks in Frameworks for real devices ci: remove test frameworks in Frameworks for real devices, add device local references as rpath Sep 24, 2023
@KazuCocoa KazuCocoa marked this pull request as ready for review September 24, 2023 19:15
@KazuCocoa KazuCocoa changed the title ci: remove test frameworks in Frameworks for real devices, add device local references as rpath feat: remove test frameworks in Frameworks for real devices, add device local references as rpath Sep 24, 2023
@KazuCocoa KazuCocoa changed the title feat: remove test frameworks in Frameworks for real devices, add device local references as rpath feat: remove test frameworks in Frameworks and add device local references as rpath for real devices Sep 24, 2023
@KazuCocoa
Copy link
Member Author

CI is green right now

GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = WebDriverAgentRunner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
/System/Developer/Library/Frameworks,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if these paths are not accessible?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing happens. I mean just do not search under this path in my current research

@KazuCocoa KazuCocoa merged commit ae6c842 into master Sep 25, 2023
45 checks passed
@KazuCocoa KazuCocoa deleted the xcode-15 branch September 25, 2023 23:52
github-actions bot pushed a commit that referenced this pull request Sep 25, 2023
## [5.10.0](v5.9.1...v5.10.0) (2023-09-25)

### Features

* remove test frameworks in Frameworks and add device local references as rpath for real devices ([#780](#780)) ([ae6c842](ae6c842))
@github-actions
Copy link

🎉 This PR is included in version 5.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants