Wednesday, 11 September 2019

Fix Rename Failed in Xcode 10

Running a refactor in Xcode can sometimes show "Rename failed" message. This can be fixed by quitting Xcode, cleaning derived data folder and doing a rebuild followed by the refactoring. Below is a script to clean the derived data folder.


#!/bin/bash

# Clean Xcode cache

rm -frd ~/Library/Developer/Xcode/DerivedData/* 
rm -frd ~/Library/Caches/com.apple.dt.Xcode/*
After cleaning the caches, launch Xcode, build the project. Then wait for any indexing tasks to complete. Now try Refactor > Rename and this should work.

No comments:

Post a Comment