seanhenry / SwiftMockGeneratorForXcode

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

Extension doesn't work on Big Sur #43

Closed MattAydin closed 3 years ago

MattAydin commented 3 years ago

Hey guys,

I just updated to the Big Sur beta 10 with Xcode 12.1. However, when I try to generate mocks, the option isn't available for me anymore in the editor menu.

Any idea why?

Thanks!

MattAydin commented 3 years ago

Any update on this?

seanhenry commented 3 years ago

Hi @MattAydin

Thanks for raising this issue and sorry for the late reply. I haven't updated to Big Sur yet but Xcode plugins can disappear sometimes especially if you have multiple Xcode apps installed. When this happens to me I follow the steps in the Troubleshooting section of the readme to refresh the plugins. Let me know if that doesn't work.

dannypier commented 3 years ago

@seanhenry Also having an issue with this. Did full uninstall/reinstall and not seeing it in editor menu.

Plugin shown when executing pluginkit -m -p com.apple.dt.Xcode.extension.source-editor -A -D -vvv

+    codes.seanhenry.MockGeneratorApp.XcodePlugin(0.25)
                Path = /Applications/Swift Mock Generator for Xcode.app/Contents/PlugIns/Mock Generator.appex
                UUID = BABBE269-D921-4AC2-BFA7-B9DB13BA47A6
           Timestamp = 2020-10-28 17:54:34 +0000
                 SDK = com.apple.dt.Xcode.extension.source-editor
       Parent Bundle = /Applications/Swift Mock Generator for Xcode.app
        Display Name = Mock Generator
          Short Name = Mock Generator
         Parent Name = Swift Mock Generator for Xcode

 (1 plug-in)
MattAydin commented 3 years ago

Hey @seanhenry, thanks for your reply. I have already followed the steps stated in the troubleshooting section. Still no luck unfortunately. I am using Xcode version 12.1. Also as @dannypier states above, I have the same response when running that command as well.

seanhenry commented 3 years ago

Ok, just to make sure we're on the same page:

  1. Go to System Preferences -> Extensions -> Xcode Source Editor and make sure the plugin is visible and checked.
  2. Run the following command in Terminal to refresh the plugins - double check the path the Xcode is correct on your machine. If you have multiple versions of Xcode installed then you must point to Xcode 12.1.
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f /Applications/Xcode.app

If you have already tried the above and it's still not working then you may have to search through the console logs:

  1. Open Console.app (/Applications/Utilities/Console.app)
  2. Go to system.log under Reports on the left
  3. Search for mock and see if there are any logs relating to the plugin

Unfortunately I can't reproduce the problem (on Mojave with Xcode 12.1) and I can't upgrade to the beta right now. But post any clue in the logs that you might find and I might be able to figure this out.

dannypier commented 3 years ago

Thanks for the response @seanhenry. Followed your steps, plugin is visible and checked. No messages in logs. Would post clues here if I had them but the system log doesn't show anything related to mock.

MattAydin commented 3 years ago

On my end it's the same unfortunately. Double checked with the steps you provided above, and also checked the Console.app for any logs related to the plugin. None..

Is there any other way for us to help you find a solution to this issue?

seanhenry commented 3 years ago

Ah, looking at the release notes for Xcode 12:

For compatibility with new security features in macOS 11, Xcode extensions must be built using Xcode 12 and must embed XcodeKit.framework. An Xcode extension rebuilt with these tools remains compatible with older versions of Xcode and macOS. (51822755)

I'll make a new build shortly and I'll post it here first since I can't test it without Big Sur. If this fixes it for you both, I'll create a release

seanhenry commented 3 years ago

Ok, you can download the new version here. Let me know if it works for you and I'll make a release.

dannypier commented 3 years ago

@seanhenry will absolutely test. link is 404'ing for me right now though.

seanhenry commented 3 years ago

I think it was because I made a draft release. Try again now or download the latest release 👍

MattAydin commented 3 years ago

Hey @seanhenry, just downloaded the draft release and as far as I can see right now it works like a charm. I'll keep this issue open until I have double check in next week. If that's okay with you. Thanks for your time and effort!

dannypier commented 3 years ago

also confirming that the latest release fixed me up. thanks for cowboying this fix out @seanhenry!

dannypier commented 3 years ago

May have spoke a smidge too soon. Mock generator now appears in the edit menu again, but upon any generator receive a The file "<Project Name>" could not be found message.

MattAydin commented 3 years ago

Just verified. I just successfully generated a spy on Big Sur using Xcode 12.1. I hope your issue is resolved as well @dannypier. @seanhenry, whenever you feel like it, you can close this issue.

seanhenry commented 3 years ago

It looks like it's working on Big Sur now. @dannypier feel free to open an issue if you are still getting that error.