Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to scrub personal information from an xcode project?

Tags:

xcode

macos

I would like to upload an iOS project to github (or basically anywhere) but before I do that, I'd like to know if there is an automated process or someway to export the project by scrubbing all/any personal information from the project such as:

  1. Name & Organization details (from the class files as well)
  2. Profile information
  3. Any other bits of potentially "personal" information (that I haven't mentioned)
like image 246
staticVoidMan Avatar asked Jan 17 '14 06:01

staticVoidMan


People also ask

How do I delete references in XCode?

To remove reference, in XCode, right click on the file then Delete . A pop-up will show asking if you want to move to trash or remove reference .

What does clean do in XCode?

2. Clean the Build Folder. This will delete all of the products and intermediate files in the build folder. To clean the build folder you can use the shortcut Command+Option+Shift+K or Menu Bar → Product → Hold Option Key → Clean build Folder .

How do I delete a test in XCode project?

You can either right click the test and delete or select the target then select the minus symbol ( - ) at the bottom of the Document Navigator pane.


1 Answers

So... all I had asked was to upload a project to GitHub or anywhere with minimal (preferably none) personal information.

For GitHub:

I created a file called .gitignore and have the following contents in it (specifically in context with the question)

#Xcode

xcuserdata
*.xcworkspace

This ignores the mentioned files/folders during a commit.
I should have read about Git earlier but anyways...


Whereas... normally

When I share/manually upload a project, I just delete the following folders before uploading to, say, dropbox:

  1. ~.xcodeproj/xcuserdata
  2. ~.xcodeproj/project.xcworkspace

PS: These files and folders return when you open the project again.


Furthermore

An irritating step ahead...

To prevent my Mac username from being auto-filled in the default comments (you know... alongwith the boiler plate code), I just went ahead and edited the default Xcode File Templates (since I am a bit crazy)

The templates are located here:

  1. iOS templates
    • /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/File Templates/Cocoa Touch/
  2. OSX templates
    • /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/File Templates/

Note: the .h and .m templates are nested inside

Change the ___FULLUSERNAME___ (and maybe the ___COPYRIGHT___) parameter to something... static ;P

Original template should look like this:

//
// ___FILENAME___
// ___PROJECTNAME___
//
// Created by ___FULLUSERNAME___ on ___DATE___.
//___COPYRIGHT___
//

PS: Make a backup of the modified templates... incase Apple resets them to the default template


Lastly... I just ensure I don't enter any personal information anywhere (yeah.... totally lame)

like image 136
staticVoidMan Avatar answered Oct 06 '22 14:10

staticVoidMan