Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode 7.3 beta 2 unable to find the path no more #16

Closed
tobatha opened this issue Feb 13, 2016 · 56 comments
Closed

Xcode 7.3 beta 2 unable to find the path no more #16

tobatha opened this issue Feb 13, 2016 · 56 comments

Comments

@tobatha
Copy link

tobatha commented Feb 13, 2016

Hey, anybody downloaded Xcode 7.3 beta 2, and tried to replace the cursor but found no *cursor.tiff under the directory?

@tomaskraina
Copy link

That would explain why running the script doesn't change the cursor in Xcode 7.3b2

@maxsz
Copy link

maxsz commented Feb 17, 2016

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.

@allen-zeng
Copy link

Same problem with Xcode 7.3b4

@hirad
Copy link

hirad commented Mar 18, 2016

+1

@egold
Copy link
Owner

egold commented Mar 19, 2016

Welcoming pull requests for this that are backwards compatible to Xcode pre-7.3 :) @tobatha @tomaskraina @maxsz @allen-zeng @hirad

@hirad
Copy link

hirad commented Mar 19, 2016

Well... I spent a long time looking for the new location of the cursor file. Haven't been able to find it yet.

@cjheng
Copy link

cjheng commented Mar 22, 2016

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 alexzielenski/ThemeEngine#23 (comment) 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.

@ClintChil
Copy link

Huzzah! Will test this in the AM. Thanks for sharing!

@allen-zeng
Copy link

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!

@danipralea
Copy link

I can confirm @cjheng's solution is a working one. Thank you!

@tobatha
Copy link
Author

tobatha commented Mar 25, 2016

pull a request & update the tutorial then, i guess~ lol
thank you guys, anyway!

@sokobania
Copy link

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!

@ebaker355
Copy link
Contributor

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!)

@spritekitbook
Copy link

So awesome, thank you!

Looking for the I-Beam all the time using my theme was getting old. Appreciate it.

@LogicException
Copy link

Great work, thank's a lot

@v-i-s-h-a-l
Copy link

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.

@fbara
Copy link

fbara commented Apr 1, 2016

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.

@egold
Copy link
Owner

egold commented Apr 8, 2016

@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!

@egold
Copy link
Owner

egold commented Apr 8, 2016

Updated README to reflect this manual workaround. Thanks all for looking into it.

@ebaker355
Copy link
Contributor

The PR has been reopened with the updated install script. Sorry it took so long!

@oliverfoggin
Copy link

Please could you provide instructions on how to use your updated install script? Thanks

@ebaker355
Copy link
Contributor

@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!

@oliverfoggin
Copy link

@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

@ebaker355
Copy link
Contributor

@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.

@oliverfoggin
Copy link

@ebaker355 Xcode Version 7.3 (7D175)

New install (from AppStore) on a new computer so no updates applied.

@ebaker355
Copy link
Contributor

Strange... is there both a DVTIbeamCursor.tiff and an Assets.car file in your /Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Resources path?

@oliverfoggin
Copy link

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?

@ebaker355
Copy link
Contributor

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.

@oliverfoggin
Copy link

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

@ebaker355
Copy link
Contributor

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?

@oliverfoggin
Copy link

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.

@ebaker355
Copy link
Contributor

@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

@oliverfoggin
Copy link

@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

@ebaker355
Copy link
Contributor

@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.

@kartikthapar
Copy link

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

@ebaker355
Copy link
Contributor

@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!

@sokobania
Copy link

@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).

@ebaker355
Copy link
Contributor

@sokobania Good question! The problems I saw with that approach were:

  • I'm not certain how to retrieve Xcode's version from within a script (may be simple, but I just haven't looked into it)
  • If I did have the version, I'd have to parse it (including betas), then somehow know which action to take based on the version. For example, this original issue may have started with 7.3beta2, or, it may have started earlier, but no one noticed the issue until beta 2.

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.

@ebaker355
Copy link
Contributor

ebaker355 commented Apr 27, 2016

I have added support for Xcode 7.3.1 to the PR.

Anyone experiencing issues with the installer?

@oliverfoggin
Copy link

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

@pwinde
Copy link

pwinde commented May 10, 2016

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.

@pwinde
Copy link

pwinde commented May 10, 2016

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.

@fbara
Copy link

fbara commented May 10, 2016

@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!

@claybridges
Copy link

@ebaker355 Beautiful shell scripting. Once I changed the GITHUB_URL, it worked like a charm. I kiss you!

@ebaker355
Copy link
Contributor

@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!

@ntpeters
Copy link

Worked perfectly for me as well!

@fbara
Copy link

fbara commented May 19, 2016

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!

@ntpeters
Copy link

ntpeters commented May 19, 2016

@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!

@fbara
Copy link

fbara commented May 20, 2016

Thanks @ntpeters, that worked! I thought it was already merged, sorry.

@egold
Copy link
Owner

egold commented Jun 5, 2016

Fixed in #17 -- thanks @ebaker355 !

@egold egold closed this as completed Jun 5, 2016
@collinhundley
Copy link

Anybody having problems with this on Xcode 8? Replacing Assets.car doesn't seem to work for me anymore.

@CrazyGoose
Copy link

Yes, no longer working for me either in Xcode 8.

@ebaker355 ebaker355 mentioned this issue Sep 20, 2016
@AtharvaVaidya
Copy link

I get this if I try to install it for Xcode 8:

Updating I-beam cursor for Xcode at path /Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Resources
File checksum mismatch.
Assets.car - 0c5e6b6ec4619acb461cbc46ab7498eae32534b0
Patch cannot be applied.

@sokobania
Copy link

@AtharvaVaidya This is a good news!
Thank you for having tried to apply the patch (I could not find enough time to test it).
And I would also like to thank ebaker355 for having delivered a patch that does NOT break Xcode when applied to a new version!
While waiting for the next release (for Xcode 8), you could try cjheng's solution (Mar 22) which I commented on Mar 25.

@nrivard
Copy link

nrivard commented Sep 23, 2016

ThemeEngine isn't buildable in xcode 8 and seems to assert whenever i try to open the Assets.car file, so this is unlikely to work in the near future.

@spattisson
Copy link

Any ideas for a solution that works in xcode of recent updates? I'm now on Version 10.2.1 and constantly loosing my mouse cursor when its over a dark terminal background.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests