XVimProject / XVim2

Vim key-bindings for Xcode 9
MIT License
2.31k stars 182 forks source link

On macOS Big Sur, after codesign Xcode and try to login to my account, got "Couldn’t communicate with a helper application" #340

Open hyouuu opened 3 years ago

hyouuu commented 3 years ago

Before codesigning, signing into my account worked normally, but after codesign it kept showing the "Couldn’t communicate with a helper application" error - I've tried restarting, delete Xcode and reinstall etc.

Posting here to try to confirm if others are experiencing the same problem on macOS Big Sur. If so, I guess there's no way to use XVim2 normally as it requires codesign? My thinking is keeping 2 copies of Xcode, one untouched to build to devices or upload to App Store, and another one codesigned to use XVim2.

Any ideas and suggestions appreciated!

zoroD commented 3 years ago

Same issue here

Cokile commented 3 years ago

Same issue here

nvowell commented 3 years ago

I just started having this issue today after having Big Sur installed for a while with everything working fine. I deleted/reinstalled Xcode and command line tools several times and after a few tries it just started working again. Maybe this will help someone.

gerram commented 3 years ago

I just started having this issue today after having Big Sur installed for a while with everything working fine. I deleted/reinstalled Xcode and command line tools several times and after a few tries it just started working again. Maybe this will help someone.

This issue appears after signing Xcode files by your XCodeSigner cert that needed XVim2.

langrisser1981 commented 3 years ago

same issue here

Cokile commented 3 years ago

Seems duplicated with #323

pebble8888 commented 3 years ago

@hyouuu

My thinking is keeping 2 copies of Xcode, one untouched to build to devices or upload to App Store, and another one codesigned to use XVim2.

I agree with you.

xiifain commented 3 years ago

is this issue is fixed in XCode 12.3 ? Because I do not want to download 2 versions of xcode just to get VIM running.

gerram commented 3 years ago

is this issue is fixed in XCode 12.3 ? Because I do not want to download 2 versions of xcode just to get VIM running.

It is the same in Xcode 12.3. You can download IDE only one time and make duplicate for keeping without your signing.

iamWing commented 3 years ago

is this issue is fixed in XCode 12.3 ? Because I do not want to download 2 versions of xcode just to get VIM running.

It is the same in Xcode 12.3. You can download IDE only one time and make duplicate for keeping without your signing.

Sorry for a dumb question but what are the steps for this? Is it just duplicate the Xcode.app from application folder and rename it to something else?

gerram commented 3 years ago

You should to download Xcode from Download part of Apple site (not through App Store app). It has name as Xcode_12.3.xip or Xcode_12.2.xip. It is archived Xcode.app. After unarchiving, you get archive + unpacked Xcode.app.

xiifain commented 3 years ago

Download the Xcode.xip from this link https://developer.apple.com/download/more/

After the download is finished, unpack the Xcode and rename the app before moving the app to Applications folder.

Then Codesign to the renamed app and build to the renamed app.

gerram commented 3 years ago

I keep signed by my cert Xcode.app in Application folder and clear (with signed by Apple cert) in other folder. (Example in Download/XCodeClear/)

iamWing commented 3 years ago

@gerram @xiifain Thanks guys. I'll give it a try.

Cokile commented 3 years ago

I resolve this issue by downgrading the MacOS from Big Sur to Catalina, since XVim2 is more useful to me and the latest Xcode is compatible with Catalina.

openingapps commented 3 years ago

is this issue is fixed in XCode 12.3 ? Because I do not want to download 2 versions of xcode just to get VIM running.

It is the same in Xcode 12.3. You can download IDE only one time and make duplicate for keeping without your signing.

And the same in xcode 12.4

Just to verify, the strategy of having two copies of xcode worked for me. The steps were much easier than I thought they would be. To download a copy of the app: 1) Download from https://developer.apple.com/download/more/ 2) Put the downloaded .xip file in a working directory somewhere 2b) If you want two copies, then use two working directories 3) cd to the directory and type "xip -x filename" (22 GB) 4) After 20-30 minutes, you will get a directory called Xcode.app will appear in the current directory (31GB) 5) Rename the Xcode.app directory to something_else.app and move it to /Applications 6) You're good to go. Run your new app like you would any other. 7) As was already pointed out, you probably shouldn't run both copies at the same time!

