[英]How to testing Gluon app on iOS Simulator or Real Device?
当我尝试在 iOS 设备/模拟器上执行 gluon 应用程序时,该问题与我之前的问题有关。 它似乎根本不起作用。 它向我显示以下错误:
launchIPadSimulator
: 它错误Unable to find a matching device [arch=x86_64, family=iPhone, name=null, sdk=null]
已编辑
launchIOSDevice
:错误未No provisioning profile and signing identity found that matches bundle ID
我也检查了这个问题,但它对我没有帮助。 所以问题是如何使它工作?
注意到我使用的是 macOS Mojave 10.14.3 和 Xcode 10.2.1
构建.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.3.16'
}
}
// Apply the plugin
apply plugin: 'org.javafxports.jfxmobile'
repositories {
jcenter()
maven {
url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
}
}
mainClassName = 'fr.cashmag.GluonApplication'
ext.GLUON_VERSION="5.0.2"
ext.CHARM_DOWN="3.8.6"
dependencies {
compile "com.gluonhq:charm:$GLUON_VERSION"
compile "com.gluonhq:charm-down-plugin-orientation:$CHARM_DOWN"
}
jfxmobile {
downConfig {
version = '3.8.6'
// Do not edit the line below. Use Gluon Mobile Settings in your project context menu instead
plugins 'display', 'lifecycle', 'orientation', 'statusbar', 'storage'
}
android {
manifest = 'src/android/AndroidManifest.xml'
}
ios {
infoPList = file('src/ios/Default-Info.plist')
forceLinkClasses = [
'com.gluonhq.**.*',
'javax.annotations.**.*',
'javax.inject.**.*',
'javax.json.**.*',
'org.glassfish.json.**.*'
]
}
}
iOS模拟器
要解决这个问题:
无法找到匹配的设备 [arch=x86_64, family=iPhone, name=null, sdk=null]
一个可能的解决办法是:
在项目的根目录中包含一个gradle.properties
文件,并添加:
robovm.ipaArchs=x86_64
(有关更多详细信息,请参阅文档)。
运行./gradlew --info createIpa
,等待任务结束。 检查您的项目是否包含build/javafxports/ios/*.app
。
打开Xcode,进入Xcode -> Open Developer Tool -> Simulator
*.app
文件。 然后它将在 SIM 卡上安装该应用程序,您将能够通过点击它来运行它。一旦该过程开始工作,您可以将属性恢复为:
robovm.ipaArchs=arm64:thumbv7
以便为您的设备和 Apple Store 创建应用程序。
iOS设备
要解决这个问题:
找不到与捆绑 ID 匹配的配置文件和签名标识
您需要按照以下步骤操作,前提是您已经注册了 Apple Developer 计划(否则您将无法通过 Apple Store 分发您的应用程序):
Certificates, Identifiers & Profiles
。Certificates
,并确保您已创建开发证书(用于测试)。 稍后您将需要用于分发的生产证书。Identifiers -> App IDs
,并创建一个新的应用程序标识符。 提供一个名称并确保您提供应用程序中的确切 Bundle ID,该 ID 列在您的 Default-Info.plist 文件中的CFBundleIdentifier
键下。Devices
并添加您的测试设备,提供这些设备的UDID
(转到 iTunes,插入您的设备,然后单击设备序列号,它会显示它,然后按 ⌘+C 粘贴它)。Provisioning Profiles
,并添加一个开发配置文件(稍后您将需要一个分发配置文件)。 选择iOS App Development
,选择您之前提供的App ID,完成后下载安装(双击)。 回到您的项目,您可以将其添加到您的build.gradle
文件中:
ios { ... iosSignIdentity = "iPhone Development: *** (^^^^)" iosProvisioningProfile = '$$$' }
运行./gradlew --info launchIOSDevice
,并在过程结束时查看控制台日志记录以检查配置文件是否用于对应用程序进行签名。
请注意,您必须以相同的方式使用分发配置文件来签署您将提交到 Apple Store 的应用程序。
编辑
如果您未注册开发人员计划,您还可以使用免费配置文件,这将让您在自己的设备上进行测试。
为此,您必须执行以下步骤:
Xcode -> Preferences -> Accounts
Single View App
。iosSignIdentity
和iosProvisioningProfile
)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.