Advanced users might need to natively debug their app inside Xcode during a Detox test. This is mostly useful for invesigating weird crahses or when contributing to Detox itself.
This workflow isn't standard. Don't use it unless you have a good reason.
Open your Xcode project and drag Detox.framework
from node_modules/detox/Detox.framework
to your project.
NOTE: Apps should not be submitted to the App Store with the Detox framework linked. Follow this guide only to debug Detox issues in your project. Once finished, make sure to remove
Detox.framework
from your project.
Edit your project scheme and add the following arguments to Arguments Passed On Launch:
-detoxServer
ws://localhost:8099
-detoxSessionId
test
Edit Detox config in package.json
to add a custom session by adding the session
key under the detox
section:
"detox": {
"session": {
"server": "ws://localhost:8099",
"sessionId": "test"
}
}
Edit Detox config in package.json
by adding a new configuration with type ios.none
to the configurations
key under the detox
section:
"detox": {
"configurations": {
"xcode": {
"type": "ios.none"
}
}
}
NOTE: This configuration will not handle simulator and application lifecycle, they will have to be provided manually (via Xcode "Play" button or
react-native run-ios
).
Type the following inside your project root:
detox run-server
Type the following inside your project root:
detox test --configuration xcode
NOTE: Tests that expect the app to be restarted via
device.relaunchApp()
will fail.