George McKibbin
George McKibbin

Reputation: 1291

How can I change the mouse's i-beam cursor in Xcode?

I use a dark background when I code in xcode 5.0.2 and maybe I'm just getting old but it makes it really hard to see the cursor when hovering over text.

I tried the solution on this question: Changing the mouse's i-beam cursor in Xcode 4

but it had no effect unfortunately.

Any suggestions?

Upvotes: 4

Views: 4683

Answers (4)

Noam
Noam

Reputation: 628

Here is a working fix for Xcode 9 (mac Sierra 10.12.6), using Mousecape:

  • Download Mousecape here

  • Download the cursor here. (this is the DVTIbeamCursor.tiff file built for Mousecape)

  • Run Mousecape and import the cursor
  • Apply the cursor

Unfortunately the modified cursor will be lost after a reboot. To fix that do the following:

  • Right-click on the Mousecape app and select "Show package content"
  • look for the .app file at: Mousecape.app/Contents/Library/LoginItems/com.alexzielenski.mousecloakhelper.app

  • Manually add this app to your login items and you'll be all set

Upvotes: 4

SlickDev
SlickDev

Reputation: 615

Haven't been able to get this to work in xcode 8. What I eventually ended up doing is just setting the background color in the editor to dark dark gray instead of black (#222222 or #111111) and it's helped tremendously.

Upvotes: 1

Dan Beaulieu
Dan Beaulieu

Reputation: 19954

Here's the solution you'll find by using the link that @aldryd provided in the comments to the answer. GitHub user sokobania provides the following steps:

Step 1:

Download ThemeEngine from: https://github.com/alexzielenski/ThemeEngine

Step 2:

Run ThemeEngine in Xcode and you may be presented with a few errors.

  1. Failed to code sign "ThemeEngine".

    • Just click Fix Issue
  2. Nullability specifier '_Nonnull' cannot be applied to non-pointer type 'NSString'; did you mean to apply the specifier to the pointer?

    • Allow Xcode to Resolve

Step 3:

We'll need to remove some derived data from Embedded Binaries. Click your root application > Targets > General > Embedded Binaries and remove the top item:

enter image description here

Step 4:

Run ThemeEngine and select "Open Document", you'll need to locate your Assets.car file in Xcode here:

/Applications/Xcode.app/Contents/SharedFrameworks/
DVTKit.framework/Versions/A/R‌​esources/Assets.car

Step 5:

Once loaded, find DVTIbeamCursor in the list and drag your IBeam of choice over Xcode's default Ibeam.

enter image description here

I like use the Ibeam provided by @TheTC:

dracoventions.com/images/external/TIbeam.tiff

Step 6:

Select "Save As..." and overwrite Xcode's Assets.car file with the new file. I had to save the copy to my desktop and then drag the new Assets.car file into the Xcode folder to overwrite.


Troubleshooting:

I recently tried this solution and I wound up with a bridging-header issue. If that happens click your root project > targets > Build Phases > Link Library With Binaries > Add ThemeKit

Rebuild and you should be good.

Upvotes: 3

Kyle
Kyle

Reputation: 4449

For me, it was as per the post you referenced, at the location:

/Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Versions/A/Resources/DVTIbeamCursor.png

The issue I had however, was that the file had been named as:

DVTl (lowercase 'L'), rather than DVTI (uppercase 'I').

Upvotes: 9

Related Questions