Now that you have two copies of xcode, you can:

Most operations in xcode do not require you to log in. For me, I only need the clean copy of xcode when:

Cokile commented 3 years ago

is this issue is fixed in XCode 12.3 ? Because I do not want to download 2 versions of xcode just to get VIM running.

I think it's a system-wise security mechanism introduced in Big Sur rather than a Xcode issue, since XVim2 and Xcode 12.3 both work in Catalina on my Mac.

michaeleisel commented 3 years ago

would it be possible to only sign certain parts of xcode so that things still work?

cstlex commented 3 years ago

Has anyone tried replacing signature with certificates for mac development/distribution certificate? If that works we should start replacing signature with the ones that apple provide

r-plus commented 3 years ago

FYI: next version of Xcode 12.5 required Big Sur. https://xcodereleases.com/

adudenamedruby commented 3 years ago

I hope this is not the death of xvim. I have no problem with multiple versions of Xcode (I have like 4 on my system anyway), but, seriously, coding in one xcode and running in a second is super annoying. lol

openingapps commented 3 years ago

The 2-copy work-around is not as bad as you think. You can edit xvim and run you app in the same copy of xcode.

The only time you will require the non-xvim version of xcode is when you need to sign in to an Apple account. For me, this occurs only when:

hanleylee commented 3 years ago

I meet this problem, too. And currently I use 2-copy work-around as simple solution. Hope a better solution occurs!

Climax777 commented 3 years ago

The 2-copy work-around is not as bad as you think. You can edit xvim and run you app in the same copy of xcode.

The only time you will require the non-xvim version of xcode is when you need to sign in to an Apple account. For me, this occurs only when:

  • I want to upload something to the App Store
  • I am running on a new test device, and I need to generate a new key-chain entry.

Care to elaborate? Because I want to run on my iPhone, but required the vanilla xcode to sign my app in order to run it. How can I "Deploy" to my iphone during development with the xvim version?

openingapps commented 3 years ago

Hi Climax777,

For me, I only needed to sign for the first time I use a new device -- and I used "vanilla xcode" to do that. But after the first time, I don't need to sign if I just want to run on my local iphone (through the USB cable).

I'm wondering if you have an Apple developer account or not. I think if you don't have a developer account, you need to generate some sort of local authentication. Maybe that is what is tripping you up??

r-plus commented 3 years ago

Hi guys

I'm testing new workaround for this issue by using MacForge https://github.com/MacEnhance/MacForge that is BigSur supported (but not yet support Apple Silicon?) plugin loader like the SIMBL. I'll push it as pull request after refactoring.

Some refs about SIP:

Climax777 commented 3 years ago

Hi Climax777,

For me, I only needed to sign for the first time I use a new device -- and I used "vanilla xcode" to do that. But after the first time, I don't need to sign if I just want to run on my local iphone (through the USB cable).

I'm wondering if you have an Apple developer account or not. I think if you don't have a developer account, you need to generate some sort of local authentication. Maybe that is what is tripping you up??

The key was to first sign it like you said. It works a treat now. Thanks! A side note, VSCode's swift editing features are really great. I use a combination of both.

tklebanoff commented 3 years ago

software developers in year 2044: "has anybody figured out how to go back to xcode version 12.4? I need it to support my old arm architecture box which got dropped in 2030"

yeah but then you will break xvim

TMTBO commented 3 years ago

Hi guys

