How to change Xcode Project name

前端 未结 18 1485
情深已故
情深已故 2020-12-02 05:32

I have developed my app in Xcode for iPhone, in start I have just named it without secnec now I want to change my app name I have replace my old app name with new one as I h

18条回答
  •  南方客
    南方客 (楼主)
    2020-12-02 06:25

    Just in case this helps someone, I have a shell script (xcmv.sh) with the following:

    #!/usr/bin/env bash
    
    mv $1 $2
    mv $1.xcodeproj $2.xcodeproj
    mv $1.xcworkspace $2.xcworkspace
    
    LC_ALL=C find ./ -type f -not -path "./.git*" -exec sed -i '' "s/${1}/${2}/g" {} +
    

    I then drag this file into the project directory and do:

    sh xcmv.sh Starter MyProject
    

    This changes the project name, the workspace name, plus any and all references to the old name in the project files, code files, plist, and so on.

    As the sample indicates, I often use it to rename one of my various "starter" projects to the desired project name.

    Note the git directory (if it exists) is ignored.

提交回复
热议问题