Closed abbeyjackson closed 6 years ago
Hi. Thanks for raising this issue. The auto-detect feature uses Apple Script to ask Xcode which project directory is open. It sounds like this isn't working for you. Could you try a few things to help me understand what is happening?
Next time you see the error: "Could not detect your project. Enter one in the companion app." open Terminal and execute this command: osascript -e 'tell application "Xcode" to path of active workspace document'
. Can you send the response that you get?
Also when you see the error above, open the companion app. Does it show you the path to your project or does it say "Cannot find a project. Make sure a project is open in Xcode."?
Next time the extension takes a long time to generate a mock. Could you cancel it before it finishes and try again? It shouldn't take longer than a couple of seconds to generate a mock unless the protocol is particularly large. Xcode should say something like: 'The command "Generate Mock" is still busy' and there should be a cancel button on the right side.
Do you have more than one version of Xcode open or more than one project open at the same time?
Next time I see the issue I will reply with all of this info but in the meantime some of this I can answer:
Thanks for the response. I think I’ve found the issue and will put out a fix soon.
Sorry to hear about the slow generation times. I intend to do some benchmarking to get better performance when I finish adding the next few features.
No worries, our project is pretty big, I'm used to things taking a while :)
I've uploaded the fix. The problem (I think) was that you can't run an AppleScript reliably in an XPC instance so it's now running from the extension itself. Hopefully this fixes your problem.
I'm going to assume that fix has solved your problem. If not, feel free to open this issue again.
Hi Sean, sorry for the delay. I will confirm for you on Monday!
Everything is working great, thanks again Sean!
Great!
I'm experiencing an issue where my first mock works fine but after that there is a long period of time and then I get a message that the project could not be auto detected and to set the path manually. The only problem is it is already set manually. The first time it was on automatic so I changed it to manual earlier this morning. In order to fix this I have to click automatic and then back to manual and then it will generate successfully. I have closed the project and reopened but that did not resolve the issue.