I'm writing an iOS app that acts as, among other things, a telnet server. Naturally, it begins listening for connections as soon as it starts.
When I run the app in the Simulator, Mac OS X (I happen to be on 10.7.3) prompts me to Allow or Deny my application to accept incoming network connections. This is the standard Firewall message that Mac OS X uses for all unsigned, networked applications.
I grow weary of clicking "Allow" fifty or more times a day, and so I seek a way of permanently adding my app to the Firewall's list of permitted apps.
I've tried the following.
In the last step there's a significant decision. You could add either the .app application package, or Show Contents on that package and add the "Unix executable" within. I've tried both approaches.
Interestingly, Firewall will in fact stop warning you about the app—for a while. After a few runs, however—it isn't clear to me what event actually causes this change, but it happens within half an hour or so for me, generally speaking—Firewall begins warning about the app again.
How do I set Firewall to permanently Allow my iOS app?
Naturally, I could bypass this whole problem by disabling the Mac OS X firewall. I could also avoid ever again getting a splinter in my foot by chopping it off. Neither of these courses of action recommend themselves to me.
What would you suggest?
Set firewall access for services and appsClick Firewall Options. If the Firewall Options button is disabled, first click Turn On Firewall to turn on the firewall for your Mac. Click the Add button under the list of services, then select the services or apps you want to add.
Click the Apple menu, select System Preferences, and click the Security & Privacy icon. Click the Firewall tab, click the lock icon, and enter your password. Click Turn On Firewall to turn the firewall on, and then click Firewall Options to configure your firewall options.
Check Blocked Ports in Firewall via Command PromptType netsh firewall show state and press Enter. Then, you can see all the blocked and active ports in your Firewall.
The firewall is a good option to enable if you're connected to a public Wi-Fi network, such as one at a cafe, library, or other hotspot. For home networks you can usually rely on your router's firewall for protection, though enabling the OS X firewall for added security generally won't cause additional problems.
So we want to suppress the following dialog
Do you want the application “NNN.app” to accept incoming network connections?
which appear on every activation of the Xcode iOS simulator. I believe there is now a solution for that. Basing my answer on this blog.
Simply run the following commands in a Terminal window:
#temporarily shut firewall off: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off #put Xcode as an exception: /usr/libexec/ApplicationFirewall/socketfilterfw --add /Applications/Xcode.app/Contents/MacOS/Xcode #put iOS Simulator as an exception: /usr/libexec/ApplicationFirewall/socketfilterfw --add /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator #re-enable firewall: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on
For me it worked. Please note simulator address is according to Xcode 8.
After dabbling with this for some time, I found that manually adding the executable itself to the Firewall "Allow" list gives the desired result. You don't add the .app, but rather the "Unix" executable inside the .app's Contents folder. I believed I had tried this file before without success, but currently it's working.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With