在xcode 4.6里添加 Cordova static library 静态库,避免繁琐的官网安装步骤。
2013-05-09 19:57
453 查看
第一次接触Cordova,被官网的安装guide吓到了。后面发现Cordova是个静态库,那就好办了。直接当做静态库引入我们现成的项目中。
步骤如下:(一开始看这个英文,纠结了很久。好在坚持住了,继续找了另一个资料,两个资料合起来就完美了。所以写下博客,保存起来,希望对大家有帮助)
按照英文步骤实现。
After version 2.0.0 Cordova library for iOS provided as Xcode project.
The main problem is that you can not open two projects with Cordova, only one.
But you can use the following trick to get around this.
1. Set "Skip install" property of CordovaLib project to "No" 。这个配置要设置NO.跳过安装Cordeva才可以使用的限制。
2. Run "Product" => "Archive" command from menu. After successful build was opened Organizer - Archives(这里是用发布版本)
3. Press "Distribute" button, select "Save Build Products" and press next
4. Save Cordova Library build
5. On file system you can see a files
6. After it you could include this file in own project
6.1 Open "Build Phases" tab and in "Link Binary with Libraries" press plus button, in dialog press "Add Other..." and select libCordova.a file
引入发布版的lib.
6.2 Open "Build Settings" tab, find property with name "Header Search Paths" and write full path to "include" folder of compiled Cordova library
路径是你之前发布lib的位置。直接找到include文件然后把这个文件夹拖进"Header Search Paths"。选择recursive.
7. 不要忘记了头文件的引用(我一开始就忘记这个,纠结了好久)
You would just have:
这俩个头文件,最好放到 prefix文件里这样就不用到处写import了。
步骤如下:(一开始看这个英文,纠结了很久。好在坚持住了,继续找了另一个资料,两个资料合起来就完美了。所以写下博客,保存起来,希望对大家有帮助)
按照英文步骤实现。
Use Cordova for iOS as static library
By admin on Thu, 02/28/2013 - 11:10After version 2.0.0 Cordova library for iOS provided as Xcode project.
The main problem is that you can not open two projects with Cordova, only one.
But you can use the following trick to get around this.
1. Set "Skip install" property of CordovaLib project to "No" 。这个配置要设置NO.跳过安装Cordeva才可以使用的限制。
2. Run "Product" => "Archive" command from menu. After successful build was opened Organizer - Archives(这里是用发布版本)
3. Press "Distribute" button, select "Save Build Products" and press next
4. Save Cordova Library build
5. On file system you can see a files
6. After it you could include this file in own project
6.1 Open "Build Phases" tab and in "Link Binary with Libraries" press plus button, in dialog press "Add Other..." and select libCordova.a file
引入发布版的lib.
6.2 Open "Build Settings" tab, find property with name "Header Search Paths" and write full path to "include" folder of compiled Cordova library
路径是你之前发布lib的位置。直接找到include文件然后把这个文件夹拖进"Header Search Paths"。选择recursive.
7. 不要忘记了头文件的引用(我一开始就忘记这个,纠结了好久)
#ifdef CORDOVA_FRAMEWORK #import <Cordova/CDV.h> #else #import "CDV.h" #endif
You would just have:
#import <Cordova/CDV.h>
这俩个头文件,最好放到 prefix文件里这样就不用到处写import了。
相关文章推荐
- 使用Xcode创建Cocoa Touch Static Library(静态库)
- 使用Xcode 5创建Cocoa Touch Static Library(静态库)
- xcode添加static library project
- xcode添加static library project
- 使用Xcode 5创建Cocoa Touch Static Library(静态库)
- iOS 静态库编译Cocoa Touch Static Library(Xcode 4.4.1)
- 使用Xcode 5创建Cocoa Touch Static Library(静态库)
- Creating a Static Library with Xcode 4.6 or Higher
- Cocos2d-x在xcode下开发生成静态库添加到项目
- IOS在Xcode 4.x以上如何添加静态库
- Xcode添加静态库以及编译选项配置常见问题
- Cordova添加android平台时选择安装版本
- Kudu安装(官网推荐的步骤)(installing build Kudu from source)
- xcode 4.02 创建静态库及其使用的简单步骤
- xcode7.1安装cocoapods步骤
- 安装Alcatraz来管理Xcode插件的步骤和注意点
- 关于静态库(Static library or Archive library)
- 工作备忘-Xcode添加静态库以及编译选项配置常见问题
- XCode: 添加自定义代码片段到Code Snippets Library(常见代码段高效使用)
- xcode添加framework 静态库用SRCROOT 相对路径