热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

iOS开发之PhoneGap

最近网上搜了一些资料,以前版本的有个安装包,但是最新的版本没有了,他是通过命令行安装并且创建App的,我主要是看的他的文档来

最近网上搜了一些资料,以前版本的有个安装包,但是最新的版本没有了,他是通过命令行安装并且创建App的,我主要是看的他的文档来设置的,呵呵!

这有是我搜到的一些资料:


PhoneGap 2.7 iOS配置安装详细教程


http://www.tuicool.com/articles/7RbURv


Xcode5 + PhoneGap 2.9搭建iOS开发环境-配置-测试-归档上传

http://my.oschina.net/jgy/blog/168745


PhoneGap的介绍

http://blog.sina.com.cn/s/blog_4cdc44df0100uuiq.html



下面是下载地址:

http://phonegap.com/install/



The Cordova Command-line Interface

This guide shows you how to create applications and deploy them tovarious native mobile platforms using thecordova command-lineinterface (CLI). This tool allows you to create new projects, buildthem on different platforms, and run them within an emulator. You canalso use the CLI to initialize project code, after which you usevarious platforms' IDEs to develop them further.


Prerequisites

Before running any command-line tools, you need to install SDKs foreach platform you wish to target.

To add support or rebuild a project for any platform, you need to runthe command-line interface from the same machine that supports theplatform's SDK. The CLI supports the following combinations:


  • iOS (Mac)
  • Android (Mac, Linux)
  • Blackberry (Mac, Windows)
  • Windows Phone 7 (Windows)
  • Windows Phone 8 (Windows)

On the Mac, the command-line is available via the Terminalapplication. On the PC, it's available asCommand Prompt underAccessories.

The more likely it is that you run the CLI from different machines,the more it makes sense to maintain a remote source code repository,whose assets you pull down to local working directories.

To install the cordova command-line tool, follow these steps:


  1. Download and install Node.js. Followinginstallation, you should be able to invoke node ornpm on yourcommand line.

  2. Install the cordova utility. In Unix, prefixing the additionalsudo command may be necessary to install development utilities inotherwise restricted directories:

    $ sudo npm install -g cordova

    The installation log may produce errors for any uninstalledplatform SDKs. Following installation, you should be able to runcordova on the command line.

  3. To ensure permissions are correct, run this command on Mac orLinux, changing LOGIN to match your account name:

    $ sudo chown -R LOGIN /usr/local/lib/node_modules/cordova

After installing the cordova utility, you can always update it tothe latest version by running the following command:

    $ sudo npm update -g cordova

Use this syntax to install a specific version:

    $ sudo npm install -g cordova@2.8.0

Run the info command for a listing that includes the current versionalong with other available version numbers:

    $ npm info cordova

Create an App

Go to the directory where you maintain your source code, and run acommand such as the following:

    $ cordova create HelloWorld com.example.hello "Hello World"

The first argument specifies a HelloWorld directory to be generatedfor your project. Itswww subdirectory houses your application'shome page, along with various resources undercss, js, and img,which follow common web development file-naming conventions. Theconfig.xml file contains important metadata needed to generate anddistribute the application.

The other two arguments are optional: the com.example.hello argumentprovides your project with a reverse-domain-style identifier, and the"Hello World!" provides the application's display text. You can editboth of these values later in the config.xml file.


Add Platforms

All subsequent commands need to be run within the project's directory,or any subdirectories within its scope:

    $ cd HelloWorld

Before you can build the project, you need to specify a set of targetplatforms. Your ability to run these commands depends on whether yourmachine supports each SDK, and whether you have already installed eachSDK. Run any of these from a Mac:

    $ cordova platform add ios$ cordova platform add android$ cordova platform add blackberry

Run any of these from a Windows machine, where wp refers todifferent versions of the Windows Phone operating system:

    $ cordova platform add wp7$ cordova platform add wp8$ cordova platform add android$ cordova platform add blackberry

Run this to check your current set of platforms:

    $ cordova platforms ls

(Note the platform and platforms commands are synonymous.)

Run either of the following synonymous commands to remove a platform:

    $ cordova platform remove blackberry$ cordova platform rm android

