简体   繁体   English

如何在 iOS 模拟器或真实设备上测试 Gluon 应用程序?

[英]How to testing Gluon app on iOS Simulator or Real Device?

The problem is related to my previous question when I try to execute the gluon application on iOS Device/simulator.当我尝试在 iOS 设备/模拟器上执行 gluon 应用程序时,该问题与我之前的问题有关。 It seem not working at all.它似乎根本不起作用。 It show me the following error:它向我显示以下错误:

  • launchIPadSimulator : It error Unable to find a matching device [arch=x86_64, family=iPhone, name=null, sdk=null] launchIPadSimulator : 它错误Unable to find a matching device [arch=x86_64, family=iPhone, name=null, sdk=null]

Edited已编辑

  • launchIOSDevice : It error No provisioning profile and signing identity found that matches bundle ID launchIOSDevice :错误未No provisioning profile and signing identity found that matches bundle ID

I also checking this question , but It doesn't help me.我也检查了这个问题,但它对我没有帮助。 So the question is How to make it working?所以问题是如何使它工作?

Noted I am using macOS Mojave 10.14.3 and Xcode 10.2.1注意到我使用的是 macOS Mojave 10.14.3 和 Xcode 10.2.1

Build.gradle构建.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 simulator iOS模拟器

To solve the issue:要解决这个问题:

Unable to find a matching device [arch=x86_64, family=iPhone, name=null, sdk=null]无法找到匹配的设备 [arch=x86_64, family=iPhone, name=null, sdk=null]

