1

I am having an issue with my application hosted on Cydia. Users are complaining that the app crashes on startup. The app uses CoreData, I thought it had something to do with this. Weird thing is that it works fine using simulator or on my device when testing. But as soon as it is installed through Cydia it crashes.

Turns out that using "Fix User Dir Permissions" from SBSettings fixes this issue.

Now what can I do about this?

Pieter
  • 1,751
  • 3
  • 30
  • 65
  • If ound the solution here: http://stackoverflow.com/questions/9065585/cydia-app-documents-folder-not-created – Pieter Jun 29 '12 at 12:22

1 Answers1

0

I just had a discussion with the repository guys at BigBoss about this.

I never really got a clear answer, but it looks to me like when Cydia installs your application, it doesn't necessarily set the ownership (explicitly) for your application. That seems bizarre to me. In my case, they were test-installing my app, and seeing that it was owned by user/group = { 1000 / 100 }, which was the linux user id and group id from the machine I was preparing my .deb package on!

I can also see this same behavior if I build a .deb package, deploy it to my own local test repository, and install it with Cydia (pointing at my own repo).

In any case, I explained this to them, and they did something to fix it (without anything more from me).

However, one other option is to manually fix permissions in your post install script. In your .deb package, you would have this folder and file structure:

  • DEBIAN/control
  • DEBIAN/postrm
  • DEBIAN/postinst
  • DEBIAN/preinst

If you put this in your postinst script, I think it should fix this immediately, without having to go into SBSettings afterwards:

#!/bin/bash

chown -R root.wheel /Applications/MyAppName.app/

exit 0

You can do more than that in the script, if you need other directories created, for example. But, the above will at least suffice to change ownership on the .app directory itself.

This BigBoss link recommends creating additional directories in your app's code, and points out that the installer runs as root, while your app normally runs as user mobile. Depending on what you're doing, it may be better to fix ownership/permissions in postinst (root) or in the app (mobile).

Nate
  • 31,017
  • 13
  • 83
  • 207