Running commands to add or remove platforms affects the contents ofthe project'splatforms directory, where each specified platformappears as a subdirectory. Thewww source directory is reproducedwithin each platform's subdirectory, appearing for example inplatforms/ios/www orplatforms/android/assets/www. By default,each platform's configuration file is set up to be able to access allof Cordova's APIs.

If you wish, you can use an SDK at this point to open the project youcreated. However, any edits you make to the project within an SDKaffect the derivative set of assets, not the original cross-platformsource files. Use this approach if you simply want to initialize aproject.Read on if you wish to use command-line tools for the entiredevelopment cycle.


Build the App

By default, the cordova create script generates a skeletal web-basedapplication whose home page is the project'swww/index.html file.Edit this application however you want, but any initialization shouldbe specified as part of thedeviceready event handler, referenced bydefault from www/js/index.js.

Run the following command to iteratively build the project:

    $ cordova build

This generates platform-specific code within the project's platformssubdirectory. You can optionally limit the scope of each build tospecific platforms:

    $ cordova build ios

The cordova build command is a shorthand for the following, which inthis example is also targeted to a single platform:

    $ cordova prepare ios$ cordova compile ios

In this case, once you run prepare, you can use Apple's Xcode SDK asan alternative to modify and compile the platform-specific code thatCordova generates withinplatforms/ios. You can use the sameapproach with other platforms' IDEs.


View the App in an Emulator

SDKs for mobile platforms come bundled with emulators that execute adevice image, so that you can launch the app from the home screen andsee how it interacts with many platform features. Run a command suchas the following to rebuild the app and view it within a specificplatform's emulator:

    $ cordova emulate android

Some mobile platforms emulate a particular device by default, such asthe iPhone for iOS projects. For other platforms, you may need tofirst associate a device with an emulator.For example, you may first run theandroid command to launch theAndroid SDK, then run a particular device image, which launches itaccording to its default behavior:

Following up with the cordova emulate command refreshes the emulatorimage to display the latest application, which is now available forlaunch from the home screen:




