Unit testing on actual device

已回答

I can't select my attached device for testing (NOT running/debugging the app itself - just testing). I see iOS Device only, not any of my actual devices.

 

When I try to run tests with "iOS Device" selected, it builds and then gives me the error "Error running 'AudioSpec': iOS Device is not selected". Very unintuitive!

 

I've looked at all config options in "Edit configurations..." for XCTest template. 

0

Please check that the iOS target device in the build settings of your project is compatible with the actual device that you are using. Also, makes sense to check the Xcode version selected in AppCode's preferences.

0
Avatar
Permanently deleted user

Xcode version is 10.1. My devices are running different iOS versions, while 'Base SDK' setting in AppCode is 12.1, higher than either of my devices - so why does the app run and debug fine with target devices having lower version numbers but not unit testing on the same devices?

0

The target for your app and the target for the unit tests can have different build settings. Base SDK does not affect the ability to launch the target on the device, but the "iOS Deployment Target" does. Please check, that it's the same for both targets.

0
Avatar
Permanently deleted user

Thank you for the explanation. I can successfully run unit tests on my devices now. Have a great day!

 

 

0
Avatar
Permanently deleted user

I have the same issue but running an app on my device. iOS 12.2, device is iPhone XS and AppCode version 2019.1.

Where in build settings is the setting "iOS target device" - I am looking through build settings for the project and I can't find that setting to change. Closest i found is called IPHONEOS_DEPLOYMENT_TARGET which doesn't help when I change it.

0

请先登录再写评论。