seanhenry / SwiftMockGeneratorForXcode

An Xcode extension (plugin) to generate Swift test doubles automatically.
MIT License
752 stars 49 forks source link

Mock generator not appearing in editor #21

Open moheny opened 5 years ago

moheny commented 5 years ago

It used to work on Xcode 9.+ . Once I have upgraded to Mojave and Xcode 10, the generator disappears from the editor menu. Of course I have enabled permission at Check System Preferences -> Security & Privacy -> Privacy. Also I have tried to reinstall and still not appearing in the menu. Any suggestion how can it be solved? I really love this extension. Edit: all of the extension not working for me. Is there anything I can do beside reinstall Xcode?

seanhenry commented 5 years ago

Hi @moheny

Thanks for raising this issue. Run through this check list to make sure everything is set up correctly:

moheny commented 5 years ago

Thank you for the fast reply. The 'Xcode Source Editor' is not appears in the menu... is there any thing I can do to make it appear?

seanhenry commented 5 years ago

I'm not exactly sure how the OS finds Xcode extensions but I have a feeling it might use spotlight. Make sure it is installed in the /Applications directory and that you have opened the app. Open spotlight and see if you can search for Swift Mock Generator for Xcode.

moheny commented 5 years ago

I believe this is an Xcode problem since the 'Xcode source editor' is not even shown in the menu. I have installed Xcode through appStore so I really have no clue why it is not appearing in the extension menu. This is, apparently, has nothing to do with your extension, hence I think we can close this issue. I'll try to reinstall Xcode and pray to god it will work :-. Maybe having your service online is not a bad idea. you can even make money from commercials like swift converter :-). Anyway thank you for stepping into this.

seanhenry commented 5 years ago

I've since had this problem myself and managed to fix it. I've added instructions to the README and copied them here for reference:

Troubleshooting

You might find that you are not able to see the plugin in the Editor menu or even in the Extensions preference pane. This seems to be caused by installing your Xcode version(s) outside of the App Store. If this happens, open Terminal and run:

$ pluginkit -m -p com.apple.dt.Xcode.extension.source-editor -A -D -vvv

If you can't see the plugin in this list then you can reset your list of plugins by running the following in Terminal:

$ PATH=/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support:"$PATH"
$ lsregister -f /Applications/Xcode.app

See here for more information.

If the above fails, then completely removing the plugin and downloading/installing it again seems to work.

iandundas commented 4 years ago

Didn't work for me :( one day the editor menu item just vanished, and also the Xcode Source Editor entry from Extensions System Preferences panel also vanished.

Did the above troubleshooting steps above (with Xcode closed), and reinstalled the mock generator app, and then did the steps above again, then opened Xcode, checked the Extensions panel, restarted Mac, did all the above again.. still no joy.

However interestingly, maybe you're on to something about Spotlight, because searching for "Swift Mock Generator for Xcode" in Finder does not show the app in the results (even though it's in /Applications).

I will try to reload the Spotlight index and report back

iandundas commented 4 years ago

Well it works now. I think I had the wrong path to my Xcode when running lsregister -f /Applications/Xcode.app - so that would explain why it didn't work 🙄

seanhenry commented 4 years ago

Great, I'm glad it's working 👍