RStudio requires multiple attempts to start on Mac

MacOS: 13.7.7 (22H722)
RStudio version: 2025.09.0+387
R version: 4.5.1

This problem started when I installed R 4.5.0 in MacOS 13.7.5.

It takes several attempts to start RStudio. The first time is sufficient to launch rsession. Most of the time, RStudio effectively hangs with very few time slices, usually showing 0.0% CPU. Most of the time when RStudio loads, it can't establish a connection to R. Even when it loads successfully, sometimes RStudio crashes when I attempt to load a project.

Have you tried resetting RStudio's state?

I reset RStudio's state the first time this happened and did again after seeing your reply.

I think I've bypassed the problem with losing the connection to R when I load a project: I now load into a new session.

I also had to update my OS for other reasons. I'm now running OS X 13.7.8.

When you say "load a project" do you mean that the R connection breaks when you load a .Rproj file, or when you open individual notebook / app / script / whatever files?

When I open a .Rproj file.

Trying to narrow down what might be going on. Can you open and run individual R scripts, RMarkdown files etc. without problems? If so, can you start a new project, exit, restart RStudio and open the new .Rproj file without issue (meaning the problem is restricted to previously created project files), or does RStudio gag on the new .Rproj file?

I opened and ran an R script fine. I then tried to create a new project and the connection to R was lost.

It turns out the project was created. I had to restart RStudio after the R connection was first lost. The first time I tried to open the new project in a new session, it worked. The second time, the connection to R was lost. This is a new behavior. I tried opening an old project in a new session. I succeeded on the third try.

If you run RStudio from a terminal and the R connection is lost, do you get any error message in the terminal? Also, RStudio writes log files. Maybe something useful is in one of them? Instructions on accessing them can be found here.

Log files from from unsuccessful launch. Got to splash screen, then force quit after RStudio's CPU share fell to 0. I uploaded the logs to https://www.dropbox.com/scl/fo/9xma8olmkqrw35653mku7/ACJkA-FB7rZQoVlKc29OyRk?rlkey=6hrh39l7dd42piy3v7oc7w66t&st=hg44sco2&dl=0

It looks like RStudio is having a hard time making a localhost connection to the R session. You might want to take a look at this support article, particularly the part about firewalls etc.

I added an exception to my malware scanner and it did the trick. Thanks for all your help!

You are welcome. I marked your reply as the answer in case anyone with a similar problem finds this thread.

I have to reopen. RStudio opened quickly the first two times. I couldn't get it to load a project. I'm still investigating.

I had to reset R's state again. It loaded 4 times, but the first three times, it failed to connect to R. Then, it took 2 tries to open a project in a new session. The first time, it got past the splash screen then did nothing.

That is, I reset RStudio's state.

Did resetting the state again fix things, even if temporarily?

Only the startup was fixed.

Any chance your malware scanner is interfering again? Also, do you have a firewall?