推荐阅读
  • MATLAB字典学习工具箱SPAMS:稀疏与字典学习的详细介绍、配置及应用实例
    SPAMS(Sparse Modeling Software)是一个强大的开源优化工具箱,专为解决多种稀疏估计问题而设计。该工具箱基于MATLAB,提供了丰富的算法和函数,适用于字典学习、信号处理和机器学习等领域。本文将详细介绍SPAMS的配置方法、核心功能及其在实际应用中的典型案例,帮助用户更好地理解和使用这一工具箱。 ... [详细]
  • 本文介绍了如何在 macOS 上安装 HL-340 USB 转串口驱动,并提供了详细的步骤和注意事项。包括下载驱动、关闭系统完整性保护、安装驱动以及验证安装的方法。 ... [详细]
  • 在CentOS 7环境中安装配置Redis及使用Redis Desktop Manager连接时的注意事项与技巧
    在 CentOS 7 环境中安装和配置 Redis 时,需要注意一些关键步骤和最佳实践。本文详细介绍了从安装 Redis 到配置其基本参数的全过程,并提供了使用 Redis Desktop Manager 连接 Redis 服务器的技巧和注意事项。此外,还探讨了如何优化性能和确保数据安全,帮助用户在生产环境中高效地管理和使用 Redis。 ... [详细]
  • 本文将详细介绍如何在Mac上安装Jupyter Notebook,并提供一些常见的问题解决方法。通过这些步骤,您将能够顺利地在Mac上运行Jupyter Notebook。 ... [详细]
  • 在对WordPress Duplicator插件0.4.4版本的安全评估中,发现其存在跨站脚本(XSS)攻击漏洞。此漏洞可能被利用进行恶意操作,建议用户及时更新至最新版本以确保系统安全。测试方法仅限于安全研究和教学目的,使用时需自行承担风险。漏洞编号:HTB23162。 ... [详细]
  • 本指南介绍了如何在ASP.NET Web应用程序中利用C#和JavaScript实现基于指纹识别的登录系统。通过集成指纹识别技术,用户无需输入传统的登录ID即可完成身份验证,从而提升用户体验和安全性。我们将详细探讨如何配置和部署这一功能,确保系统的稳定性和可靠性。 ... [详细]
  • Python 伦理黑客技术:深入探讨后门攻击(第三部分)
    在《Python 伦理黑客技术:深入探讨后门攻击(第三部分)》中,作者详细分析了后门攻击中的Socket问题。由于TCP协议基于流,难以确定消息批次的结束点,这给后门攻击的实现带来了挑战。为了解决这一问题,文章提出了一系列有效的技术方案,包括使用特定的分隔符和长度前缀,以确保数据包的准确传输和解析。这些方法不仅提高了攻击的隐蔽性和可靠性,还为安全研究人员提供了宝贵的参考。 ... [详细]
  • 体积小巧的vsftpd与pureftpd Docker镜像在Unraid系统中的详细配置指南:支持TLS加密及IPv6协议
    本文详细介绍了如何在Unraid系统中配置体积小巧的vsftpd和Pure-FTPd Docker镜像,以支持TLS加密和IPv6协议。通过这些配置,用户可以实现安全、高效的文件传输服务,适用于各种网络环境。配置过程包括镜像的选择、环境变量的设置以及必要的安全措施,确保了系统的稳定性和数据的安全性。 ... [详细]
  • 在Ubuntu系统中安装Android SDK的详细步骤及解决“Failed to fetch URL https://dlssl.google.com/”错误的方法
    在Ubuntu 11.10 x64系统中安装Android SDK的详细步骤,包括配置环境变量和解决“Failed to fetch URL https://dlssl.google.com/”错误的方法。本文详细介绍了如何在该系统上顺利安装并配置Android SDK,确保开发环境的稳定性和高效性。此外,还提供了解决网络连接问题的实用技巧,帮助用户克服常见的安装障碍。 ... [详细]
  • 技术分享:使用 Flask、AngularJS 和 Jinja2 构建高效前后端交互系统
    技术分享:使用 Flask、AngularJS 和 Jinja2 构建高效前后端交互系统 ... [详细]
  • 在分析和解决 Keepalived VIP 漂移故障的过程中,我们发现主备节点配置如下:主节点 IP 为 172.16.30.31,备份节点 IP 为 172.16.30.32,虚拟 IP 为 172.16.30.10。故障表现为监控系统显示 Keepalived 主节点状态异常,导致 VIP 漂移到备份节点。通过详细检查配置文件和日志,我们发现主节点上的 Keepalived 进程未能正常运行,最终通过优化配置和重启服务解决了该问题。此外,我们还增加了健康检查机制,以提高系统的稳定性和可靠性。 ... [详细]
  • 本文详细解析了 Yii2 框架中视图和布局的各种函数,并综述了它们在实际开发中的应用场景。通过深入探讨每个函数的功能和用法,为开发者提供了全面的参考,帮助他们在项目中更高效地利用这些工具。 ... [详细]
  • 为了在Hadoop 2.7.2中实现对Snappy压缩和解压功能的原生支持,本文详细介绍了如何重新编译Hadoop源代码,并优化其Native编译过程。通过这一优化,可以显著提升数据处理的效率和性能。此外,还探讨了编译过程中可能遇到的问题及其解决方案,为用户提供了一套完整的操作指南。 ... [详细]
  • 在 CentOS 7 系统中安装 Scrapy 时遇到了一些挑战。尽管 Scrapy 在 Ubuntu 上安装简便,但在 CentOS 7 上需要额外的配置和步骤。本文总结了常见问题及其解决方案,帮助用户顺利安装并使用 Scrapy 进行网络爬虫开发。 ... [详细]
  • 本文详细介绍了批处理技术的基本概念及其在实际应用中的重要性。首先,对简单的批处理内部命令进行了概述,重点讲解了Echo命令的功能,包括如何打开或关闭回显功能以及显示消息。如果没有指定任何参数,Echo命令会显示当前的回显设置。此外,文章还探讨了批处理技术在自动化任务执行、系统管理等领域的广泛应用,为读者提供了丰富的实践案例和技术指导。 ... [详细]
author-avatar
yolo_bean
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有