a possible solution is:一个可能的解决办法是:

  • Include a gradle.properties file in the root of your project, and add:在项目的根目录中包含一个gradle.properties文件,并添加:

     robovm.ipaArchs=x86_64

    (see documentation for more details). (有关更多详细信息,请参阅文档)。

  • Run ./gradlew --info createIpa , wait until the task ends.运行./gradlew --info createIpa ,等待任务结束。 Review that your project contains the app under build/javafxports/ios/*.app .检查您的项目是否包含build/javafxports/ios/*.app

  • Open Xcode, go to Xcode -> Open Developer Tool -> Simulator打开Xcode,进入Xcode -> Open Developer Tool -> Simulator

  • When an iPhone/iPad device screen shows up, drag from Finder the *.app file.当 iPhone/iPad 设备屏幕出现时,从 Finder 中拖动*.app文件。 It will then install the app on the sim, and you will be able to run it by tapping on it.然后它将在 SIM 卡上安装该应用程序,您将能够通过点击它来运行它。

Once the process is working you can revert the property to:一旦该过程开始工作,您可以将属性恢复为:

robovm.ipaArchs=arm64:thumbv7

in order to create the app for your device and for the Apple Store.以便为您的设备和 Apple Store 创建应用程序。

iOS device iOS设备

To solve the issue:要解决这个问题:

No provisioning profile and signing identity found that matches bundle ID找不到与捆绑 ID 匹配的配置文件和签名标识

you need to follow these steps, providing you are already enrolled in the Apple Developer program (otherwise you won't be able to distribute your app through the Apple Store):您需要按照以下步骤操作,前提是您已经注册了 Apple Developer 计划(否则您将无法通过 Apple Store 分发您的应用程序):

  • Go to the Developer portal , go to Certificates, Identifiers & Profiles .转到开发人员门户,转到Certificates, Identifiers & Profiles
  • Go to Certificates , and make sure you have created a Development certificate (for testing).转到Certificates ,并确保您已创建开发证书(用于测试)。 Later on you will need a Production certificate for distribution.稍后您将需要用于分发的生产证书。
  • Assuming development now, download the certificate and install it (double click).假设现在开发,下载证书并安装(双击)。
  • Go to Identifiers -> App IDs , and create a new app identifier.转到Identifiers -> App IDs ,并创建一个新的应用程序标识符。 Provide a name and make sure you provide the exact Bundle ID from your app, the one listed in your Default-Info.plist file under the CFBundleIdentifier key.提供一个名称并确保您提供应用程序中的确切 Bundle ID,该 ID 列在您的 Default-Info.plist 文件中的CFBundleIdentifier键下。
  • Go to Devices and add your testing devices, providing the UDID of these devices (go to iTunes, plug your device, and click on device serial, it will reveal it, and ⌘+C to paste it).转到Devices并添加您的测试设备,提供这些设备的UDID (转到 iTunes,插入您的设备,然后单击设备序列号,它会显示它,然后按 ⌘+C 粘贴它)。
  • Finally, go to Provisioning Profiles , and add a Development profile (later on you will need a Distribution one).最后,转到Provisioning Profiles ,并添加一个开发配置文件(稍后您将需要一个分发配置文件)。 Select iOS App Development , select the App ID you provided before, and when finished, download and install (double click).选择iOS App Development ,选择您之前提供的App ID,完成后下载安装(双击)。
  • Back to your project, you can add this to your build.gradle file:回到您的项目,您可以将其添加到您的build.gradle文件中:

     ios { ... iosSignIdentity = "iPhone Development: *** (^^^^)" iosProvisioningProfile = '$$$' }
  • Run ./gradlew --info launchIOSDevice , and review the console logging at the end of the process to check that the provisioning profile is used to sign the app.运行./gradlew --info launchIOSDevice ,并在过程结束时查看控制台日志记录以检查配置文件是否用于对应用程序进行签名。

Note that you will have to use the distribution provisioning profile in the same way to sign the app you will be submitting to the Apple Store.请注意,您必须以相同的方式使用分发配置文件来签署您将提交到 Apple Store 的应用程序。

EDIT编辑

If you are not enrolled in the Developer program, you can also use the free provisioning profile, that will let you test on your own device.如果您未注册开发人员计划,您还可以使用免费配置文件,这将让您在自己的设备上进行测试。

For that, you have to follow these steps:为此,您必须执行以下步骤:

  • If you do not have an Apple ID you can use, you can create a new one here .如果您没有可以使用的 Apple ID,您可以在此处创建一个新的。
  • Open Xcode and go to Xcode -> Preferences -> Accounts打开 Xcode 并转到Xcode -> Preferences -> Accounts
  • Add your Apple ID添加您的 Apple ID
  • Under Manage Certificates, add one for iOS Development.在管理证书下,为 iOS 开发添加一个。
  • Now create a new Xcode project, select a simple template like Single View App .现在创建一个新的 Xcode 项目,选择一个简单的模板,比如Single View App
  • Make sure you set the exact same bundle identifier as the one on your project.确保您设置的包标识符与项目中的包标识符完全相同。
  • Connect your device and run the Xcode project.连接您的设备并运行 Xcode 项目。 It will install a provisioning profile for that empty app on your device.它将在您的设备上为该空应用程序安装配置文件。
  • Quit Xcode and go back to your project, try to deploy it to the iOS device without setting the iosSignIdentity and iosProvisioningProfile ).退出 Xcode 并返回到您的项目,尝试将其部署到 iOS 设备而不设置iosSignIdentityiosProvisioningProfile )。

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

相关问题 Gluon应用程序无法在iOS上启动 - Gluon app won't start on iOS 如何使用Gradle在Gluon Project中设置JUnit测试 - How to setup JUnit testing in Gluon Project with Gradle 如何使用Gluon应用程序在iOS上打开/发送URL到另一个应用程序? - How can I open/send a URL to another app on iOS with a Gluon application? RoboVM不可用时,如何为iOS构建JavaFX Gluon应用程序? - How do I build my JavaFX Gluon app for iOS now that RoboVM is not available? 如何使用构成 Gluon 项目的 iOS、Android、桌面(和主)的 Gluon 文件夹? - How to use Gluon folders of iOS, android, desktop (And main) that make up a Gluon project? Gluon - 如何创建 webview 与原生通信(iOS) - Gluon - how to create webview to communicate with native (iOS) 如何使用适用于Android和IOS的JavaFx / Gluon创建FileChooser - How to create FileChooser using JavaFx/Gluon that works on Android and IOS Gluon Mobile 应用程序在没有完成代码更改的情况下突然崩溃 (iOS 13.3.1) - Gluon Mobile app suddenly crashes without code changes being done (iOS 13.3.1) 带有Gluon的iOS上的JavaFxPorts - JavaFxPorts on iOS with Gluon 如何使用Gluon和Javafx在Android / iOS上保存并加载到Dropbox,OneDrive和iCloud等云? - How can I save and load to clouds like Dropbox, OneDrive and iCloud on Android/iOS with Gluon and javafx?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM