如何在iOS Simulator或Real Device上测试Gluon应用程序? [英] How to testing Gluon app on iOS Simulator or Real Device?

查看:183
本文介绍了如何在iOS Simulator或Real Device上测试Gluon应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该问题与我尝试的上一个问题有关在iOS设备/模拟器上执行gluon应用程序.似乎根本不起作用.它显示了以下错误:

The problem is related to my previous question when I try to execute the gluon application on iOS Device/simulator. It seem not working at all. It show me the following error:

  • launchIPadSimulator:错误Unable to find a matching device [arch=x86_64, family=iPhone, name=null, sdk=null]
  • launchIPadSimulator: It error 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
  • launchIOSDevice : It error 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?

已记录 我正在使用macOS Mojave 10.14.3和Xcode 10.2.1

Noted I am using macOS Mojave 10.14.3 and Xcode 10.2.1

Build.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]

Unable to find a matching device [arch=x86_64, family=iPhone, name=null, sdk=null]

可能的解决方案是:

  • 在项目的根目录中包含一个gradle.properties文件,并添加:

robovm.ipaArchs=x86_64

(有关更多详细信息,请参见文档).

(see documentation for more details).

运行./gradlew --info createIpa,等待任务结束.检查您的项目是否包含build/javafxports/ios/*.app下的应用.

Run ./gradlew --info createIpa, wait until the task ends. Review that your project contains the app under build/javafxports/ios/*.app.

打开Xcode,转到Xcode -> Open Developer Tool -> Simulator

Open Xcode, go to Xcode -> Open Developer Tool -> Simulator

该过程正常运行后,您可以将属性还原为:

Once the process is working you can revert the property to:

robovm.ipaArchs=arm64:thumbv7

以便为您的设备和Apple Store创建应用.

in order to create the app for your device and for the Apple Store.

iOS设备

要解决此问题:

未找到与捆绑软件ID匹配的配置配置文件和签名身份

No provisioning profile and signing identity found that matches bundle ID

您需要按照以下步骤操作,前提是您已经注册了Apple Developer计划(否则您将无法通过Apple Store分发您的应用程序):

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):

  • 转到开发人员门户网站,转到Certificates, Identifiers & Profiles.
  • 转到Certificates,并确保已创建开发证书(用于测试).稍后,您将需要生产证书才能进行分发.
  • 假设现在进行开发,请下载并安装证书(双击).
  • 转到Identifiers -> App IDs,然后创建一个新的应用程序标识符.提供一个名称,并确保您从应用程序中提供了确切的捆绑ID,该ID在Default-Info.plist文件中的CFBundleIdentifier键下列出.
  • 转到Devices并添加测试设备,并提供这些设备的UDID(转到iTunes,插入设备,然后单击设备序列,它将显示出来,然后按⌘+ C粘贴)
  • 最后,转到Provisioning Profiles,并添加一个开发配置文件(以后您将需要一个发行版).选择iOS App Development,选择之前提供的App ID,完成后,下载并安装(双击).
  • 返回到您的项目,您可以将其添加到您的build.gradle文件中:

  • Go to the Developer portal, go to Certificates, Identifiers & Profiles.
  • Go to Certificates, and make sure you have created a Development certificate (for testing). 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. 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.
  • 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).
  • Finally, go to Provisioning Profiles, and add a Development profile (later on you will need a Distribution one). Select iOS App Development, select the App ID you provided before, and when finished, download and install (double click).
  • Back to your project, you can add this to your build.gradle file:

ios {
    ...
    iosSignIdentity = "iPhone Development: *** (^^^^)"
    iosProvisioningProfile = '$$$'
}

  • 运行./gradlew --info launchIOSDevice,并在过程结束时查看控制台日志记录,以检查配置文件是否用于对应用程序进行签名.

  • 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.

    请注意,您将必须以相同的方式使用发行设置配置文件来签署要提交到Apple Store的应用程序.

    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.

    编辑

    如果您尚未注册开发者计划,则还可以使用免费的配置文件,该文件可让您在自己的设备上进行测试.

    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:

    • 如果没有可以使用的Apple ID,则可以在此处创建一个新的.
    • 打开Xcode并转到Xcode -> Preferences -> Accounts
    • 添加您的Apple ID
    • 在管理证书"下,为iOS开发添加一个.
    • 现在创建一个新的Xcode项目,选择一个简单的模板,例如Single View App.
    • 确保您设置与项目中的束标识符完全相同.
    • 连接设备并运行Xcode项目.它将在您的设备上为该空应用安装配置文件.
    • 退出Xcode并返回您的项目,尝试在不设置iosSignIdentityiosProvisioningProfile的情况下将其部署到iOS设备.
    • If you do not have an Apple ID you can use, you can create a new one here.
    • Open Xcode and go to Xcode -> Preferences -> Accounts
    • Add your Apple ID
    • Under Manage Certificates, add one for iOS Development.
    • Now create a new Xcode project, select a simple template like 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. 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).

    这篇关于如何在iOS Simulator或Real Device上测试Gluon应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