Physical iOS devices
Because of restrictions on JIT, "in iOS 14+, debug mode Flutter apps can only be launched from Flutter tooling,IDEs..." we need to build and run tests in release mode.
Going further, we need to sign the app and tests. Let's assume that your team joined Apple Developer Program and have already an App ID, profile and certificate for your app. We need to do the same for RunnerUITests
.
If you have multiple flavors, you might need to create a new App ID, certificate and profile for each flavor.
In Apple Developer Portal create new Identifier (App ID) with your app's bundle ID and with
.RunnerUITests.xctrunner
ending. It should look like e.g.:com.example.myapp.RunnerUITests.xctrunner
(Remember to swapcom.example.myapp
with your app's one).In Apple Developer Portal create new Development Certificate with your app's bundle ID and with
.RunnerUITests.xctrunner
ending. It should look like e.g.:com.example.myapp.RunnerUITests.xctrunner
(Remember to swapcom.example.myapp
with your app's one).In Apple Developer Portal create new Development Provisioning Profile that are linked to the new Identifier and include the new Certificate.
In Xcode disable automatic signing in
RunnerUITests
Target.Go to
ios/Runner.xcodeproj/project.pbxproj
and search for all occurrences ofPRODUCT_BUNDLE_IDENTIFIER = com.example.myapp.RunnerUITests;
. Then set thePROVISIONING_PROFILE_SPECIFIER
to your specifier of newly created profile.Import the new profile for RunnerUITests manually in Xcode.
You might see error or warning in Xcode about not matching bundle IDs. Don't worry about it,
RunnerUITests.xctrunner
bundle is generated while building tests and this is the bundle ID that we need to sign.Go to your IDE and try it out by running
patrol build ios --release
. If tests have been built successfully you're ready for action!
Next three steps are needed if you use fastlane for codesigning.