Run a command before launching an app I have a particular app that uses its own Ad Library aside from iAd. If I remove the correct folder prior to launching the app, No ads will be shown during that session. However, upon closing and relaunching the app, the folder is recreated and ads are shown. Trying to restrict access to the folder causes the app to crash upon launch. As such, my question is this:

Can I make my jailbroken iOS device run a command (in this case, rm -rf bla/bla/bla) and then launch an app, all from the touch of a homescreen icon?
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.