1

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)

1 Answer 1

1

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
Sign up to request clarification or add additional context in comments.

7 Comments

Great. Is there a way you could append a script to your answer that would do what you said, and SSH+drop the bundle into /Applications and launch, including the debugger?
Unfortunately, I don't have a jail-broken iPhone, so I would have no way to test such a script or else I probably would write it for ya =) (I'm that into python). But, I can dig up some info on how to ssh in python if that would help ya get started?
I'm not familiar with python and only know rudimentary terminal commands. I'm not sure if it would work or not. I would love to find out, though, so if you have time... I upvoted your answer and will check mark it if no one else replies in the next day or two
Actually, you would just need to scp it I think. Try something like this as a post-biuld script action: scp ${BUILT_PRODUCTS_DIR}/${FULL_PRODUCT_NAME} [email protected]:/Applications/. But replace 192.168.1.25 with the IP/hostname of your iphone and replace root with the proper user.
Thanks. I'm not currently on my WiFi network with my devices so I can't test until I get home, unless there is a variable to set that can move the files along the USB cable. Will the app automatically launch at the end with gdb attached?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.