2

browserstack 告诉我,我需要在 --profile 模式下构建我的 ios 应用程序,您的文档也是如此

问题是,即使我在 --profile 模式下构建,我存档 .ipa 的唯一方法是选择发布方案,选择任何其他方案会导致存档失败。

运行此命令以在配置文件模式下构建使构建成功

[08:09:30]: $ flutter build ios --profile --build-number\=776 --build-name\=5.0.776 --no-codesign --flavor Profile -t lib/test_main.dart

然后我使用 xcode Release 方案归档 .ipa,归档成功。

我实时上传到 browserstack 应用程序

然后我运行我的 appium 测试,但我得到了这个错误

[0-0] 2022-02-22T13:17:27.447Z INFO webdriver: Retrying 3/3
[0-0] 2022-02-22T13:17:27.447Z INFO webdriver: [POST] https://hub-cloud.browserstack.com/wd/hub/session
[0-0] 2022-02-22T13:17:27.448Z INFO webdriver: DATA {
[0-0]   capabilities: {
[0-0]     alwaysMatch: {
[0-0]       app: 'REDACTED',
[0-0]       device: 'iPhone 12',
[0-0]       os_version: '14.0',
[0-0]       project: 'Baird Mobile',
[0-0]       build: 'browserstack-build-ios',
[0-0]       name: 'Tests',
[0-0]       automationName: 'Flutter',
[0-0]       acceptSslCerts: 'true'
[0-0]     },
[0-0]     firstMatch: [ {} ]
[0-0]   },
[0-0]   desiredCapabilities: {
[0-0]     app: 'REDACTED',
[0-0]     device: 'iPhone 12',
[0-0]     os_version: '14.0',
[0-0]     project: 'Baird Mobile',
[0-0]     build: 'browserstack-build-ios',
[0-0]     name: 'Tests',
[0-0]     automationName: 'Flutter',
[0-0]     acceptSslCerts: 'true'
[0-0]   }
[0-0] }
[0-0] 2022-02-22T13:18:35.834Z ERROR webdriver: Request failed with status 200 due to WebDriver Error: Could not start Mobile Browser. Error occured while starting the session. To verify if all the pre-requisites for running Appium Flutter Driver tests have been met, refer to - https://www.browserstack.com/docs/app-automate/appium/test-hybrid-apps/test-flutter-apps
[0-0]  Reason: 
[0-0] An unknown server-side error occurred while processing the command. Original error: Failed to connect 3 times. Aborting.
[0-0] 2022-02-22T13:18:35.834Z ERROR webdriver: WebDriver Error: Could not start Mobile Browser. Error occured while starting the session. To verify if all the pre-requisites for running Appium Flutter Driver tests have been met, refer to - https://www.browserstack.com/docs/app-automate/appium/test-hybrid-apps/test-flutter-apps
[0-0]  Reason: 
[0-0] An unknown server-side error occurred while processing the command. Original error: Failed to connect 3 times. Aborting.
[0-0]     at getErrorFromResponseBody (/Users/dhannah/Development/BolUiTestFramework/node_modules/webdriver/build/utils.js:197:12)
[0-0]     at NodeJSRequest._request (/Users/dhannah/Development/BolUiTestFramework/node_modules/webdriver/build/request/index.js:158:60)
[0-0]     at processTicksAndRejections (internal/process/task_queues.js:95:5)
[0-0]     at async startWebDriverSession (/Users/dhannah/Development/BolUiTestFramework/node_modules/webdriver/build/utils.js:67:20)
[0-0]     at async Function.newSession (/Users/dhannah/Development/BolUiTestFramework/node_modules/webdriver/build/index.js:58:45)
[0-0]     at async remote (/Users/dhannah/Development/BolUiTestFramework/node_modules/webdriverio/build/index.js:73:22)
[0-0]     at async Runner._startSession (/Users/dhannah/Development/BolUiTestFramework/node_modules/@wdio/runner/build/index.js:223:56)
[0-0]     at async Runner._initSession (/Users/dhannah/Development/BolUiTestFramework/node_modules/@wdio/runner/build/index.js:176:25)
[0-0]     at async Runner.run (/Users/dhannah/Development/BolUiTestFramework/node_modules/@wdio/runner/build/index.js:88:19)
[0-0] 2022-02-22T13:18:35.835Z ERROR @wdio/runner: Error: Failed to create session.
[0-0] Could not start Mobile Browser. Error occured while starting the session. To verify if all the pre-requisites for running Appium Flutter Driver tests have been met, refer to - https://www.browserstack.com/docs/app-automate/appium/test-hybrid-apps/test-flutter-apps
[0-0]  Reason: 
[0-0] An unknown server-side error occurred while processing the command. Original error: Failed to connect 3 times. Aborting.
[0-0]     at startWebDriverSession (/Users/dhannah/Development/BolUiTestFramework/node_modules/webdriver/build/utils.js:72:15)
[0-0]     at processTicksAndRejections (internal/process/task_queues.js:95:5)
[0-0]     at async Function.newSession (/Users/dhannah/Development/BolUiTestFramework/node_modules/webdriver/build/index.js:58:45)
[0-0]     at async remote (/Users/dhannah/Development/BolUiTestFramework/node_modules/webdriverio/build/index.js:73:22)
[0-0]     at async Runner._startSession (/Users/dhannah/Development/BolUiTestFramework/node_modules/@wdio/runner/build/index.js:223:56)
[0-0]     at async Runner._initSession (/Users/dhannah/Development/BolUiTestFramework/node_modules/@wdio/runner/build/index.js:176:25)
[0-0]     at async Runner.run (/Users/dhannah/Development/BolUiTestFramework/node_modules/@wdio/runner/build/index.js:88:19)
[0-0] FAILED in joshuarufer_jXfqM5/BairdMobile - /src/specs/login_tests.js
2022-02-22T13:18:35.948Z INFO @wdio/cli:launcher: Run onComplete hook

Spec Files:      0 passed, 1 failed, 1 total (100% completed) in 00:03:58 

2022-02-22T13:18:35.950Z INFO @wdio/local-runner: Shutting down spawned worker
2022-02-22T13:18:36.202Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2022-02-22T13:18:36.203Z INFO @wdio/local-runner: shutting down
4

1 回答 1

0

从您的帖子中,我了解到您无法在调试模式下生成 .ipa,而是使用发布模式本身。

您能否尝试查看下面的 StackOverflow 帖子,它讨论了如何在调试模式下导出 iOS 应用程序: 如何从颤振中获取 .apk 和 .ipa 文件?

于 2022-02-24T02:04:19.210 回答