Как изменить название приложения для iOS? - PullRequest
937 голосов
/ 27 октября 2008

На днях я начал проект iPhone с глупым кодовым названием разработки, и теперь я хочу изменить название проекта, так как он почти закончен.

Но я не уверен, как это сделать с XCode, пробуя очевидное изменение имени приложения в файле info.plist, что приводит к сбою процесса подписи (я думаю ...), и мое приложение победило ' не запускается с ошибкой запуска.

Полагаю, я мог бы создать новый проект и скопировать все, но это кажется таким примитивным, что я надеюсь на более цивилизованное решение.

Ответы [ 33 ]

4 голосов
/ 06 июня 2015

Ссылка ниже работает для Xcode 6, особенно если вы получаете ошибку после попытки переименовать ваш проект. По сути, просто попробуйте создать новую схему вашего приложения.

https://stackoverflow.com/a/27572164/4114835

1 голос
/ 18 мая 2017

Вы можете перейти из info.plist с атрибутом «Имя пакета».

0 голосов
/ 01 октября 2018

Шаг 1 - переименование проекта

Click on the project you want to rename in the "Project navigator" on the left of the Xcode view.
On the right select the "File inspector" and the name of your project should be in there under "Identity and Type", change it to the new name.
Click "Rename" in a dropdown menu

Шаг 2 - переименование схемы

In the top bar (near "Stop" button), there is a scheme for your OLD product, click on it, then go to "Manage schemes"
Click on the OLD name in the scheme, and it will become editable, change the name

Шаг 3 - Переименуйте папку с вашими активами

Quit Xcode
In the correctly named master folder, there is a newly named xcodeproj file with the the wrongly named OLD folder. Rename the OLD folder to your new name
Reopen the project, you will see a warning: "The folder OLD does not exist", dismiss the warning
In the "Project navigator" on the left, click the top level OLD folder name
In Utilities pane under "Identity and type" you will see the "Name" entry, change this from the OLD to the new name
Just below there is a "Location" entry. Click on a folder with the OLD name and chose the newly renamed folder

Шаг 4 - переименование данных списка сборки

Click on the project in the "Project navigator" on the left, in the main panel select "Build Settings"
Search for "plist" in this section
Under packaging, you will see Info.plist, and Product bundle identifier
Rename the top entry in Info.plist
Do the same for Product Identifier

Наконец, вы сделали и можете восстановить (Command + Shift + K, чтобы очистить, Command + B, чтобы построить)

При использовании CocoaPods После шага 2:

Quit XCode.
In the master folder, rename OLD.xcworkspace to NEW.xcworkspace.

После шага 4:

In XCode: choose and edit Podfile from the project navigator. You should see a target clause with the OLD name. Change it to NEW.
Quit XCode.
In the project folder, delete the OLD.podspec file.
rm -rf Pods/
Run pod install.
Open XCode.
Click on your project name in the project navigator.
In the main pane, switch to the Build Phases tab.
Under Link Binary With Libraries, look for libPods-OLD.a and delete it.
If you have an objective-c Bridging header go to Build settings and change the location of the header from OLD/OLD-Bridging-Header.h to NEW/NEW-Bridging-Header.h
Clean and run.
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...