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
.
In Apple Developer Portal create a 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 make sure that you have a Development Certificate. If not, create one.
In Apple Developer Portal create a new Development Provisioning Profile that is linked to the new Identifier and includes the Development 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 only if you use fastlane for codesigning.