I'm testing new workaround for this issue by using MacForge https://github.com/MacEnhance/MacForge that is BigSur supported (but not yet support Apple Silicon?) plugin loader like the SIMBL. I'll push it as pull request after refactoring.

  • MacForge can inject XVim to Apple signed version of Xcode to resolve this issue.
  • But MacForge required disabling SIP and Library Validation to work on recently macOS (probably this instruction is difficult for someone especially not familiar to mac and CLI. Additionally, this means disabling macOS security feature, do it at your own risk.)
  • Not required adding Xcode UUID to Info.plist for loading XVim when Apple release new version of Xcode. (MacForge/SIMBL will not check UUID)

Some refs about SIP:

Hello, do you tried on Macbook Pro with M1? Xcode can not load xvim2 plugin(master branch)

It works now! Only beta version of Macforge support M1 machines!

r-plus commented 3 years ago

@TMTBO stable version (1.1.0) of MacForge not yet supported Apple Silicon.

r-plus commented 3 years ago

By the way, if you disable "Library Validation" macOS system level, original Apple signed Xcode + traditional Xcode plugin system will work well.

  1. sudo defaults write /Library/Preferences/com.apple.security.libraryvalidation.plist DisableLibraryValidation -bool true
  2. then reboot your mac.
  3. uninstall XVim2 from MacForge plugin directory make uninstall
  4. build XVim2 for Xcode plugin system make

This way is not required MacForge.


sorry, also required disabling SIP.

r-plus commented 3 years ago

I'll add this table to readme when all filled.

Xcode OS security configuration loading system x64 arm64
re-codesign (has Apple ID login problem on BigSur) any Xcode Plugin
remove codesign (don't use! this occur tccd problem) ❌ (could not open Xcode)
original disable library-validation
disable library-validation and SIP
SIMBL MacForge 1.1.0 not yet support M1

Tested on macOS 11.2.3, Xcode 12.4

r-plus commented 3 years ago

all filled. original Xcode, disable library-validation and SIP, Xcode Plugin combination works well on M1.

superarts commented 3 years ago

Good job @r-plus! Thanks Apple for not supporting VIM natively, and the bad plugin support.

yingmu52 commented 3 years ago

is this issue is fixed in XCode 12.3 ? Because I do not want to download 2 versions of xcode just to get VIM running.

It is the same in Xcode 12.3. You can download IDE only one time and make duplicate for keeping without your signing.

And the same in xcode 12.4

Just to verify, the strategy of having two copies of xcode worked for me. The steps were much easier than I thought they would be. To download a copy of the app:

  1. Download from https://developer.apple.com/download/more/
  2. Put the downloaded .xip file in a working directory somewhere 2b) If you want two copies, then use two working directories
  3. cd to the directory and type "xip -x filename" (22 GB)
  4. After 20-30 minutes, you will get a directory called Xcode.app will appear in the current directory (31GB)
  5. Rename the Xcode.app directory to something_else.app and move it to /Applications
  6. You're good to go. Run your new app like you would any other.
  7. As was already pointed out, you probably shouldn't run both copies at the same time!

Now that you have two copies of xcode, you can:

  • Use one copy xcode with xvim installed. You can edit and run as you always have in the past.
  • Use a clean copy of xcode (without xvim) for anything that requires you to log in to your apple account.

Most operations in xcode do not require you to log in. For me, I only need the clean copy of xcode when:

  • I want to upload something to the app store
  • I am testing on a new device, and I need to generate a new keychain entry.

this did the trick. thanks

MajkCajk commented 3 years ago

I resolve it with new pure installation of XCode, run projects on all my HW devices for the first time and then add XVim. After that, it runs without problem 👍 Thank you guys, this thread helped me.

thilo-hub commented 2 years ago

Going back to an earlier question, do we need to code sign EVERY executable in Xcode?

The error message look suspiciously, like a separate process is trying to authenticate itself before talking to apple.

communicate with a helper application<<

If we just don't sign this "helper", if anybody knows which that could be, wouldn't that solve the issue?

If you have a suspicion, I'm happy to experiment

superarts commented 2 years ago

I resolve it with new pure installation of XCode, run projects on all my HW devices for the first time and then add XVim. After that, it runs without problem 👍 Thank you guys, this thread helped me.

You may still want to keep an original version as Xcode sign you out automatically from time to time.