title: iOS app to run script
body: <p>I would appreciate help in creating an iOS app to run a specified script at /var/mobile/script.sh. The script I have written opens a number of specified apps "all at once" on my jailbroken 6.1.2 iphone. Currently I run the script by starting MobileTerminal and manually running the script.sh file from the command line. I would like to be able to create an app that I could start via the Springboard which would run /var/mobile/script.sh directly.</p>
  
  <p>I do not have a Mac and so I am unable to compile an app myself. I also do not have much experience of programming so I would appreciate any help on offer. I have seen an answer which is similar: <a href="https://stackoverflow.com/questions/12223510/ios-execute-shell-script-from-activator">iOS execute shell script from Activator</a></p>
  
  <p>The answer provided above is VERY close to what I am looking for. However I have two problems with the Script.app as it stands:</p>
  
  <p>1) As the script I have written opens a number of other apps which takes around two minutes to complete, the Script.app is automatically killed by iOS after about 20 seconds. I'm not sure if a flag "didFinishLaunchingWithOptions" needs to be set to allow Script.app to continue running so it can finish running my script? I have installed a package via Cydia called "Background Manager" - [which as I understand it makes all apps effectively think they are running in the foreground].</p>
  
  <p>2) I have previously tested Script.app listed above on iOS 5 and the Script.app did run for around 20 seconds bringing the apps to the foreground as listed in my script.sh. On iOS 6.1.2 the Script.app runs certain commands in script.sh [e.g. killall commands] but when it comes to opening a specified app via the script it won't open any app [there is a blank black screen for 20 seconds and then the Script app closes without having opened any apps via the script.sh file]. However in iOS 6.1.2 if Script.app is started and immediately the home button is pressed to return you to the Springboard the Script.app will open apps via my script.sh for the first 20 seconds, so there appears to be a difference between the way the Script.app runs on iOS5 vs iOS6. I would like if Script.app could open apps via the script.sh without me having to immediately press the home button after Script.app starts on iOS 6</p>
  
  <p>In my script file I use a command line package called "open" to specific which app to open via its CFBundleIdentifier: <a href="http://moreinfo.thebigboss.org/moreinfo/depiction.php?file=openData" rel="nofollow noreferrer">http://moreinfo.thebigboss.org/moreinfo/depiction.php?file=openData</a></p>
  
  <p>Thanks for your help</p>