Closed tobatha closed 8 years ago
That would explain why running the script doesn't change the cursor in Xcode 7.3b2
There is another Ibeam file here: /Applications/Xcode-beta.app/Contents/OtherFrameworks/XcodeEdit.framework/Versions/A/Resources/TIbeam.tiff
, but replacing it doesn't change anything.
Same problem with Xcode 7.3b4
+1
Welcoming pull requests for this that are backwards compatible to Xcode pre-7.3 :) @tobatha @tomaskraina @maxsz @allen-zeng @hirad
Well... I spent a long time looking for the new location of the cursor file. Haven't been able to find it yet.
Now that Xcode 7.3 has been released I took another look through the DVTKit.framework
resources and noticed Assets.car
(full path: /Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Versions/A/Resources/Assets.car
) which contains, among many other assets, DVTIbeamCursor.png
and DVTIbeamCursor@2x.png
.
Unfortunately I don't have experience working with .car
files but I eventually found https://github.com/alexzielenski/ThemeEngine. The application seems to be designed to work with Photoshop, but based on https://github.com/alexzielenski/ThemeEngine/issues/23#issuecomment-197539346 I managed to replace DVTIbeamCursor@2x.png
via drag and drop. After backing up the original Assets.car
and replacing it with a modified version Xcode 7.3 appears to use the replaced cursor png.
Huzzah! Will test this in the AM. Thanks for sharing!
Confirmed - updated Assets.car
and all is right again!
Here is Assets.car.zip if you don't want to go through the trouble yourself.
Thanks @cjheng for the investigations!
I can confirm @cjheng's solution is a working one. Thank you!
pull a request & update the tutorial then, i guess~ lol thank you guys, anyway!
I also confirm @cjheng's solution worked for me.
I just had to fix a compile error which I can't remember precisely: NonNull something... I just double clicked the Xcode suggestion to fix it. I also had to go to ThemeKit.framework > Targets > ThemeEngine > General > Embedded binaries and remove the ../../[etc.]/DerivedData
Then menu Product > Run
Once inside ThemeEngine: menu File > open /Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Versions/A/Resources/Assets.car Find DVTIbeamCursor. Click on the icon to the right. Drag from the finder your DVTIbeamCursor.tiff to the icon on the right. Menu File > Save Restart Xcode. :-) Thank you very much!
I have added a PR to update the install.sh script, using the Assets.car file that was added in this thread (thanks @allen-zeng!)
So awesome, thank you!
Looking for the I-Beam all the time using my theme was getting old. Appreciate it.
Great work, thank's a lot
Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Versions/A/Resources/Assets.car
deleting this Assets.car file does the work for me (may be because I had already installed the i-beam cursor in Xcode 7.2).
update: It worked for a while but later Xcode would not even start and crash on launch. So, I replaced the new Assets.car file at the above mentioned location.
When I ran the script in the tutorial I got cp: /Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Resources/DVTIbeamCursor.tiff: No such file or directory
.
After that, the terminal result looks like it changed the cursor but I can't really see a difference: Copying the improved ibeam cursor to the correct location Removing downloaded image
.
@ebaker355 I'm really interested in your binary diff script. It sounds like a good enough solution. Please reopen your pull request once you have it working. Thanks!
Updated README to reflect this manual workaround. Thanks all for looking into it.
The PR has been reopened with the updated install script. Sorry it took so long!
Please could you provide instructions on how to use your updated install script? Thanks
@oliverfoggin Sure. The easiest way to test the script:
curl -O https://raw.githubusercontent.com/ebaker355/better-xcode-ibeam-cursor/master/install.sh
chmod a+x install.sh
Edit the GITHUB_URL
constant path (line 4), change "egold" to "ebaker355" (this is only needed until the PR is merged; it allows the script to find the patch files in my fork).
Then, simply:
./install.sh
The output should be similar to:
Updating I-beam cursor for Xcode at path /Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Resources
Downloading cursor patch file to /tmp/Assets.car-Xcode-7.3.bspatch
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1431 100 1431 0 0 1553 0 --:--:-- --:--:-- --:--:-- 1552
Downloaded successfully.
Creating backup of Assets.car -> backup-Assets.car
Xcode has been patched successfully. Please restart Xcode and have fun!
@ebaker355 thanks. At the moment when I do that I get the output...
Olivers-MBP:Documents oliverfoggin$ ./install.sh
Updating I-beam cursor for Xcode at path /Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Resources
Downloading cursor replacement file to /tmp/DVTIbeamCursor.tiff
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9 100 9 0 0 27 0 --:--:-- --:--:-- --:--:-- 27
Download failed.
I tried with sudo also.
I'll take a look through the install.sh to see if I can work out what's happening.
Thanks
@oliverfoggin ah, i see you're testing it with an older (< 7.3) version of Xcode... that's good, as I was only able to test with 7.3.
Oh, I think I know the cause... one minute, please, and I'll update the script.
@ebaker355 Xcode Version 7.3 (7D175)
New install (from AppStore) on a new computer so no updates applied.
Strange... is there both a DVTIbeamCursor.tiff and an Assets.car file in your /Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Resources path?
Yeah I have both of those files. However, when I try to download this file... https://raw.githubusercontent.com/ebaker355/better-xcode-ibeam-cursor/master/patches/DVTIbeamCursor.tiff manually I get a damaged file. Could that be the problem?
Yes... i have the wrong path to the updated DVTIbeamCursor.tiff file in the script. I am currently updating the script to fix that.
But, its puzzling, because, I thought that DVTIbeamCursor.tiff file was no longer used in Xcode 7.3. Please try moving that file out of the Xcode directory, then re-run the script. It should update the Assets.car file.
That worked! Thanks. I renamed the DVTIbeamCursor.tiff file and then got the output...
Updating I-beam cursor for Xcode at path /Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Resources
Downloading file Assets.car-Xcode-7.3.bspatch
Downloading cursor patch file to /tmp/Assets.car-Xcode-7.3.bspatch
Downloading from - https://raw.githubusercontent.com/ebaker355/better-xcode-ibeam-cursor/master/patches/Assets.car-Xcode-7.3.bspatch
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1431 100 1431 0 0 4459 0 --:--:-- --:--:-- --:--:-- 4471
Downloaded successfully.
Creating backup of Assets.car -> backup-Assets.car
(I added some extra debugging lines to the script).
Restarting Xcode then got the new cursor thanks :D
Awesome! Glad it worked.
So, as of now, the script assumes that either the Assets.car file or the DVTIbeamCursor.tiff file exists, but not both. The Assets.car file is new with Xcode 7.3. It checks for the existence of the tiff file first, but I'm thinking it should check for Assets.car first.
Also, the script will only update one file or the other. I'm wondering if it should update both files, if they both exist.
Anyone have thoughts on this?
I agree that it should probably check for the Assets.car file first and use that to assume 7.3+.
I did manually update the .tiff file but it had no effect on the cursor in Xcode. I can't say for certain that it isn't used anywhere else though? Is it left behind as a legacy item in that particular framework maybe?
I don't see there being any harm in updating both files though.
@oliverfoggin Wondering... did you update to Xcode 7.3 thru the App Store? That may have left the older file behind. For my installation, I removed the old Xcode.app directory, and installed 7.3 from the .dmg file.
Thanks for all your testing, btw! :D
@ebaker355 I'm on a brand new computer that I only got on Monday and I installed Xcode 7.3 straight from the AppStore.
No updates have been applied to Xcode. Just a straight install from AppStore.
Thanks
@oliverfoggin Ok, thanks!
The script has been updated to look for Assets.car before DVTIbeamCursor.tiff. It still only updates the first one of these files that is found.
Does anybody have clear instructions as to how to get this to work? I have tried the steps above but my download still fails (irrespective of the presence of .car or .tiff)
cc: @ebaker355 @oliverfoggin
@kartikthapar I'm sorry you're experiencing difficulties with the script. Can you please paste your Terminal session here? Perhaps I can help troubleshoot. Thanks!
@ebaker355 Instead of checking for the existence of both files, wouldn't it be better to check first for the version of Xcode (if it's possible)? And then, according to the version, do whatever seems needed (AND check for the existence of THE file to change).
@sokobania Good question! The problems I saw with that approach were:
I think the file approach is more flexible for these reasons. We take the extra step of validating the SHA's of the files we find, to ensure our patches are compatible. That way, if future versions of Xcode use new versions of these files, or if the files are replaced (or renamed), we can simply generate new patches and update the script as needed.
I have added support for Xcode 7.3.1 to the PR.
Anyone experiencing issues with the installer?
Just updated to 7.3.1 and had to run the script again. I made sure to get the latest version and change egold to ebaker355.
Anyway, it worked perfectly.
Thanks
I had an issue with the installer for 7.3.1.
File checksum mismatch.
Assets.car - c5422358f21247b31921b1e9fee421e2c7c84c41
Patch cannot be applied.
Turned out that the install script got confused with the path to xcode and used path to an previously installed beta. Deleting the old beta fixed the issue.
My bad. The installation actually worked for the released version of Xcode but I when I saw the error for the beta I assumed that it was for the released version.
@Sjolin I had to rerun the script again for 7.3.1, too, but it didn't work for me. I restarted Xcode, also.
MacBookPro:~ fbara$ curl -L https://raw.githubusercontent.com/egold/better-xcode-ibeam-cursor/master/install.sh | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1161 100 1161 0 0 3132 0 --:--:-- --:--:-- --:--:-- 3137
Downloading new image
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 31380 100 31380 0 0 90650 0 --:--:-- --:--:-- --:--:-- 90956
Backing up the original cursor that ships with xcode to ./backup-DVTIbeamCursor.tiff
Copying the improved ibeam cursor to the correct location
Removing downloaded image
Done - restart Xcode and have fun!
@ebaker355 Beautiful shell scripting. Once I changed the GITHUB_URL
, it worked like a charm. I kiss you!
@Sjolin Hmm, it looks like the script updated the wrong file for Xcode 7.3.1. It should be updating Assets.car, not DVTIbeamCursor.tiff. Strange. I will run some tests to see what's happening there. Either way, DVTIbeamCursor.tiff is no longer used by Xcode, so that would explain why Xcode isn't using the updated cursor.
@claybridges Great to hear! Thanks!
Worked perfectly for me as well!
I ran the script again (Xcode 7.3.1) but don't see the updated cursor. I don't know if the install.sh
has been updated with what everyone has been discussing for the last few weeks.
MacBookPro:~ fbara$ curl -L https://raw.githubusercontent.com/egold/better-xcode-ibeam-cursor/master/install.sh | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1161 100 1161 0 0 1412 0 --:--:-- --:--:-- --:--:-- 1412
Downloading new image
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 31380 100 31380 0 0 41080 0 --:--:-- --:--:-- --:--:-- 41073
Backing up the original cursor that ships with xcode to ./backup-DVTIbeamCursor.tiff
Password:
Copying the improved ibeam cursor to the correct location
Removing downloaded image
Done - restart Xcode and have fun!
@fbara this hasn't been merged yet, you need to grab it from @ebaker355's fork:
curl -L https://raw.githubusercontent.com/ebaker355/better-xcode-ibeam-cursor/master/install.sh
Once you have install.sh
downloaded, you also need to open it up and update the GITHUB_URL
to also point to @ebaker355's fork:
GITHUB_URL="https://raw.githubusercontent.com/ebaker355/better-xcode-ibeam-cursor/master"
After this it should work!
Thanks @ntpeters, that worked! I thought it was already merged, sorry.
Fixed in #17 -- thanks @ebaker355 !
Hey, anybody downloaded Xcode 7.3 beta 2, and tried to replace the cursor but found no *cursor.tiff under the directory?