Fixing the broken iOS simulator in React Native when using zscaler
If you are using zscaler and are trying to run the iOS simulator with the React Native metro server, you may have run into the issue of not being able to pull in content from your metro server while zscaler is running. Turning off Internet Security
might allow this to work, but the real reason the simulator cannot access the metro server is because the simulator does not have the zscaler certificate installed. Here is how you can fix this in your simulator.
Zscaler certificate
Zscaler has a security certificate that it installs on your computer to let you access resources on your zscaler network. You can download this certificate from zscaler on mobile devices by using the following URL: https://mobile.zscaler.net/downloads/zscaler2048_sha256.crt.
You can download this using your terminal using the following command:
$ curl https://mobile.zscaler.net/downloads/zscaler2048_sha256.crt --output ~/zscalerrootca.der
Selecting the correct iOS simulator
Xcode installs many simulators, but generally you only run one at a time. The following command will show all of your simulators that are installed.
$ xcrun simctl list devices