简体   繁体   中英

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

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

phonegap build 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.

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"

This will create a new project with the correct name.

The solution was:

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

Change the config.xml from the main www directory

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

Now rebuild app with CLI

phonegap build ios 
phonegap install ios

OR

phonegap run ios

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

Edit 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="youremail@example.com" href="http://yoursite.com">
        My team
    </author>

Update and rebuild:

phonegap platform update ios
phonegap run ios

From the PhoneGap documentation :

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"

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM