Daddy
Daddy

Reputation: 9035

iOS & XCode 4 Build Setting: Install Directory

When developing iOS apps with XCode, there is a build setting called Install Directory. Does XCode ignore this? I've changed it to /Applications and the app still gets installed in the sandbox. I'm using a jailbroken phone and would like my app to get installed in /Applications for system read privileges. The only other way, it seems, is to use SSH to drop the bundle in /Applications. Doing that forces me to build+archive, thus I can't use the debugger for console output.

Is there a solution to this problem? (I am a paid dev with a proper certificate, no hacks)

Upvotes: 1

Views: 1559

Answers (1)

chown
chown

Reputation: 52798

This setting is mainly for OSX apps, but I think it may also place the main executable inside that directory inside of the App bundle. So if you had Test.app, the executable binary file would be in Test.app/Applications/test. At least it did that for me a while back when I was messing around with different settings. It may have changed.

You can use the xcode 'Behaviors' settings to specify a script to run when a build succeeds, or you can set 'Pre-build' and 'Post-build' actions (can also run a custom script) for each scheme in your project. You could automate the process of SSH'ing and moving the bundle with a post-build script.


Edit:

I just tested changing this setting and building debug/release/test/etc versions of my project, and nothing changed about the bundle or archive that was build. Seems this setting has no effect on iOS apps.

Actually, after more testing it does change the directory inside a release archive. This is how the archive looks after changing that setting to ApplicationsTest:

[ 12:12 Jonathan@MacBookPro ~/Library/Developer/Xcode/Archives/2011-09-28 ]$ cd Universal\ 9-28-11\ 12.11\ PM.xcarchive/Products/
[ 12:12 Jonathan@MacBookPro ~/Library/Developer/Xcode/Archives/2011-09-28/Universal 9-28-11 12.11 PM.xcarchive/Products ]$ ll
total 0
drwxr-xr-x  3 Jonathan  staff   102B Sep 28 12:11 ApplicationsTest
[ 12:12 Jonathan@MacBookPro ~/Library/Developer/Xcode/Archives/2011-09-28/Universal 9-28-11 12.11 PM.xcarchive/Products ]$ ll ApplicationsTest/
total 0
drwxr-xr-x  187 Jonathan  staff   6.2K Sep 28 12:11 Universal.app

And changing it to SomethingElse:

[ 12:15 Jonathan@MacBookPro ~/Library/Developer/Xcode/Archives/2011-09-28/Universal 9-28-11 12.15 PM.xcarchive/Products ]$ pwd
/Users/Jonathan/Library/Developer/Xcode/Archives/2011-09-28/Universal 9-28-11 12.15 PM.xcarchive/Products
[ 12:15 Jonathan@MacBookPro ~/Library/Developer/Xcode/Archives/2011-09-28/Universal 9-28-11 12.15 PM.xcarchive/Products ]$ ll
total 0
drwxr-xr-x  3 Jonathan  staff   102B Sep 28 12:14 SomethingElse
[ 12:15 Jonathan@MacBookPro ~/Library/Developer/Xcode/Archives/2011-09-28/Universal 9-28-11 12.15 PM.xcarchive/Products ]$ ll SomethingElse/
total 0
drwxr-xr-x  187 Jonathan  staff   6.2K Sep 28 12:15 Universal.app

Upvotes: 1

Related Questions