Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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. This should work. It works on Linux, and I'll be trying it on my own iPhone here shortly.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.