automatically set permission?

Discussion in 'iOS Development' started by vieestchien, Jun 8, 2008.

  1. vieestchien

    vieestchien New Member

    Joined:
    May 7, 2008
    Messages:
    43
    Likes Received:
    1
    I have a question:
    Usually when you transfer your app to iPhone (by scp, iPhone PC Suite or whatever), you need to ssh into the phone then set permission for the executable (chmod +x...) or log files (chmod +w...). Sometimes further manual settings are needed (reload SpringBoard, register listeners to telephony events...). But if you give the app to a friend, a customer etc... you can't ask them to do all this. Is there any solution? I think the main problem would be setting the permission for the executable for the 1st time, because I suppose using system() or something similar would solve the rest. If I make a repo and my friend downloads my app using Installer.app, would the permission be automatically set?
    Thanks in advance.
  2. God__

    God__ New Member

    Joined:
    Dec 23, 2007
    Messages:
    69
    Likes Received:
    0
    POSIX. An app can't give permissions that it itself doesn't have. That is, if it doesn't have +x, it can't give any other app, including itself +x. You will either have to set the permissions manually before you package, presuming you have a packager that retains permissions, or you can tell Installer to set the settings using chmod via its "Exec" command. However, the latter is not recommended because not everybody will a) Have Installer set up correctly, b) Have Installer.
  3. vieestchien

    vieestchien New Member

    Joined:
    May 7, 2008
    Messages:
    43
    Likes Received:
    1
    Thanks for the reply. I am using cygwin toolchain, and I usually transfer files to iPhone by scp.

    Apparently there is an option scp -p to retain the permission, but I can not test it yet because I couldn't set the permission in my cygwin. chmod just doesn't do anything. Anyone has successfully changed the permission from cygwin? If not, I suppose I will have to build my application from a Mac and change the permission there.
  4. optimo

    optimo New Member

    Joined:
    Sep 28, 2007
    Messages:
    535
    Likes Received:
    17
    in my makefile, I used an scp command...followed by an ssh command to do the chmod
    both step require you entering the password

    mess around with 'ssh' command, you can use a semicolon to separate multiple commands
  5. vieestchien

    vieestchien New Member

    Joined:
    May 7, 2008
    Messages:
    43
    Likes Received:
    1
    Thanks all for your help, I have created a repo and successfully changed permission automatically.
    Although with the new 2.0 firmware coming, I'm not sure if the Installer would still work.

Share This Page