Is there any way to keep state between restarting detox - react-native

i have the authorization in the app and i need to check the screens after sign in. Is there any way to do it?

Every detox runs, it will reinstall the app. So if you want to continue testing the app without reinstall every runs, you can add --reuse flag on detox command. It will reuse installed app on your test device/simulator. You can read more about this on Detox documentation here.

Related

How to stop local app that was ran with 'npm run dev' command

I'm working on a React app in VSCode that's running on localhost:3000. I can visit the app in the browser. If I try to do ctrl+c in the terminal, an empty line is written but the app is still accessible. I need to close the app for some changes I'm planning to make. What's the best way to do this?

Use Expo Metro Bundler instead of react-native start

currently I'm migrating my react native app to expo bare workflow. Everything it's been fine so far, except for the following.
This may seem like a noob mistake, but I'm unable to use the Metro Bundler from Expo when I run my app from Xcode. Before, I could run from Xcode and the simulator would appear in the Metro Bundler with all it's logs, that was very useful.
I've been searching this for a couple days and the closest thing I've found to what I want, is using expo build:ios. The problem, it pops up a warning saying that if I'm not sure what I'm doing it's best to leave it as it is. It's a big application so I'm worried it might lead to errors, therefore I didn't do it.
If anyone knows for sure if this command is what I'm looking for, or has a better suggestion, it would be much appreciated. Thank you.
[EDIT]
To be more specific, I don't mean using the Expo Go app. I mean a standalone app (I'm not sure if this is the correct term for it). Thank you!!
expo build:ios is used for building an app bundle for your application. This is used when you want to publish your application on the store and that is why it asks for credentials of developer account on the iOS.
If you just want to run your app and check then you should use expo start. This will start the Metro Bundler for you and then you can run your application on your device scanning the QR code that would appear there.

Need to restart computer when developping

I try to make apps in react native (not with expo, I created my code with react-native init and run with react-native run-android) and when I make changes in the code they are not always taken into account : to take them into account I have to restart computer.
I have to do it several times a day, it is time consuming. I have tested to remove to app tested from the device, to make yarn cache clean, but it doesn't work, the only thing that works is to restart (I am using a Mac if it makes a difference).
Is there a command I can make to reset a cache that I don't know and save previous state of my app ?
You may have a caching issue, try the cache clearing solutions in this link
How to clear react-native cache?
And also, you may want to try the Hot Reloading or Live Reloading options in the dev menu.
What is the difference between Hot Reloading and Live Reloading in React Native?

Detox Testing a React Native (Expo) + PouchDB App

We are currently working on a React Native app using Expo and are trying to get Detox (E2E Testing) working in our environment. We have spent a lot of time pinpointing where the issue is. The most likely contender seems to be that pouchDB is set up to be live syncing with our database:
LocalDB.sync(RemoteDB, {live: true, retry: true})
.on('change', onChange)
and because of this, detox is waiting for certain network requests to finish that we really don't want detox to wait for:
Sync App State: Waiting for network requests to finish.:
Our tests are running fine without syncing. In our detox tests we've tried blocking that url in our beforeAll & beforeEach blocks with the following:
await device.setURLBlacklist(['.*(OUR_IP_THAT_COUCH_IS_SYNCING_WITH).*'])
But this on top of the fact that detox doesn't officially support Expo, requiring multiple restarts to open the app, makes it hard to debug.
If anyone has any ideas about this, any help is greatly appreciated!

React-native ios app is not responding

when i install the ios app , app screen is not responding. After refreshing and clear the background process the app is working fine.
How to fix the issue?
Yeah, you'll need to include some code or more details as to what is happening. It sounds like you have some code that is failing on initialization but is not depended upon for the rest of the app. If you run react-native log-ios from the command line in your repo, do you get any interesting messages that might contribute to the unresponsiveness?