Why do I see a prompt to "accept incoming network connections" each time I launch MATLAB on a Mac?

5 views (last 30 days)
Why do I see a prompt to "accept incoming network connections" each time I open MATLAB?
Even after I choose "Allow", this message still appears every time I open up MATLAB. My firewall is enabled on my computer but I have an exception setup for "MATLAB".

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 24 Mar 2020
Edited: MathWorks Support Team on 6 Apr 2020
Clicking "Allow" works with no harm but you may still see the prompt appear every time that MATLAB is launched. MathWorks is actively developing a fix for the issue which may be incorporated into a future release of MATLAB.
As a workaround you can launch MATLAB from the 'Terminal' by directly entering the location of the MATLAB executable or by using a shell script.
You will be prompted to accept the network connections the first time you launch MATLAB and all further launches through the 'Terminal' will not display the network message.
1. To launch MATLAB from the 'Terminal' by directly entering the location of the MATLAB executable:
1a. Launch 'Terminal' (This may be present in Applications > Utilities)
1b. Inside the 'Terminal' window type the location of the MATLAB executable. For example,
/Applications/MATLAB_R2019a.app/bin/matlab
2. To launch MATLAB from the 'Terminal' using a shell script:
2a. Create a shell script and save it on the Desktop or desired location for easy access:
a. Launch 'Terminal' (This should be present in Applications > Utilities)
b. Type 'cd <desired location>' inside the 'Terminal' window. For example: cd desktop to change the current directory.
c. Type 'vim <filename>' inside the 'Terminal' window to create a new file with the desired filename.
d. Press the letter 'i' on your keyboard to enter the INSERT mode.
e. Inside the file type the below commands:
#!/bin/sh
# location of the MATLAB executable script with respect to the current desired location. For example:
/Applications/MATLAB_R2019a.app/bin/matlab
f. Press the 'esc' key on the keyboard to exit the INSERT mode.
g. To save the file, type in a colon followed by wq. i.e :wq
2b. Make the shell script executable by typing the bellow command in the 'Terminal' window:
chmod u+x <filename>
You can now launch MATLAB by double clicking the file or typing the below commands inside the 'Terminal' window:
cd <file location>
sh <filename>
An alternate workaround is to disable the built-in firewall on MAC.
WARNING: Disable MAC's firewall ONLY if you are behind a trusted router with a firewall.
To do so go to System Preferences > Security and Privacy > Firewall and click "Turn Off Firewall".
  3 Comments
Walter Roberson
Walter Roberson on 25 Jun 2021
I have run MATLAB on every MacOS version since 2013. I never once had it continually prompt me to accept network connections. The only long-standing problems I have had, have to do with installing Raspberry Pi (I developed a workaround for Big Sur for that one.)
Unfortunately, Apple has been making big changes to security architecture and has been only giving about 3 months between the release of the first public beta and the official release, so it has been a real moving target.

Sign in to comment.

More Answers (0)

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Tags

No tags entered yet.

Products


Release

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!