Run a command before launching an app
You can replace the binary of the app with a .sh script. Pretend your app's binary is named App; rename it to something else like App.real, and then make an .sh script that's simply called App. Not App.sh, just App without any extension. Put your command in the .sh script, and then on the last line of the script, call ./App.real.

Edit: I tested this, but I never seemed to be able to make it do what I wanted. Maybe someone else can figure it out.