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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7818780/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 21:56:14  来源:igfitidea点击:

Test a PhoneGap application on a real device

iostestingcordovadevice

提问by Santana6.35

I built an application using Phonegap and I tested it on the iPhone Simulator. Now I want to "send" it to the iPad, can somebody explain me how to handle that ?

我使用 Phonegap 构建了一个应用程序,并在 iPhone 模拟器上对其进行了测试。现在我想将它“发送”到 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. If somebody can explain me or redirect me to a good tutorial for this kind of "testing development". Thanks in advance.

当然,我有一个 Apple id 和所有其他东西……我为 iPad 创建了“配置文件”,但我不明白如何在设备上运行它。如果有人可以解释我或将我重定向到此类“测试开发”的好教程。提前致谢。

采纳答案by hatunike

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. Click on the button next to the "run" and "stop" buttons in xcode. The button will be the name of your project followed by "nameOfProject>iPad 4.3 Simulator" or something similar. Change this to be "iOS device name of ipad", the ipad you have plugged into the computer. Now rebuild and run.

如果您有一个 Apple ID 并且正确配置了 ipad,那么您只需要在 xcode 中更改您正在构建的位置。单击 xcode 中“运行”和“停止”按钮旁边的按钮。该按钮将是您的项目名称,后跟“nameOfProject>iPad 4.3 Simulator”或类似名称。将此更改为“ipad 的iOS 设备名称”,即您已插入计算机的ipad。现在重建并运行。

回答by ookikoi

use "run" instead of "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(作品精美)

回答by Vinayak Bevinakatti

A way to distribute application without asking user to copy provisioning profile and application file to iTunes and then sync iPhone with it. 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.

一种分发应用程序的方法,无需要求用户将配置文件和应用程序文件复制到 iTunes,然后将 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

回答by James111

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 (e.g 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. This solution is a quick and easy way of viewing your app that doesn't use any hardware controls (e.g a jquery mobile app)

但是,如果您正在使用某些 phonegaps 功能(gps 等...),那么这些将不起作用。此解决方案是查看您的应用程序的一种快速简便的方法,不使用任何硬件控件(例如 jquery 移动应用程序)