Linker Error In UI Test Target | Apple Developer Forums

  • Apple Developer
  • Apple Developer
Forums Search for a topic, subtopic, or tag Clear search query Local Nav Open Menu Local Nav Close Menu
  • Search
Post Profile
  • Sign in
  • Create account
Linker error in UI Test Target Programming Languages Swift Swift You’re now watching this thread. If you’ve opted in to email or web notifications, you’ll be notified when there’s activity. Click again to stop watching or visit your profile to manage watched threads and notifications. You’ve stopped watching this thread and will no longer receive emails or web notifications when there’s activity. Click again to start watching. hemangadas OP Created Sep ’15 Replies 7 Boosts 0 Views 14k Participants 8

I am using XCode 7.1 Beta to develop an app in Swift 2.0. I am trying to access a few classes in the app (e.g. AppDelegate) from the UI Test class. I have enabled testability in the build settings for the app and added this line in the test class:

@testable import MyApp

I am accessing the AppDelegate like this:

override func tearDown() { super.tearDown() let delegate : AppDelegate = UIApplication.sharedApplication().delegate as! AppDelegate delegate.myFunc() }

However, I am running into a linker error:

Undefined symbols for architecture x86_64: "type metadata accessor for MyApp.AppDelegate", referenced from: MyAppUITests.MyAppUITest.tearDown (MyAppUITests.MyAppBasicUITest)() -> () in MyAppBasicUITest.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Same error when I access any other class in the app. Any idea how to access classes in the app from the test app ? Is it supported ?

Boost Copy to clipboard Share this post Copied to Clipboard Replies 7 Boosts 0 Views 14k Participants 8 ziogaschr OP Oct ’15

I have the same issue and I can't find a solution. Have you figured out a way on solving it?

0 comments 0 Copy to clipboard Share this post Copied to Clipboard Load more Add comment regosen OP Oct ’15

I got around this by copying build settings for "Linking->Bundle Loader" and "Testing->Test Host" from what I had in my Unit Test target

That being said, I now get a SIGKILL at [[[XCUIApplication alloc] init] launch];

0 comments 0 Copy to clipboard Share this post Copied to Clipboard Load more Add comment johanisma OP Nov ’15

Running into the same problem. Any ideas that doesn't lead to a SIGKILL 😝 ?

0 comments 0 Copy to clipboard Share this post Copied to Clipboard Load more Add comment tom139 OP Dec ’15

I've got the same problem too…

0 comments 0 Copy to clipboard Share this post Copied to Clipboard Load more Add comment giuseppe.morana.funambol OP Jan ’16

Same problem here...

0 comments 0 Copy to clipboard Share this post Copied to Clipboard Load more Add comment Anton Plebanovich OP Mar ’16

I found solution. Somehow my host aplication falled off: http://prntscr.com/af81si

After i returned it back and checked "Allow testing Host Application APIs" everything started to work again: http://prntscr.com/af82d5

0 comments 0 Copy to clipboard Share this post Copied to Clipboard Load more Add comment philipp.otto OP Jun ’17

I think this one is answered here.

https://stackoverflow.com/questions/33755019/linker-error-when-accessing-application-module-in-ui-tests-in-xcode-7-1

It seems @testable import is only intended for UITests. I still encounter this problem with XCode9 and the only solution seems to be to add the classes that you need to the UITesting target.

0 comments 0 Copy to clipboard Share this post Copied to Clipboard Load more Add comment Linker error in UI Test Target First post date Last post date Q

Tag » Architecture Type X86_64