zoukankan      html  css  js  c++  java
  • 在xcode 4.6里添加 Cordova static library 静态库,避免繁琐的官网安装步骤。

       第一次接触Cordova,被官网的安装guide吓到了。后面发现Cordova是个静态库,那就好办了。直接当做静态库引入我们现成的项目中。

    步骤如下:(一开始看这个英文,纠结了很久。好在坚持住了,继续找了另一个资料,两个资料合起来就完美了。所以写下博客,保存起来,希望对大家有帮助)

         按照英文步骤实现。

    Use Cordova for iOS as static library

    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. 不要忘记了头文件的引用(我一开始就忘记这个,纠结了好久)

     

    #ifdef CORDOVA_FRAMEWORK
        #import <Cordova/CDV.h>
    #else
        #import "CDV.h"
    #endif
    

    You would just have:

        #import <Cordova/CDV.h>

     这俩个头文件,最好放到 prefix文件里这样就不用到处写import了。  

  • 相关阅读:
    Connection termination(by client)” 错误的处理方法
    Loadrunner教程读后感-VuGen
    通过HP Loadrunner VuGen来录制安卓的应用
    Test Android with QTP
    Junit单步调试
    魔法方法
    手写配置文件
    理解self与this
    幂等性
    Python assert作用
  • 原文地址:https://www.cnblogs.com/javawebsoa/p/3069745.html
Copyright © 2011-2022 走看看