ReactNative access denied when Mac is connected to VPN - ios

Launching application ReactNative on a ios simulator gives erros when Mac is connected to VPN :
Access Denied (policy_denied)
On device it's work fine, if a disable VPN it's works
I tried to delete all folded nodes_module, pods, ,lock files launch several times but still the same problem
I launch the app from xCode i also try to launch it from terminal but nothing changed
Any help will be appreciated

On simulator i click on
cmd + d
configure bundle
after i put the ip adress of my Mac adress 192.168... and it works

Related

How to launch my Flutter app without the host computer?

I wanted to know how to launch my Flutter app without the host computer on my iOS 14+ devices. Because I disconnected to my host computer and it gave me some error, so that I don't have to go back to my Mac everytime and rebuild that app.
You can just run this command in your IDE (I did it with VSCode)
flutter run --release
It worked for me!

React Native iOS could not connect to development server

I get the common Could not connect to development server error described in e.g. React-native iOS: Could not connect to development server. Things that are working:
My iOS device is built fine using Xcode and launching
The URL inside the app shows correctly (192.168.4.59:8082/index.bundle?platform=iOS&dev=true) and opening that URL in the browser loads the bundle as it should
The phone and laptop are on the same wifi
Killed node process and restarted npm with --reset-cache
Restarted xcode, iphone and computer (many times)
What might I be doing wrong?
It worked to use a USB cable instead of wifi and untick "Connect via Network" in Xcode > Devices And Simulators window.

React-native iOS: Could not connect to development server

After restarting Wi-Fi router my local ip has changed from "192.168.1.4" to "192.168.1.3" so I've changed it in AppDelegate.m to
"http://192.168.1.3:8081/index.bundle?platform=ios&dev=true&minify=false"
But I still get error on real device:
Could not connect to development server ...
URL http://192.168.1.3:8081/index.bundle?platform=ios&dev=true&minify=false
When I shake my phone and configure bundler to the same IP 192.168.1.3 and port 8081 app loads successfully. But Fast Refresh is not working and I need to build app and configure bundler every time I make changes in my code.
I also checked "http://192.168.1.3:8081/index.bundle?platform=ios&dev=true&minify=false" in my browser and on another computer in my local network and it works fine. Tried to load the same link on mobile browser with no success.
All devices are using the same network.
I have already tried:
cleaned tmp folders and watchman
cleaned iOS build folder
removed and reinstalled node_modules and pods
killed node process and restarted npm with --reset-cache
restarted xcode, iphone and computer (many times)
reinstalled watchman
set "Connect via Network" in Xcode Devices window
That was issue with expo-splash-screen package which doesn't work on new iOS version. The fact that app was not able to run after wifi restart was just a coincidence. I have seen some non-permanent warnings about splashscreen in Xcode logs but didn't take it seriously.
Removed 'expo-splash-screen' package and everything works fine.
It helped me a lot: https://github.com/facebook/react-native/issues/31369

Xcode 9.2 Simulator Debugging Broken; Could not attach to process id

Xcode 9.2 debugging on an iOS Simulator has completely broken for me.
I worked on this for hours and tried a ton of suggestions short of completely wiping my hard drive and starting out with a fresh operating system install. I ended up filing a bug with Apple. Posting here in case anyone has encountered this problem and has any suggestions.
Summary:
When try to build and run in debug mode with a debug executable. The simulator only opens the application to a white screen and then Xcode pops up an error:
Could not attach to pid: "<a process id>"
Ensure "<app>" is not already running, and "<user>" has permission to debug it.
Steps to Reproduce:
Make any project and try to run on any simulator.
Expected Results:
Debugger successfully attaches to debugger.
Actual Results:
Debugger is never able to attach to the iOS simulator process/app for debugging.
Debugger CAN attach and build and run successfully on a physical device.
Version/Build:
- Xcode Version 9.2 (9C40b)
- macOS Sierra 10.12.6
- Any iOS project
- Any iOS simulator
Other notes:
- Xcode 9.2 was working fine until this problem randomly started. The error initially said:
Failed to initiate service connection to simulator
DTServiceHubClient failed to bless service hub for
simulator iPhone 8 Plus <simulator identifier>
- After rebooting computer, the error shifted to "Could not attached to pid..."
I tried dozens of suggested solutions short of completely wiping my computer including:
Resetting device contents and settings on simulators
Create a new device (even different device and OS combinations)
Try different Xcode projects, even simple one-off single view applications
Looking at the etc/hosts file and verifying localhost can be pinged
Restarting computer multiple times
Deleting out derived data (multiple times)
Let it build and run without attaching debugger, then try to attach debugger by "attach to process id"
Completely uninstalling Xcode and all simulators, and reinstalling.
Removing any invalid certificates in keychain
It turns out our security software was blocking the debugger. Running sudo sysdiagnose helped me find a log entry showing that it was being blocked. The software is Cb Defense (Carbon Black Defense). Apparently the only workaround is for your security team to whitelist by a hash, and that hash could change in the future.
There is a bug in Xcode 9.0-9.2 that causes this issue to appear after running for a while. If you log out and back in it should resolve it for you.

React Native on Ipad - Error - could not connect to development server

I'm using React-Native, when I run the AwesomeProject with Xcode and iPhone simulator everything works well, but when I connected my iPad and built the project on my iPad I receive an error on the iPad when the app starts:
"Could not connect to development server. Ensure node server is
running. The operation couldn't be completed (NSURLErrorDomain error
-1004)".
I also ensured that the node package is running. I even restarted Xcode and started it all over with running npm start.
Could you please assist?
On your AppDelegate.m you have to update the jsCodeLocation and replace localhost with your machine ip address.
Either that or bundle the compiled source into your application, which is commented as option 2 on AppDelegate.m as well. You download the compiled code, and add it to your Xcode project.
Try to take a look here for the solution:
https://github.com/facebook/react-native/issues/240#issuecomment-86977126
Another potential issue which can cause the exact same error is App Transport Security (ATS) in iOS9--this happened to me, even though everything else was set up correctly. See my description and solution at https://stackoverflow.com/a/34880394/2397068.
I have prepared a small instruction which will help to solve this problem.
When your application cannot connect to the server, you will see the message like this:
Open a file AppDelegate.m in your Xcode project and look for
jsCodeLocation = [NSURL URLWithString:#"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
You have to replace this address with your local address.
To look up your local IP address in Mac OS X open Terminal application (located in /Applications/Utilities) and type ipconfig getifaddr en1 for wireless, or ipconfig getifaddr en0 for ethernet.
You can check It in browser. And you will see React Native Debugger page
Just replace localhost in AppDelegate.m with your IP address. localhost to 192.168.1.100 in my case.
Run your application in Xcode again.
In my case, I just had a very old version of node.js installed (version 0.8.6). After updating node.js to version 0.12.2, the default project that react-native init AwesomeProject created worked perfectly.

Resources