Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error "Running on physical iOS devices is possible only in release mode" when run patrol build with simulator #1568

Closed
Wreos opened this issue Jul 21, 2023 · 2 comments

Comments

@Wreos
Copy link

Wreos commented Jul 21, 2023

Steps to reproduce

  1. Run simulator (iPhone 14, iOS 16.4)
  2. Clone example app
  3. Try to run patrol build ios --target integration_test/example_test.dart

Actual results

Error: Running on physical iOS devices is possible only in release mode #0 throwToolExit (package:patrol_cli/src/base/exceptions.dart:7:3) #1 IOSTestBackend.build.<anonymous closure> (package:patrol_cli/src/ios/ios_test_backend.dart:82:9) #2 DisposeScope.run (package:dispose_scope/src/dispose_scope.dart:46:18) #3 IOSTestBackend.build (package:patrol_cli/src/ios/ios_test_backend.dart:71:25) #4 BuildIOSCommand.run (package:patrol_cli/src/commands/build_ios.dart:131:29) #5 CommandRunner.runCommand (package:args/command_runner.dart:212:27) #6 CompletionCommandRunner.runCommand (package:cli_completion/src/command_runner/completion_command_runner.dart:81:18) #7 PatrolCommandRunner.runCommand (package:patrol_cli/src/runner/patrol_command_runner.dart:310:30) <asynchronous suspension> #8 PatrolCommandRunner.run (package:patrol_cli/src/runner/patrol_command_runner.dart:254:18) <asynchronous suspension> #9 patrolCommandRunner (package:patrol_cli/src/runner/patrol_command_runner.dart:72:20) <asynchronous suspension> #10 main (file:///Users/aleksandrlozhkovoi/.pub-cache/hosted/pub.dev/patrol_cli-2.0.4/bin/main.dart:6:20) <asynchronous suspension>

The most interesting thing that patrol test works fine at the same time, problem only with patrol build

Logs

Logs
Verbose mode enabled. More logs will be printed.
Received 1 test target(s)
Received test target: /Users/aleksandrlozhkovoi/Development/patrol/packages/patrol/example/integration_test/example_test.dart
Bundled 1 test(s) in /Users/aleksandrlozhkovoi/Development/patrol/packages/patrol/example/integration_test/test_bundle.dart
Received 5 --dart-define(s) (0 custom, 5 internal)
Received internal --dart-define: PATROL_WAIT=0
Received internal --dart-define: PATROL_APP_BUNDLE_ID=pl.leancode.patrol.Example
Received internal --dart-define: PATROL_IOS_APP_NAME=Patrol example
Received internal --dart-define: PATROL_TEST_LABEL_ENABLED=true
Received internal --dart-define: INTEGRATION_TEST_SHOULD_REPORT_RESULTS_TO_NATIVE=false
• Building app with entrypoint test_bundle.dart for iOS device (debug)...
Error: Running on physical iOS devices is possible only in release mode
#0      throwToolExit (package:patrol_cli/src/base/exceptions.dart:7:3)
#1      IOSTestBackend.build.<anonymous closure> (package:patrol_cli/src/ios/ios_test_backend.dart:82:9)
#2      DisposeScope.run (package:dispose_scope/src/dispose_scope.dart:46:18)
#3      IOSTestBackend.build (package:patrol_cli/src/ios/ios_test_backend.dart:71:25)
#4      BuildIOSCommand.run (package:patrol_cli/src/commands/build_ios.dart:131:29)
#5      CommandRunner.runCommand (package:args/command_runner.dart:212:27)
#6      CompletionCommandRunner.runCommand (package:cli_completion/src/command_runner/completion_command_runner.dart:81:18)
#7      PatrolCommandRunner.runCommand (package:patrol_cli/src/runner/patrol_command_runner.dart:310:30)
<asynchronous suspension>
#8      PatrolCommandRunner.run (package:patrol_cli/src/runner/patrol_command_runner.dart:254:18)
<asynchronous suspension>
#9      patrolCommandRunner (package:patrol_cli/src/runner/patrol_command_runner.dart:72:20)
<asynchronous suspension>
#10     main (file:///Users/aleksandrlozhkovoi/.pub-cache/hosted/pub.dev/patrol_cli-2.0.4/bin/main.dart:6:20)
<asynchronous suspension>

See the logs above to learn what happened. Also consider running with --verbose. If the logs still aren't useful, then it's a bug - please report it.
Error: Running on physical iOS devices is possible only in release mode
#0      throwToolExit (package:patrol_cli/src/base/exceptions.dart:7:3)
#1      IOSTestBackend.build.<anonymous closure> (package:patrol_cli/src/ios/ios_test_backend.dart:82:9)
#2      DisposeScope.run (package:dispose_scope/src/dispose_scope.dart:46:18)
#3      IOSTestBackend.build (package:patrol_cli/src/ios/ios_test_backend.dart:71:25)
#4      BuildIOSCommand.run (package:patrol_cli/src/commands/build_ios.dart:131:29)
#5      CommandRunner.runCommand (package:args/command_runner.dart:212:27)
#6      CompletionCommandRunner.runCommand (package:cli_completion/src/command_runner/completion_command_runner.dart:81:18)
#7      PatrolCommandRunner.runCommand (package:patrol_cli/src/runner/patrol_command_runner.dart:310:30)
<asynchronous suspension>
#8      PatrolCommandRunner.run (package:patrol_cli/src/runner/patrol_command_runner.dart:254:18)
<asynchronous suspension>
#9      patrolCommandRunner (package:patrol_cli/src/runner/patrol_command_runner.dart:72:20)
<asynchronous suspension>
#10     main (file:///Users/aleksandrlozhkovoi/.pub-cache/hosted/pub.dev/patrol_cli-2.0.4/bin/main.dart:6:20)
<asynchronous suspension>

Patrol version

patrol: ^2.1.0

Patrol Doctor output

Patrol Doctor output
Patrol CLI version: 2.0.4
Program adb found in /opt/homebrew/bin/adb
Env var $ANDROID_HOME is not set
Program xcodebuild found in /usr/bin/xcodebuild
Program ideviceinstaller found in /opt/homebrew/bin/ideviceinstaller

Flutter Doctor output

Flutter Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.10.5, on macOS 13.4.1 22F82 darwin-arm64, locale
    en-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] VS Code (version 1.80.1)
[✓] Connected device (3 available)
[✓] Network resources

• No issues found!
@bartekpacia
Copy link
Contributor

bartekpacia commented Jul 21, 2023

TL;DR To build artifacts for a physical iOS device:

patrol build ios --target integration_test/example_test.dart --release

To build artifacts for an iOS simulator:

patrol build ios --target integration_test/example_test.dart --debug --simulator

Whether the simulator is running doesn't matter here. By calling patrol build ios --target integration_test/example_test.dart, you're saying "build my APKs for an iOS device in debug mode", but it's not supported. To learn more about it, #1303 is a good starting point.

patrol test works, because it under the hood calls patrol build for the current device, which happens to be an iOS simulator. It's explained in the docs here - feel free to submit a PR if you found something to be not clear enough.

@Wreos Wreos closed this as completed Jul 21, 2023
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants