简体   繁体   English

在真实设备上测试PhoneGap应用程序

[英]Test a PhoneGap application on a real device

I built an application using Phonegap and I tested it on the iPhone Simulator. 我使用Phonegap构建了一个应用程序,我在iPhone模拟器上测试了它。 Now I want to "send" it to the iPad, can somebody explain me how to handle that ? 现在我想把它“发送”到iPad,有人可以解释一下如何处理它吗?

Of course I've got an apple id and all others stuff... I made the "provisioning profile" for the iPad, but I don't understood how I can run it on the device. 当然我有一个苹果ID和所有其他东西...我为iPad制作了“配置文件”,但我不明白我如何在设备上运行它。 If somebody can explain me or redirect me to a good tutorial for this kind of "testing development". 如果有人可以解释我或者将我重定向到这种“测试开发”的好教程。 Thanks in advance. 提前致谢。

If you have an Apple ID and the ipad is properly provisioned, then you simply need to change where you are building to in xcode. 如果你有一个Apple ID并且ipad已经正确配置,那么你只需要在xcode中更改你要构建的位置。 Click on the button next to the "run" and "stop" buttons in xcode. 单击xcode中“run”和“stop”按钮旁边的按钮。 The button will be the name of your project followed by "nameOfProject>iPad 4.3 Simulator" or something similar. 该按钮将是项目的名称,后跟“nameOfProject> iPad 4.3 Simulator”或类似的东西。 Change this to be "iOS device name of ipad", the ipad you have plugged into the computer. 将此更改为“ipad的iOS设备名称”,即已插入计算机的ipad。 Now rebuild and run. 现在重建并运行。

use "run" instead of "emulate". 使用“run”而不是“emulate”。

I've only used cordova but cordova run <osname> will install it on your device if it's plugged in. ie: 我只使用了cordova,但是如果插入了,那么cordova run <osname>将把它安装在你的设备上。即:

cordova run ios (I refuse to pay 99$ so not tested but it should) cordova run ios (我拒绝支付99美元因此未经测试但它应该)

cordova run android (works beautifully) cordova run android (工作cordova run android漂亮)

A way to distribute application without asking user to copy provisioning profile and application file to iTunes and then sync iPhone with it. 一种分发应用程序的方法,无需用户将配置文件和应用程序文件复制到iTunes,然后将iPhone与其同步。 Now, only thing that they need to do is to click on the link in e-mail, which will open website on device and there they can click to install application and profile on the iPhone. 现在,他们唯一需要做的就是点击电子邮件中的链接,这将打开设备上的网站,然后他们可以点击在iPhone上安装应用程序和配置文件。

http://blog.amarkulo.com/ad-hoc-profiles-and-application-distribution-via-web http://blog.amarkulo.com/ad-hoc-profiles-and-application-distribution-via-web

Other reference : 其他参考:

http://support.twixlmedia.com/kb/epublisher-builder-application/how-do-i-create-the-distribution-provisioning-profile-for-my-ad-hoc-build http://support.twixlmedia.com/kb/epublisher-builder-application/how-do-i-create-the-distribution-provisioning-profile-for-my-ad-hoc-build

Okay this is a bit of a shortcut/cheat. 好吧,这是一个快捷/欺骗。 But what i've done was do phonegap serve and then open the IP address that it provides you on my Iphone...It's pretty much the same as having it run on your device as an APK! 但我所做的是做phonegap服务,然后打开它在我的Iphone上提供给你的IP地址......它几乎与它作为APK在你的设备上运行一样!

Step One: 

cd to your directory and run phonegap serve cd到您的目录并运行phonegap serve

Step two:

On your Iphone/Android/Device open your web-browser (eg safari) and type in the IP phonegap has given you. 在您的Iphone / Android /设备上打开您的网络浏览器(例如safari)并输入IP phonegap给您。

Step three:

Have fun seeing your app work :) 看到你的应用工作有乐趣:)

However if you're using some of phonegaps features (gps, etc...) then these won't work. 但是,如果您正在使用某些手机功能(gps等),那么这些功能将无效。 This solution is a quick and easy way of viewing your app that doesn't use any hardware controls (eg a jquery mobile app) 此解决方案是一种快速简便的方法,可以查看不使用任何硬件控件的应用程序(例如,jquery移动应用程序)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM