xxggmmxx 发表于 2015-8-2 12:06:02

Visual Studio的 Apache Cordova 插件CTP3.0发布!

  北京时间12号晚23点开始的Connect()活动上,微软发布了一系列激动人心的消息!

[*].NET开源了!以后.NET将可在Linux和Mac OS平台上运行!
[*]VS免费了!!如果你是学生,个人开发者,初创企业,那么你将可以使用Visual Studio Community 2013!免费!
[*]Visual Studio 2015集成了 Clang 和 LLVM,这意味着什么,意味你可以在VS里头编译iOS程序了!
[*]Visual Studio 2015还自带了Android模拟器!可以告别那个渣爆了的原生Android模拟器了!
[*]Visual Studio的 Apache Cordova 插件CTP3.0发布!现在可以直接在VS里面debug部署到iOS模拟器或者真机上的应用程序!
  链接:

[*]Visual Studio 2013 Update 4(最新版): http://go.microsoft.com/fwlink/?linkid=390465
[*]Visual Studio 2015 Preview : http://go.microsoft.com/fwlink/?linkid=517106
[*]Visual Studio Community 2013 : http://go.microsoft.com/fwlink/?LinkId=518340
[*]各种开发者的免费福利: http://go.microsoft.com/fwlink/?LinkId=518339
[*]下载Apache Cordova CTP 3.0: http://www.microsoft.com/en-us/download/details.aspx?id=42675
  咱们来瞅瞅这个Cordova CTP 3.0到底更新哪些东西:
  这是CTP3.0的新的特性:

[*]更新了Ripple模拟器——实时更新Ripple!不用再重新编译就可以看到效果!
[*]可以在Visual Studio调试部署到iOS模拟器和真机上的iOS程序了!同时实时看到修改效果!(这个目前)
[*]提高remote iOS build agent的安全性以及让它更容易配置
[*]改善了Plugin的管理体验,更加方便地从Git或者自己的文件系统导入自定义的Plugin
[*]config.xml界面重新设计,更加人性化
[*]支持Apache Cordova CLI 4.0.0,支持Windows Universal App!直接可以生成Windows 8.1和Windows Phone 8.1的应用!
  
  要使用CTP 3.0,必须是2013 update 4或者2015版本:)
  如果装过CTP 2.0的童鞋,在装CTP 3.0的时候可能会遇到下面的问题:
http://rocsheh.azurewebsites.net/wp-content/uploads/2014/11/111314_1126_VisualStudi1.png
  需要先卸载CTP 2.0,然后再安装CTP 3.0哈。参考
  先去控制面板à程序à卸载程序,找到CTP2,卸载。
http://rocsheh.azurewebsites.net/wp-content/uploads/2014/11/111314_1126_VisualStudi2.png
  然后它会告诉你,成功卸载了,其实它是骗你的,完全没有好么。。。
  用管理员模式运行cmd,输入:
  “%ProgramData%\Package Cache\{dea88246-f74a-4171-ad6c-d9c978bf2973}\vs2013mda_0.1.exe” /uninstall /passive /force /burn.ignoredependencies={53d408db-eb91-43fb-9d8f-167681c19763};vsupdate_KB2829760
  然后CTP的安装程序会跳出来,其实它在卸载,不要以为它在安装,时间略久一点,耐心等到进度条结束哟:)
  然后就可以开始安装CTP 3.0了!
http://rocsheh.azurewebsites.net/wp-content/uploads/2014/11/111314_1126_VisualStudi3.png
  里面node, ant, android等东西如果已经安装过,就不要选了。
http://rocsheh.azurewebsites.net/wp-content/uploads/2014/11/111314_1126_VisualStudi4.png
  其实你也可以直接下载2015 preview版本,直接就内含了CTP 3.0。不用这么麻烦。
  
  更新后的Ripple模拟器

  添加一个工程后,选择Ripple,运行:
http://rocsheh.azurewebsites.net/wp-content/uploads/2014/11/111314_1126_VisualStudi5.png
  在Visual Studio可以看到Debug窗口已经打开:
http://rocsheh.azurewebsites.net/wp-content/uploads/2014/11/111314_1126_VisualStudi6.png
  定位到标题位置,准备修改:
http://rocsheh.azurewebsites.net/wp-content/uploads/2014/11/111314_1126_VisualStudi7.png
  修改完毕,焦点移到其他位置:
http://rocsheh.azurewebsites.net/wp-content/uploads/2014/11/111314_1126_VisualStudi8.png
  可以看到Ripple里头的标题栏已经改变!实时调试!不用重新编译!
  
  在Visual Studio调试iOS程序:

  调试iOS程序可以在Ripple模拟器里头,也可以在MAC的Simulator里面,或者直接跑在真机上。
  我现在配置是MAC上跑了Parallels Desktop 10,推荐,不卡,非常好用。然后PD10上面我再跑了windows,windows 10上安装了visual studio。
  你也可以不用这样,但是需要mac和你的pc是在一个内网里头。
  现在MAC上安装vs-mda-remote:
http://rocsheh.azurewebsites.net/wp-content/uploads/2014/11/111314_1126_VisualStudi9.png
  然后启动vs-mda-remote:
http://rocsheh.azurewebsites.net/wp-content/uploads/2014/11/111314_1126_VisualStudi10.png
  可以看到有个PIN码,记下来。
  回到windows里面的Visual Studio,在toolsàOptions里面,找到tools for Apache Cordova,然后配置好,mac的ip,端口以及PIN码。现在CTP 3.0多了PIN,保证安全性。
http://rocsheh.azurewebsites.net/wp-content/uploads/2014/11/111314_1126_VisualStudi11.png
  然后就可以开始调试了,选择Simulator,iphone 5或者iphone 6什么的:
http://rocsheh.azurewebsites.net/wp-content/uploads/2014/11/111314_1126_VisualStudi12.png
http://rocsheh.azurewebsites.net/wp-content/uploads/2014/11/111314_1126_VisualStudi13.png
  同样在Visual Studio里面可以看到Debug的界面(目前只有VS 2015支持)
  remote iOS build agent:

  就刚才说的,添加了PIN码,保证安全性:
http://rocsheh.azurewebsites.net/wp-content/uploads/2014/11/111314_1126_VisualStudi14.png
  导入自定义的Plugin:

  轻松导入各种Plugin:
http://rocsheh.azurewebsites.net/wp-content/uploads/2014/11/111314_1126_VisualStudi15.png
http://rocsheh.azurewebsites.net/wp-content/uploads/2014/11/111314_1126_VisualStudi16.png
  支持Cordova CLI 4.0:

  现在可以直接运行Windows Universal Apps的项目了,更多Cordova CLI 4.0的功能参见。
  
  
  
最后
  赶紧动手开始吧~~
页: [1]
查看完整版本: Visual Studio的 Apache Cordova 插件CTP3.0发布!