SwiftMockGeneratorForXcode icon indicating copy to clipboard operation
SwiftMockGeneratorForXcode copied to clipboard

Mock generator not appearing in editor

Open moheny opened this issue 5 years ago • 8 comments

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?

moheny avatar Jan 14 '19 10:01 moheny

Hi @moheny

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

  • [ ] The latest version of this plugin is installed (v0.18)
  • [ ] System Preferences -> Security & Privacy -> Privacy -> Automation shows Swift Mock Generator and Xcode is checked
  • [ ] System Preferences -> Extensions -> Xcode Source Editor shows Mock Generator enabled

seanhenry avatar Jan 14 '19 12:01 seanhenry

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?

moheny avatar Jan 14 '19 12:01 moheny

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.

seanhenry avatar Jan 14 '19 12:01 seanhenry

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.

moheny avatar Jan 14 '19 12:01 moheny

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.

seanhenry avatar Jul 20 '19 15:07 seanhenry

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 avatar Nov 04 '20 15:11 iandundas

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 🙄

iandundas avatar Nov 05 '20 10:11 iandundas

Great, I'm glad it's working 👍

seanhenry avatar Nov 05 '20 12:11 seanhenry