Thank you for your reply, Han. No, I am sure I am copying the binary every time it builds.
The problem is the following: As I dislike installers and uninstallers I want to get rid of the need of having to explicitly uninstall my application, and that you have to do when the user needs to upgrade an application with helpers that reside inside a bundle and one of them is a background app that must be running all the time. The moment you try to drop a new version on the Applications folder (or alias to it) and you try to upgrade without an installer you will get an error because the background app is still running. To preclude this I decided to install the helpers into the Application Support folder (inside a sub-folder) so that the running background app does not prevent the upgrade with a simple drag and drop. The method that was failing was the one that I used to check whether the helper was inside the bundle or was in the Application Support folder. That is why the location mattered. However, I have already modified this method so the actual location of the helper does not matter anymore.
But anyway, the second solution you gave me is amazing. Now I can decide which product to launch and debug, whether the one inside the bundle or the installed product, each having their own scheme. Thank you so much. Your answer saved me a lot of headaches.
Keep up the good work,
João Varela
From: Han Ming Ong < email@hidden> Date: Quinta-feira, 16 de Agosto de 2012 17:30 To: João Varela < email@hidden> Cc: < email@hidden> Subject: Re: Debugging helpers inside a main bundle app
If you are copying the helper into the app bundle every time you do a build, there should not be a difference between debugging which the helper in the built directory or the app bundle.
Bu by the way you describe it, it seems like you might not be doing the copy each time, so the binary actually differs.
I think you have a couple of options.
1. Make sure you do the copy of the helper every time you build the helper.
or
2. In the Scheme editor for the helper target, go to the Info tab. Make the 'executable' point to the actual one in the app bundle.
Han Ming
On Aug 15, 2012, at 8:43 AM, João Varela < email@hidden> wrote: Hello all,
I have an application with two helpers inside the Resources folder and a login item inside the new /Library/LoginItems location, all of these inside the bundle of the main app. I use the default location for the build products, each one of them built from their own targets in Xcode 4.4.1. I place the helpers inside the Resources folder using a copy phase that copies the products inside the build directory to Resources inside the main app bundle. I also created a script to create the LoginItems directory so that I can copy the login item to its proper location inside the main app bundle.
Everything works well when debugging the products until I get hit by a few exceptions in methods that need that the helper being debugged is the one inside the main bundle and not the one in the build directory. I tried to install the products using deployment post processing but that does not change the product that is launched by Xcode while debugging. It still launches the products inside the build directory and not the installed products.
Seeing these problems, I would like to ask you the following question:
What is the Xcode setting that is pointing to the product that is going to be launched by Xcode for debugging so that I can change it to the helper inside the main app bundle?
Or better:
What is the supported solution for such a problem? I looked for the solution of this problem on developer.apple.com and other sites and on the lists, but I could not find a satisfactory answer to my problem. Any answers would be most appreciated.
TIA
João Varela
|