xcode-wakatime: Cant install wakatime in Xcode 14 stable version

just installed new xcode but all messages show:

 cp: cannot overwrite directory//Applications/XcodeWithPlugins.app/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS16.0.sdk with non-directory /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS16.0.sdk
cp: cannot overwrite directory /Applications/XcodeWithPlugins.app/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/usr/include/libxml2/libxml with non-directory /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/usr/include/libxml2/libxml
cp: cannot overwrite directory /Applications/XcodeWithPlugins.app/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/Library/Xcode/PrivatePlugIns/IDEAppleTVSupportCore.framework/Resources with non-directory /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/Library/Xcode/PrivatePlugIns/IDEAppleTVSupportCore.framework/Resources
cp: cannot overwrite directory /Applications/XcodeWithPlugins.app/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/Library/Xcode/PrivatePlugIns/IDEAppleTVSupportCore.framework/Versions/Current with non-directory /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/Library/Xcode/PrivatePlugIns/IDEAppleTVSupportCore.framework/Versions/Current
cp: cannot overwrite directory /Applications/XcodeWithPlugins.app/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/Library/Xcode/PrivatePlugIns/IDEAppleTVSupportCore.framework/Headers with non-directory /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/Library/Xcode/PrivatePlugIns/IDEAppleTVSupportCore.framework/Headers
cp: cannot overwrite directory /Applications/XcodeWithPlugins.app/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/Library/Xcode/PrivatePlugIns/IDEAppleTVSupportCore.framework/Modules with non-directory /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/Library/Xcode/PrivatePlugIns/IDEAppleTVSupportCore.framework/Modules

and everything is full of that warning after that it failed. do new version is not updated yet? im using curl -fsSL https://raw.githubusercontent.com/wakatime/xcode-wakatime/master/install.sh | sh -s copy the first time is success but it wont show api key in file menu and dashboard still dont change so i uninstall the clone version and install again but it shows that which i dont know why?

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 1
  • Comments: 19 (4 by maintainers)

Most upvoted comments

Looks like Apple finally completely disabled plugins in Xcode ☹️

This is really sad, I just became an active user of WakaTime, and now I can’t even use it with Xcode, tried every tool out there, and it simply just won’t work with Xcode 14. Why does Apple do these things every single time? 😢

It would be a fairly major refactoring (including lots of code deletion), but the approach I would take to get this working is rename this repo to macos-wakatime and make it work for any Mac app that provides AppleScript/OSA definitions (which is going to be nearly every native AppKit/Obj-C/Swift mac app). The specific wakatime plugins for cross-platform IDEs like Sublime or VSCode should still take preference, but macos-wakatime should be able to handle lesser-used older tools like Dash, TextMate, TextWrangler, BBEdit just as easily as Xcode because it’s all just the OSA API + other system-wide FS & input APIs. This approach would also be a nice fallback for any new code mac-native editors that come on the scene without needing to specifically build & maintain additional wakatime plugins.

I guess my question is: Why was this implemented as an Xcode plugin in the first place, when the venerable macOS AppleScript API will give you all the current-app/current-document information needed for nearly any macOS app (including Xcode)?

For example, if I open up the built-in macOS Script Editor.app and write a rudimentary script:

tell application "Xcode"
	file of active workspace document
end tell

I’ll get back file "Space Phoenix:Users:capnslipp:Development:Projects:Advent of Code 2022:Advent of Code 2022.xcworkspace:". A bit more work and you can introspect into the project’s targets and schemes and source code documents, etc.

(Alternatively, on the command line run osascript -e 'tell app "Xcode" to file of active workspace document' .)

The AppleScript API (formerly known as the Open Scripting Architecture) can be used via AppleScript or JavaScript scripts, or (more importantly) via Obj-C or C APIs and has been around for about 30 years (predating OS X!)

So I never understood why WakaTime fussed with making a custom Xcode plugin specific to that API when they could’ve just solved the problem generally for nearly every macOS app all in one go (with minor tweaks for apps with unusual project/document setups). Is AppleScript and the Script Editor.app that has shipped with macOS for decades really not that well-known or understood? Or as an alternative to AppleScript, has no one right-clicked Xcode in the Dock and found the Accessibility Inspector which similarly is an AI to introspect into the current UI state of any running macOS app? Was my long-time wariness of WakaTime needing to modify Xcode via a plugin when it’s supposed to just be logging basic usage data justified? Or am I missing something here?

No solutions as of yet. This is a very unfortunate move against devs by Apple.

Sad to hear this, I’m wondering if there could be any approach that utilizes accessibility features to track code time for XCode? Like a standalone Wakatime Tracker app or so.

Does anyone tried building on a local machine and try installing it?

Building locally won’t help if Xcode 14 no longer loads plugins.

Or converting the project as an Xcode extension?

Xcode Source Editor extensions can only be run when you manually select them from a menu or manually run the extension’s command, which means a WakaTime plugin wouldn’t be able to automatically track your code time: https://developer.apple.com/documentation/xcodekit