本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
在 AWS Device Farm 中对 XCTest UI 测试进行故障排除
以下主题列出了在上传 XCTest UI 测试期间出现的错误消息并推荐了解决方法来解决每个错误。
注意
以下说明基于 Linux x86_64 和 Mac。
XCTEST_UI_TEST_PACKAGE_UNZIP_FAILED
如果您看到以下消息,请执行以下步骤来修复此问题。
We could not open your test IPA file. Please verify that the file is valid and try again.
确保您可以解压应用程序包,而不会出现错误。在以下示例中,程序包的名称为 swift-sample-UI.ipa。
将您的测试程序包复制到工作目录,然后运行以下命令:
$ unzip swift-sample-UI.ipa成功解压缩程序包后,您可以通过运行以下命令找到工作目录树结构:
$ tree .有效的 iOS 应用程序包应生成类似以下内容的输出:
. `-- Payload (directory) `-- swift-sampleUITests-Runner.app (directory) |-- Info.plist |-- Plugins (directory) | `swift-sampleUITests.xctest (directory) | |-- Info.plist | `-- (any other files) `-- (any other files)有关更多信息,请参阅 将 iOS XCTest 用户界面与 Device Farm 集成。
XCTEST_UI_TEST_PACKAGE_PAYLOAD_DIR_MISSING
如果您看到以下消息,请执行以下步骤来修复此问题。
We could not find the Payload directory inside your test package. Please unzip your test package,
verify that the Payload directory is inside the package, and try again.
在以下示例中,程序包的名称为 swift-sample-UI.ipa。
将您的测试程序包复制到工作目录,然后运行以下命令:
$ unzip swift-sample-UI.ipa成功解压缩程序包后,您可以通过运行以下命令找到工作目录树结构:
$ tree .如果 XCTest UI 程序包有效,您将在工作目录中找到
Payload目录。. `--Payload(directory) `-- swift-sampleUITests-Runner.app (directory) |-- Info.plist |-- Plugins (directory) | `swift-sampleUITests.xctest (directory) | |-- Info.plist | `-- (any other files) `-- (any other files)有关更多信息,请参阅 将 iOS XCTest 用户界面与 Device Farm 集成。
XCTEST_UI_TEST_PACKAGE_APP_DIR_MISSING
如果您看到以下消息,请执行以下步骤来修复此问题。
We could not find the .app directory inside the Payload directory. Please unzip
your test package and then open the Payload directory, verify that the .app directory is
inside the directory, and try again.
在以下示例中,程序包的名称为 swift-sample-UI.ipa。
将您的测试程序包复制到工作目录,然后运行以下命令:
$ unzip swift-sample-UI.ipa成功解压缩程序包后,您可以通过运行以下命令找到工作目录树结构:
$ tree .如果 XCTest UI 程序包有效,您将在
Payload目录中找到.app目录 (例如我们示例中的swift-sampleUITests-Runner.app)。. `-- Payload (directory) `--swift-sampleUITests-Runner.app(directory) |-- Info.plist |-- Plugins (directory) | `swift-sampleUITests.xctest (directory) | |-- Info.plist | `-- (any other files) `-- (any other files)有关更多信息,请参阅 将 iOS XCTest 用户界面与 Device Farm 集成。
XCTEST_UI_TEST_PACKAGE_PLUGINS_DIR_MISSING
如果您看到以下消息,请执行以下步骤来修复此问题。
We could not find the Plugins directory inside the .app directory. Please unzip
your test package and then open the .app directory, verify that the Plugins directory is
inside the directory, and try again.
在以下示例中,程序包的名称为 swift-sample-UI.ipa。
将您的测试程序包复制到工作目录,然后运行以下命令:
$ unzip swift-sample-UI.ipa成功解压缩程序包后,您可以通过运行以下命令找到工作目录树结构:
$ tree .如果 XCTest UI 程序包有效,您将在
.app目录中找到Plugins目录。在我们的示例中,该目录名为swift-sampleUITests-Runner.app。. `-- Payload (directory) `-- swift-sampleUITests-Runner.app (directory) |-- Info.plist |--Plugins(directory) | `swift-sampleUITests.xctest (directory) | |-- Info.plist | `-- (any other files) `-- (any other files)有关更多信息,请参阅 将 iOS XCTest 用户界面与 Device Farm 集成。
XCTEST_UI_TEST_PACKAGE_XCTEST_DIR_MISSING_IN_PLUGINS_DIR
如果您看到以下消息,请执行以下步骤来修复此问题。
We could not find the .xctest directory inside the plugins directory. Please
unzip your test package and then open the plugins directory, verify that the .xctest directory
is inside the directory, and try again.
在以下示例中,程序包的名称为 swift-sample-UI.ipa。
将您的测试程序包复制到工作目录,然后运行以下命令:
$ unzip swift-sample-UI.ipa成功解压缩程序包后,您可以通过运行以下命令找到工作目录树结构:
$ tree .如果 XCTest UI 程序包有效,您将在
Plugins目录中找到.xctest目录。在我们的示例中,该目录名为swift-sampleUITests.xctest。. `-- Payload (directory) `-- swift-sampleUITests-Runner.app (directory) |-- Info.plist |-- Plugins (directory) | `swift-sampleUITests.xctest(directory) | |-- Info.plist | `-- (any other files) `-- (any other files)有关更多信息,请参阅 将 iOS XCTest 用户界面与 Device Farm 集成。
XCTEST_UI_TEST_PACKAGE_PLIST_FILE_MISSING
如果您看到以下消息,请执行以下步骤来修复此问题。
We could not find the Info.plist file inside the .app directory. Please unzip
your test package and then open the .app directory, verify that the Info.plist file is inside
the directory, and try again.
在以下示例中,程序包的名称为 swift-sample-UI.ipa。
将您的测试程序包复制到工作目录,然后运行以下命令:
$ unzip swift-sample-UI.ipa成功解压缩程序包后,您可以通过运行以下命令找到工作目录树结构:
$ tree .如果 XCTest UI 程序包有效,您将在
.app目录中找到Info.plist文件。在下面的示例中,该目录名为swift-sampleUITests-Runner.app。. `-- Payload (directory) `-- swift-sampleUITests-Runner.app (directory) |--Info.plist|-- Plugins (directory) | `swift-sampleUITests.xctest (directory) | |-- Info.plist | `-- (any other files) `-- (any other files)有关更多信息,请参阅 将 iOS XCTest 用户界面与 Device Farm 集成。
XCTEST_UI_TEST_PACKAGE_PLIST_FILE_MISSING_IN_XCTEST_DIR
如果您看到以下消息,请执行以下步骤来修复此问题。
We could not find the Info.plist file inside the .xctest directory. Please unzip
your test package and then open the .xctest directory, verify that the Info.plist file is
inside the directory, and try again.
在以下示例中,程序包的名称为 swift-sample-UI.ipa。
将您的测试程序包复制到工作目录,然后运行以下命令:
$ unzip swift-sample-UI.ipa成功解压缩程序包后,您可以通过运行以下命令找到工作目录树结构:
$ tree .如果 XCTest UI 程序包有效,您将在
.xctest目录中找到Info.plist文件。在下面的示例中,该目录名为swift-sampleUITests.xctest。. `-- Payload (directory) `-- swift-sampleUITests-Runner.app (directory) |-- Info.plist |-- Plugins (directory) | `swift-sampleUITests.xctest (directory) | |--Info.plist| `-- (any other files) `-- (any other files)有关更多信息,请参阅 将 iOS XCTest 用户界面与 Device Farm 集成。
XCTEST_UI_TEST_PACKAGE_CPU_ARCHITECTURE_VALUE_MISSING
如果您看到以下消息,请执行以下步骤来修复此问题。
We could not the CPU architecture value in the Info.plist file. Please unzip your
test package and then open the Info.plist file inside the .app directory, verify that the key
"UIRequiredDeviceCapabilities" is specified, and try again.
在以下示例中,程序包的名称为 swift-sample-UI.ipa。
将您的测试程序包复制到工作目录,然后运行以下命令:
$ unzip swift-sample-UI.ipa成功解压缩程序包后,您可以通过运行以下命令找到工作目录树结构:
$ tree .您应该在
.app目录 (例如我们示例中的swift-sampleUITests-Runner.app) 中找到Info.plist文件:. `-- Payload (directory) `-- swift-sampleUITests-Runner.app (directory) |--Info.plist|-- Plugins (directory) | `swift-sampleUITests.xctest (directory) | |-- Info.plist | `-- (any other files) `-- (any other files)-
要查找 CPU 架构值,您可以使用 Xcode 或 Python 打开 Info.plist。
对于 Python,您可以通过运行以下命令来安装 biplist 模块:
$ pip install biplist -
接下来,打开 Python 并运行以下命令:
import biplist info_plist = biplist.readPlist('Payload/swift-sampleUITests-Runner.app/Info.plist') print info_plist['UIRequiredDeviceCapabilities']有效的 XCtest UI 程序包应生成类似以下内容的输出:
['armv7']有关更多信息,请参阅 将 iOS XCTest 用户界面与 Device Farm 集成。
XCTEST_UI_TEST_PACKAGE_PLATFORM_VALUE_MISSING
如果您看到以下消息,请执行以下步骤来修复此问题。
We could not find the platform value in the Info.plist. Please unzip your test
package and then open the Info.plist file inside the .app directory, verify that the key
"CFBundleSupportedPlatforms" is specified, and try again.
在以下示例中,程序包的名称为 swift-sample-UI.ipa。
将您的测试程序包复制到工作目录,然后运行以下命令:
$ unzip swift-sample-UI.ipa成功解压缩程序包后,您可以通过运行以下命令找到工作目录树结构:
$ tree .您应该在
.app目录 (例如我们示例中的swift-sampleUITests-Runner.app) 中找到Info.plist文件:. `-- Payload (directory) `-- swift-sampleUITests-Runner.app (directory) |--Info.plist|-- Plugins (directory) | `swift-sampleUITests.xctest (directory) | |-- Info.plist | `-- (any other files) `-- (any other files)-
要查找平台值,您可以使用 Xcode 或 Python 打开 Info.plist。
对于 Python,您可以通过运行以下命令来安装 biplist 模块:
$ pip install biplist -
接下来,打开 Python 并运行以下命令:
import biplist info_plist = biplist.readPlist('Payload/swift-sampleUITests-Runner.app/Info.plist') print info_plist['CFBundleSupportedPlatforms']有效的 XCtest UI 程序包应生成类似以下内容的输出:
['iPhoneOS']有关更多信息,请参阅 将 iOS XCTest 用户界面与 Device Farm 集成。
XCTEST_UI_TEST_PACKAGE_WRONG_PLATFORM_DEVICE_VALUE
如果您看到以下消息,请执行以下步骤来修复此问题。
We found the platform device value was wrong in the Info.plist file. Please unzip
your test package and then open the Info.plist file inside the .app directory, verify that the
value of the key "CFBundleSupportedPlatforms" does not contain the keyword "simulator", and
try again.
在以下示例中,程序包的名称为 swift-sample-UI.ipa。
将您的测试程序包复制到工作目录,然后运行以下命令:
$ unzip swift-sample-UI.ipa成功解压缩程序包后,您可以通过运行以下命令找到工作目录树结构:
$ tree .您应该在
.app目录 (例如我们示例中的swift-sampleUITests-Runner.app) 中找到Info.plist文件:. `-- Payload (directory) `-- swift-sampleUITests-Runner.app (directory) |--Info.plist|-- Plugins (directory) | `swift-sampleUITests.xctest (directory) | |-- Info.plist | `-- (any other files) `-- (any other files)-
要查找平台值,您可以使用 Xcode 或 Python 打开 Info.plist。
对于 Python,您可以通过运行以下命令来安装 biplist 模块:
$ pip install biplist -
接下来,打开 Python 并运行以下命令:
import biplist info_plist = biplist.readPlist('Payload/swift-sampleUITests-Runner.app/Info.plist') print info_plist['CFBundleSupportedPlatforms']有效的 XCtest UI 程序包应生成类似以下内容的输出:
['iPhoneOS']如果 XCTest UI 程序包有效,则该值不应包含关键字
simulator。有关更多信息,请参阅 将 iOS XCTest 用户界面与 Device Farm 集成。
XCTEST_UI_TEST_PACKAGE_FORM_FACTOR_VALUE_MISSING
如果您看到以下消息,请执行以下步骤来修复此问题。
We could not the form factor value in the Info.plist. Please unzip your test
package and then open the Info.plist file inside the .app directory, verify that the key
"UIDeviceFamily" is specified, and try again.
在以下示例中,程序包的名称为 swift-sample-UI.ipa。
将您的测试程序包复制到工作目录,然后运行以下命令:
$ unzip swift-sample-UI.ipa成功解压缩程序包后,您可以通过运行以下命令找到工作目录树结构:
$ tree .您应该在
.app目录 (例如我们示例中的swift-sampleUITests-Runner.app) 中找到Info.plist文件:. `-- Payload (directory) `-- swift-sampleUITests-Runner.app (directory) |--Info.plist|-- Plugins (directory) | `swift-sampleUITests.xctest (directory) | |-- Info.plist | `-- (any other files) `-- (any other files)-
要查找外形规格值,您可以使用 Xcode 或 Python 打开 Info.plist。
对于 Python,您可以通过运行以下命令来安装 biplist 模块:
$ pip install biplist -
接下来,打开 Python 并运行以下命令:
import biplist info_plist = biplist.readPlist('Payload/swift-sampleUITests-Runner.app/Info.plist') print info_plist['UIDeviceFamily']有效的 XCtest UI 程序包应生成类似以下内容的输出:
[1, 2]有关更多信息,请参阅 将 iOS XCTest 用户界面与 Device Farm 集成。
XCTEST_UI_TEST_PACKAGE_PACKAGE_NAME_VALUE_MISSING
如果您看到以下消息,请执行以下步骤来修复此问题。
We could not find the package name value in the Info.plist file. Please unzip
your test package and then open the Info.plist file inside the .app directory, verify that the
key "CFBundleIdentifier" is specified, and try again.
在以下示例中,程序包的名称为 swift-sample-UI.ipa。
将您的测试程序包复制到工作目录,然后运行以下命令:
$ unzip swift-sample-UI.ipa成功解压缩程序包后,您可以通过运行以下命令找到工作目录树结构:
$ tree .您应该在
.app目录 (例如我们示例中的swift-sampleUITests-Runner.app) 中找到Info.plist文件:. `-- Payload (directory) `-- swift-sampleUITests-Runner.app (directory) |--Info.plist|-- Plugins (directory) | `swift-sampleUITests.xctest (directory) | |-- Info.plist | `-- (any other files) `-- (any other files)-
要查找程序包名称值,您可以使用 Xcode 或 Python 打开 Info.plist。
对于 Python,您可以通过运行以下命令来安装 biplist 模块:
$ pip install biplist -
接下来,打开 Python 并运行以下命令:
import biplist info_plist = biplist.readPlist('Payload/swift-sampleUITests-Runner.app/Info.plist') print info_plist['CFBundleIdentifier']有效的 XCtest UI 程序包应生成类似以下内容的输出:
com.apple.test.swift-sampleUITests-Runner有关更多信息,请参阅 将 iOS XCTest 用户界面与 Device Farm 集成。
XCTEST_UI_TEST_PACKAGE_EXECUTABLE_VALUE_MISSING
如果您看到以下消息,请执行以下步骤来修复此问题。
We could not find the executable value in the Info.plist file. Please unzip your
test package and then open the Info.plist file inside the .app directory, verify that the key
"CFBundleExecutable" is specified, and try again.
在以下示例中,程序包的名称为 swift-sample-UI.ipa。
将您的测试程序包复制到工作目录,然后运行以下命令:
$ unzip swift-sample-UI.ipa成功解压缩程序包后,您可以通过运行以下命令找到工作目录树结构:
$ tree .您应该在
.app目录 (例如我们示例中的swift-sampleUITests-Runner.app) 中找到Info.plist文件:. `-- Payload (directory) `-- swift-sampleUITests-Runner.app (directory) |--Info.plist|-- Plugins (directory) | `swift-sampleUITests.xctest (directory) | |-- Info.plist | `-- (any other files) `-- (any other files)-
要查找可执行文件值,您可以使用 Xcode 或 Python 打开 Info.plist。
对于 Python,您可以通过运行以下命令来安装 biplist 模块:
$ pip install biplist -
接下来,打开 Python 并运行以下命令:
import biplist info_plist = biplist.readPlist('Payload/swift-sampleUITests-Runner.app/Info.plist') print info_plist['CFBundleExecutable']有效的 XCtest UI 程序包应生成类似以下内容的输出:
XCTRunner有关更多信息,请参阅 将 iOS XCTest 用户界面与 Device Farm 集成。
XCTEST_UI_TEST_PACKAGE_TEST_PACKAGE_NAME_VALUE_MISSING
如果您看到以下消息,请执行以下步骤来修复此问题。
We could not find the package name value in the Info.plist file inside the
.xctest directory. Please unzip your test package and then open the Info.plist file inside the
.xctest directory, verify that the key "CFBundleIdentifier" is specified, and try again.
在以下示例中,程序包的名称为 swift-sample-UI.ipa。
将您的测试程序包复制到工作目录,然后运行以下命令:
$ unzip swift-sample-UI.ipa成功解压缩程序包后,您可以通过运行以下命令找到工作目录树结构:
$ tree .您应该在
.app目录 (例如我们示例中的swift-sampleUITests-Runner.app) 中找到Info.plist文件:. `-- Payload (directory) `-- swift-sampleUITests-Runner.app (directory) |--Info.plist|-- Plugins (directory) | `swift-sampleUITests.xctest (directory) | |-- Info.plist | `-- (any other files) `-- (any other files)-
要查找程序包名称值,您可以使用 Xcode 或 Python 打开 Info.plist。
对于 Python,您可以通过运行以下命令来安装 biplist 模块:
$ pip install biplist -
接下来,打开 Python 并运行以下命令:
import biplist info_plist = biplist.readPlist('Payload/swift-sampleUITests-Runner.app/Plugins/swift-sampleUITests.xctest/Info.plist') print info_plist['CFBundleIdentifier']有效的 XCtest UI 程序包应生成类似以下内容的输出:
com.amazon.swift-sampleUITests有关更多信息,请参阅 将 iOS XCTest 用户界面与 Device Farm 集成。
XCTEST_UI_TEST_PACKAGE_TEST_EXECUTABLE_VALUE_MISSING
如果您看到以下消息,请执行以下步骤来修复此问题。
We could not find the executable value in the Info.plist file inside the .xctest
directory. Please unzip your test package and then open the Info.plist file inside the .xctest
directory, verify that the key "CFBundleExecutable" is specified, and try again.
在以下示例中,程序包的名称为 swift-sample-UI.ipa。
将您的测试程序包复制到工作目录,然后运行以下命令:
$ unzip swift-sample-UI.ipa成功解压缩程序包后,您可以通过运行以下命令找到工作目录树结构:
$ tree .您应该在
.app目录 (例如我们示例中的swift-sampleUITests-Runner.app) 中找到Info.plist文件:. `-- Payload (directory) `-- swift-sampleUITests-Runner.app (directory) |--Info.plist|-- Plugins (directory) | `swift-sampleUITests.xctest (directory) | |-- Info.plist | `-- (any other files) `-- (any other files)-
要查找可执行文件值,您可以使用 Xcode 或 Python 打开 Info.plist。
对于 Python,您可以通过运行以下命令来安装 biplist 模块:
$ pip install biplist -
接下来,打开 Python 并运行以下命令:
import biplist info_plist = biplist.readPlist('Payload/swift-sampleUITests-Runner.app/Plugins/swift-sampleUITests.xctest/Info.plist') print info_plist['CFBundleExecutable']有效的 XCtest UI 程序包应生成类似以下内容的输出:
swift-sampleUITests有关更多信息,请参阅 将 iOS XCTest 用户界面与 Device Farm 集成。
XCTEST_UI_TEST_PACKAGE_MULTIPLE_APP_DIRS
如果您看到以下消息,请执行以下步骤来修复此问题。
We found multiple .app directories inside your test package. Please unzip your test package, verify that only a single .app directory is present inside the package, then try again.
将您的测试程序包复制到工作目录,然后运行以下命令:
$ unzip swift-sample-UI.zip成功解压缩程序包后,您可以通过运行以下命令找到工作目录树结构:
$ tree .如果 XCTest UI 程序包有效,您应在 .zip 测试程序包中找到类似于示例中的
swift-sampleUITests-Runner.app的单个.app目录。. `--swift-sample-UI.zip--(directory) `--swift-sampleUITests-Runner.app(directory) |-- Info.plist |-- Plugins (directory) | `swift-sampleUITests.xctest (directory) | |-- Info.plist | `-- (any other files) `-- (any other files) `-- (any other files)有关更多信息,请参阅 将 iOS XCTest 用户界面与 Device Farm 集成。
XCTEST_UI_TEST_PACKAGE_MULTIPLE_IPA_DIRS
如果您看到以下消息,请执行以下步骤来修复此问题。
We found multiple .ipa directories inside your test package. Please unzip your test package, verify that only a single .ipa directory is present inside the package, then try again.
将您的测试程序包复制到工作目录,然后运行以下命令:
$ unzip swift-sample-UI.zip成功解压缩程序包后,您可以通过运行以下命令找到工作目录树结构:
$ tree .如果 XCTest UI 程序包有效,您应在 .zip 测试程序包中找到类似于示例中的
sampleUITests.ipa的单个.ipa目录。. `--swift-sample-UI.zip--(directory) `--sampleUITests.ipa(directory) `-- Payload (directory) `-- swift-sampleUITests-Runner.app (directory) `-- (any other files)有关更多信息,请参阅 将 iOS XCTest 用户界面与 Device Farm 集成。
XCTEST_UI_TEST_PACKAGE_BOTH_APP_AND_IPA_DIR_PRESENT
如果您看到以下消息,请执行以下步骤来修复此问题。
We found both .app and .ipa files inside your test package. Please unzip your test package, verify that only a single .app or .ipa file is present inside the package, then try again.
将您的测试程序包复制到工作目录,然后运行以下命令:
$ unzip swift-sample-UI.zip成功解压缩程序包后,您可以通过运行以下命令找到工作目录树结构:
$ tree .如果 XCTest UI 程序包有效,您应在 .zip 测试程序包中找到类似于示例中的
sampleUITests.ipa的.ipa目录或类似于swift-sampleUITests-Runner.app的.app目录。您可以参考 将 iOS XCTest 用户界面与 Device Farm 集成 相关文档中的有效 XCTEST_UI 测试程序包示例。. `--swift-sample-UI.zip--(directory) `--sampleUITests.ipa(directory) `-- Payload (directory) `-- swift-sampleUITests-Runner.app (directory) `-- (any other files)或
. `--swift-sample-UI.zip--(directory) `--swift-sampleUITests-Runner.app(directory) |-- Info.plist |-- Plugins (directory) `-- (any other files) `-- (any other files)有关更多信息,请参阅 将 iOS XCTest 用户界面与 Device Farm 集成。
XCTEST_UI_TEST_PACKAGE_PAYLOAD_DIR_PRESENT_IN_ZIP
如果您看到以下消息,请执行以下步骤来修复此问题。
We found a Payload directory inside your .zip test package. Please unzip your test package, ensure that a Payload directory is not present in the package, then try again.
将您的测试程序包复制到工作目录,然后运行以下命令:
$ unzip swift-sample-UI.zip成功解压缩程序包后,您可以通过运行以下命令找到工作目录树结构:
$ tree .如果 XCTest UI 程序包有效,您不应在测试程序包中找到 Payload 目录。
. `--swift-sample-UI.zip--(directory) `-- swift-sampleUITests-Runner.app (directory) |-- Info.plist |-- Plugins (directory) `-- (any other files) `--Payload (directory) [This directory should not be present]|-- (any other files) `-- (any other files)有关更多信息,请参阅 将 iOS XCTest 用户界面与 Device Farm 集成。