my detox setup is working well for android but I have problems with iOS.
The problem is that the app is stuck on the launch/splash screen after loading the bundle from the metro bundler. Detox is not logging much:
App has not responded to the network requests below:
(id = -1000) isReady: {}
Unresponded network requests might result in timeout errors in Detox tests.
The setup looks like this:
.detoxrc.json
...
"ios.sim.debug": {
"binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/<app_name>.app",
"build": "xcodebuild -workspace ios/<project_name>.xcworkspace -scheme <scheme> -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
"type": "ios.simulator",
"device": {
"type": "iPhone 11 Pro"
}
},
...
e2e/Login.e2e.js
const detox = require('detox');
const config = require('../.detoxrc.json');
describe('Login', () => {
beforeAll(async () => {
await detox.init(config, { launchApp: false });
await device.launchApp({
newInstance: true,
launchArgs: { detoxPrintBusyIdleResources: 'YES' },
permissions: {
notifications: 'YES',
camera: 'YES',
medialibrary: 'YES',
photos: 'YES',
microphone: 'YES',
},
});
});
beforeEach(async () => {
// await device.reloadReactNative();
});
it('should be able to login successfully', async () => {
await element(by.id('EmailInput')).typeText('email\n');
await element(by.id('PasswordInput')).typeText('pass\n');
await element(by.id('LoginButton')).tap();
});
it('should display the welcome screen after the login', async () => {
await expect(element(by.id('WelcomeScreen'))).toBeVisible();
});
});
The command to observe the EarlGrey logs but that is not logging a single character:
xcrun simctl spawn booted log stream --level debug --style compact --predicate "category=='EarlGreyStatistics'"
I am really scratching my head for hours now trying to figure out why the app is stuck and why I am not receiving any logs and would appreciate your help a lot.
Environment:
Machine:
MacOS: 10.15.5
XCode: 11.6
applesimutils: 0.8
Node: 12.18.1
detox-cli: 17.1.0
Project:
"react": "16.11.0",
"react-native": "0.62.1",
"detox": "^17.3.4",
"jest": "^26.2.2",
"jest-circus": "^26.2.2",