views:

390

answers:

5

Hi there.

I am into a very strange problem. I have developed an app for myself, which has following three files

  • MyApp.app
  • MyAppDaemon.app
  • LaunchDaemon.plist

When i copy each file into specific folder using ssh , my app works perfect.

  • MyApp.app into /Applications
  • MyAppDaemon.app into /private/var/mobile/
  • LaunchDaemon.plist into /System/Library/LaunchDaemons/

App works great if i ssh using cyberduck and puts each file in above specified folders.

Now the problem is when i try to pack the files in .deb file and then transfer to iPhone and then using Terminal i install it [dpkg -i MyApp.deb] the files get copied fine in the folders i specified earlier but my app doesnt work. I have checked all the permissions, still not working.

Its kinda strange, everything is done in the same way as i do using ssh but in case of .deb file its not working, however it works great if i copy the files individually

Any Advice on this??

+1  A: 

Maybe the .deb installation is pushing the files out with a different owner?

jessecurry
+1  A: 

Your problem is most likely in your .deb creation process. Did you follow the instructions on saurik's site or a different method? http://www.saurik.com/id/7

Charybdis
A: 

I don't have much experience with creating debs but like jessecurry I think permissions might be the problem, if you can try running the app from the terminal and see what you get.

Roman A. Taycher
A: 

Wild guess (I have not dealt with jailbroken development) but perhaps a symlink is being dereferenced when you pack as a .deb file?

iPhone apps that are signed have a symlink in the CodeSignature folder inside the bundle. If you zip and unzip the bundle without being careful (e.g., providing the -y option to zip), the symlink will be replaced with a copy of the file, which breaks the signature. This leads to mysteriously broken apps.

Even if you're not code signing, try unpacking your deb file and comparing the output to the original app bundle, to see if there's a difference.

benzado
+2  A: 

Thanks for the replies guys, i have found the solution to my problem, although i still dont know why the problem was occurring. Here is what i did

I had packed my AppDaemon in MyApp resources folder in xcode and in DEBIAN's postinst file i was moving that folder to /private/var/mobile which was causing problem actually. The folder was getting copied to /private/var/mobile but may be not with all the permissions and ownership. So what i did is, before packing it into .deb file, i deleted the AppDaemon from resources folder of MyApp in xcode and made it a standalone app. Then i made this file architecture for packing into .deb

+- MyApp
   +- Applications
      +Myapp.app
   +-DEBIAN
    -control
    -postinst
    -postrm
   +-System
     +-Library
       +-LaunchDaemons
         +- com.myLaunchDaemon.plist
   +-private
     +-var
       +-mobile
         +- AppDaemon.app

Then i packed the folder with .deb commands like this saurik instructed in his site.

All went well, problem solved. However i still dont know why the problem was taking place?

raziiq