Connecting Mobile GPT to Mac Codex

A practical record of connecting the mobile GPT app with Codex on Mac, including proxy configuration and restart steps

Connecting Mobile GPT to Mac Codex

This note records my own setup process. The goal was to make the GPT app on my phone connect reliably to Codex running on my Mac.

Steps

Sign in with the same account

  • Sign in to the GPT app on the phone with your account.
  • Sign in to Codex on the Mac with the same account.

Enable multi-factor authentication on the phone

  • Enable multi-factor authentication (MFA) on the mobile side. Otherwise, the phone-side security verification may fail.
  • In my case, I completed the verification using Apple’s built-in password/authentication capability.

Configure Codex proxy environment variables

Edit ~/.codex/.env and add the following content:

HTTP_PROXY=http://127.0.0.1:6789
HTTPS_PROXY=http://127.0.0.1:6789
ALL_PROXY=http://127.0.0.1:6789
WS_PROXY=http://127.0.0.1:6789
WSS_PROXY=http://127.0.0.1:6789
http_proxy=http://127.0.0.1:6789
https_proxy=http://127.0.0.1:6789
all_proxy=http://127.0.0.1:6789
ws_proxy=http://127.0.0.1:6789
wss_proxy=http://127.0.0.1:6789
NO_PROXY=localhost,127.0.0.1,::1
no_proxy=localhost,127.0.0.1,::1

After saving the configuration, restart Codex.

If you use a local proxy tool, Codex may work normally without changing these environment variables, but the mobile app may still show the device as offline.

Connect the phone and Codex

  • After restarting Codex, try the connection flow again from the mobile app.
  • Once the connection succeeds, it should be ready for normal use.

Success Criteria

I mainly used two signals to decide whether the setup was successful:

  • Mobile GPT and Mac Codex are signed in with the same account and remain stable.
  • Codex network requests work normally, without proxy or connection errors.

Troubleshooting

If the connection fails, I would check the following items in order:

  • Confirm that the phone and Mac are using the same account.
  • Confirm that MFA has been completed and is active.
  • Check whether ~/.codex/.env was saved successfully and whether the port is correct.
  • Confirm that the local proxy at 127.0.0.1:6789 is running and that the port matches.
  • Restart Codex and try again.