How to run a sencha touch project in Xcode emulator

冷暖自知 提交于 2019-12-11 07:38:26

问题


Am creating a App using sencha touch. Am testing the app using chrome, its working fine. Now am moving to Mac OS so i have to run the same app in Xcode to test . Dont know how to run the sencha project in xcode. Please direct me in right direction. Your help is much appreciate. Thanks in advance..


回答1:


You need to use PhoneGap to host it. Have a look at PHONEGAP + XCODE4

Basically, create a PhoneGap project and put you sencha touch stuff in www folder.

Here is another article, which uses UIWebView rather than PhoneGap.




回答2:


As described in phoegap doc

1) Download the latest release of PhoneGap

2) extract its contents

3) Move to phonegap-X.X.X/lib/ios

4) Drag the copied bin folder to the Terminal icon in your Dock, it should launch a new Terminal window

5) Type in ./create ~/Desktop/HelloWorld com.test.first HelloWorld then press "Enter"

~/Desktop/HelloWorld - this is where your project will.

com.test.first - package name

HelloWorld - project_name

6) Locate your new project folder that you just created (phonegap project).

7) Goto www folder and delete all files and folders within www folder except cordova.js.

8) Copy the content of your sencha project (copy the files in side sencha project, not project itself) and past the content of sencha project within www folder.

9) Open your index.html (this file from sencha project you just copied) file and include the cordova.js (this file will be there in www folder) file just like anyother js file.

<script type="text/javascript" src="cordova.js"></script>

10) Now open the project using xcode.

11) Run the project.



来源:https://stackoverflow.com/questions/18478663/how-to-run-a-sencha-touch-project-in-xcode-emulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!