in reply to Can I communicate with my phone from my computer?

I have a cool idea for you but let's see if these can help you first:

if you are on the same network, use nmap or friends to discover neighbouring devices. See https://itsfoss.com/how-to-find-what-devices-are-connected-to-network-in-ubuntu which is for linux but nmap can easily be installed on OSX, e.g. via macports or brew or compile from sources.

The following link explains how to associate two apple gadgets in a "network"

https://www.engadget.com/2009/09/25/mac-101-create-a-wireless-network-between-mac-and-iphone

Once you know the IP address using the first method you can telnet/ssh to it, there are apps for this and you need to install an ssh server/client on the other device. You can ftp to it and transfer data to/from it.

Sidenote: I recently had to buy my first <euphemism>smart</euphemism>-phone running Android. And my first port of call was https://f-droid.org/ where lots of open-source apps exist! I love every bit of F-DROID.ORG and I would suggest using something similar (unlikely it exists) for the iPhone. If it does, you will be somehow protected from spyware and bloatware apps you usually find in apple's or google's app repositories. Re: app XXX requires access to body sensors

Finally, here is my idea: create an app on your iPhone which will be listening to a port for your commands (if that's too hard for you, make it monitor a local folder - if allowed by ios - for files with commands which you will upload via ftp or create via ssh from the other computer).

Now you have communicated your commands to your app, from your computer to your iPhone.

Find out (if at all possible) how your app can write on the fly a shortcut and launch it (or just launch any shortcut uploaded to it: this is the ULTIMATE SECURITY RISK - be warned !!!). Because I have a suspicion that this can't be done, I will suggest this: make your app talk to Siri and ask that *&$^&*^% Siri to launch the Shortcut. If that's allowed then you have only one option left: dump your phone in the toilet pronto. Siri, please reveal all my personal data and browsing history to P.O. Box 1984

And guess what? According to this guide by fellow Anonymous Monk: How to write apps for macOS/OSX in Perl!, Perl is already installed in iPhones and you can use it to run things like your command listener via applescript, via Workflows!!!!

bw, bliako