xcode Phonegap 3 ios 项目名为“HelloWorld”。我怎样才能改变它?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19156507/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 04:00:03  来源:igfitidea点击:

Phonegap 3 ios project is called "HelloWorld". How can I change it?

iosxcodecordova

提问by poiuytrez

I have created a new Phonegap 3 project. When I run:

我创建了一个新的 Phonegap 3 项目。当我运行时:

phonegap build ios

phonegap 构建 ios

An XCode project is created named "HelloWorld". How can I change this project name? Should I do it manually or is there a command integrated in PhoneGap to setup everything right at the project creation? I am trying to avoid as many manual steps as possible.

创建了一个名为“HelloWorld”的 XCode 项目。如何更改此项目名称?我应该手动完成还是在 PhoneGap 中集成了一个命令来在项目创建时正确设置所有内容?我试图避免尽可能多的手动步骤。

采纳答案by poiuytrez

The solution was:

解决方案是:

phonegap create path/to/my-app --id "com.example.app" --name "My App"

phonegap create path/to/my-app --id "com.example.app" --name "My App"

回答by mcondie

If you want to change an existing project:

如果要更改现有项目:

  1. Edit the file ./.cordova/config.json Change the "name" field to your new project name.
  2. Edit the file ./www/config.xml Change the "name" field to your new project name.
  3. Make a copy of your ./platforms/ios directory (optional, only needed if you have modified the ios code directly)
  4. Remove the ./platforms/ios directory.
  5. Run "phonegap run ios"
  1. 编辑文件 ./.cordova/config.json 将“名称”字段更改为您的新项目名称。
  2. 编辑文件 ./www/config.xml 将“名称”字段更改为您的新项目名称。
  3. 复制您的 ./platforms/ios 目录(可选,仅当您直接修改了 ios 代码时才需要)
  4. 删除 ./platforms/ios 目录。
  5. 运行“phonegap run ios”

This will create a new project with the correct name.

这将创建一个具有正确名称的新项目。

回答by Avi

Change the config.xml from the main www directory

从主 www 目录更改 config.xml

 <name>Here is the Name you want to change </name>
    <description>
        here is description of your application
    </description>
 <author email="[email protected]" href="http://yoursite.com">
       My team
 </author>

Now rebuild app with CLI

现在使用 CLI 重建应用程序

phonegap build ios 
phonegap install ios

OR

或者

phonegap run ios

回答by Woodstock

Open up your project >> From top menu "Project" >> "Edit Active Target " >> Under "Packaging" you'll see "Product Name".

打开您的项目>>从顶部菜单“项目”>>“编辑活动目标”>>在“包装”下,您将看到“产品名称”。

回答by givanse

Edit www/config.xml:

编辑www/config.xml

<widget xmlns     = "http://www.w3.org/ns/widgets"
        xmlns:gap = "http://phonegap.com/ns/1.0"
        id        = "your.app.id"
        version   = "1.0.0">
    <name>Here is the Name you want to change </name>
    <description>
        here is description of your application
    </description>
    <author email="[email protected]" href="http://yoursite.com">
        My team
    </author>

Update and rebuild:

更新和重建:

phonegap platform update ios
phonegap run ios

回答by natishka

In Xcode: Select project - Under tab Info - Custom iOS Target - Bundle display name - edit the name

在 Xcode 中:选择项目 - 在选项卡信息下 - 自定义 iOS 目标 - 捆绑显示名称 - 编辑名称

回答by Robert

From the PhoneGapdocumentation:

PhoneGap文档

Launch Terminal.app

Drag the copied bin folder to the Terminal.app icon in your Dock, it should launch a new Terminal window
Type in ./create <project_folder_path> <package_name> <project_name> then press "Enter"