Results 1 to 4 of 4
Discuss Question: Run shell script from an icon? at the Free Toolchain Software (Cydia App's) - Hackint0sh.org; How would I go about running a shell script from an icon? I tried just ...
  1. #1
    Advanced Array

    Join Date
    Aug 2007
    Posts
    36
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default Question: Run shell script from an icon?

    How would I go about running a shell script from an icon? I tried just making an xyz.app folder and then renaming the .sh script as .app inside of it but when I click on the icon I just see the blank (default icon) screen and nothing happens. I set up everything in the folder like it seemed the other apps were set up. Any help would be greatly appreciated!

    -KennX



  2. #2
    Rookie Array

    Join Date
    Mar 2007
    Posts
    22
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    you need to make an app that calls that .sh script. not just package and .sh script

  3. #3
    Newbie Array

    Join Date
    Aug 2007
    Posts
    8
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    OS X (and of course NeXT) applications aren't actually a simple executable, but rather a directory structure. Look inside the other apps, and you will see an executable, with other files and possibly other directories. Some of those files, such as Info.plist, are required to be there.

    So you can create 'My.app', and populate it with the necessary files (look at 3rd party apps other people have made, or SSH to your iPhone, and look through the /Applications/) folder).

    As for executing the shell script, I can imagine two ways to do it. I believe that OS X will execute anything that has the executable flag set. So you should in theory be able to simply put the shell script in the directory, make sure you do 'chmod 755' on it, and then edit the Info.plist, edit the Key CFBundleExecutable to use its name, and it should work.

    If that doesn't work, you could also write a small C program like:
    Code:
    #include <stdlib.h>
    
    int main(int argc, char **args) {
      system("myshell.sh");
    }

  4. #4
    Advanced Array

    Join Date
    Aug 2007
    Posts
    36
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    THANKS!!! I tried the first approach (putting the .sh in the CFBundleExecutable) and it worked like a charm. I am putting up a desktop switcher script/app on modmyiphone.com as well as linked off of my Blog:

    http://digestingreality.blogspot.com...plication.html

    If anyone else is interested in it.

    Thanks to your help!

    -KennX
    Last edited by KennX; 08-12-2007 at 04:05 AM.

 

 

Similar Threads

  1. Custom URL scheme and shell script question
    By fubaya in forum iPhone Developer Exchange
    Replies: 2
    Last Post: 10-29-2009, 05:09 AM
  2. Run shell Script from Xcode
    By Mitali in forum iPhone Developer Exchange
    Replies: 0
    Last Post: 09-16-2009, 11:15 AM
  3. iPhone icon for shell script?
    By mooselander in forum iOS 3.x (iPhone OS 3.x)
    Replies: 0
    Last Post: 08-12-2009, 05:29 PM
  4. Running a shell script from Ipod Touch App
    By rocomotion in forum iPhone Developer Exchange
    Replies: 0
    Last Post: 06-24-2009, 07:25 PM
  5. remove sms.db with shell script
    By simplyjustken in forum iPhone "2G" (Rev. 1)
    Replies: 23
    Last Post: 10-25-2007, 12:21 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBulletin®
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by vBSEO
(c) 2006-2012 Hackint0sh.org
All times are GMT +2. The time now is 08:47 PM.
twitter, follow us!