- Jailbreak your iPhone (as of Jan 2021, https://checkra.in is a good option if you have a pre iOS 14 device). I advice you to not use your main device for this
- Make sure Cydia is installed on your jailbroken iPhone
- Open Cydia (performing any neccessary updates if needed), tap "Search", and install "OpenSSH" (from apt.bingner.com) and "IPA Installer" (from BigBoss). This should install "IPA Installer Console" package as well.
- Make sure your iPhone is connected to the same Wi-Fi as your Mac.
- On your iPhone, open "Settings" -> "Wi-Fi", then tap on the info button (ℹ) next to the connected wi-fi network, and note down your IP Address. You will use it for SSH connection.
- Use this guide to get access to your jailbroken iPhone via SSH with your Mac.
(TL;DR for SSH:)