Skip to content

Instantly share code, notes, and snippets.

@otanistudio
Last active April 11, 2016 16:24
Show Gist options
  • Save otanistudio/10a946c879f9c5c9a34ca07e203a2802 to your computer and use it in GitHub Desktop.
Save otanistudio/10a946c879f9c5c9a34ca07e203a2802 to your computer and use it in GitHub Desktop.
Sometimes, the XCode's editor gets so messed up that we can't get work done. http://blog.otanistudio.com/post/142635021213/fix-mangled-xcode-editor
#!/bin/bash
cd `dirname "$0"`/..
set -e
USER_STATE_FILE="Mix.xcodeproj/project.xcworkspace/xcuserdata/$USER.xcuserdatad/UserInterfaceState.xcuserstate"
if [ -w $USER_STATE_FILE ]; then
mv $USER_STATE_FILE /var/tmp/
echo "Moved '$USER_STATE_FILE' to /var/tmp/; Check XCode before deleting in case you need to move it back."
else
echo "User state file '$USER_STATE_FILE' doesn't exist or is not writeable"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment