Unverified Commit 86120659 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Update integration_test README for iOS (#71859)

parent 9a31c39a
......@@ -180,33 +180,40 @@ devices you want to test on. See
## iOS Device Testing
You need to change `iOS/Podfile` to avoid test target statically linking to the plugins. One way is to
link all of the plugins dynamically:
Open `ios/Runner.xcworkspace` in Xcode. Create a test target if you
do not already have one via `File > New > Target...` and select `Unit Testing Bundle`.
Change the `Product Name` to `RunnerTests`. Make sure `Target to be Tested` is set to `Runner`.
Select `Finish`.
Add the new test target to `ios/Podfile` by embedding in the existing `Runner` target.
```
target 'Runner' do
use_frameworks!
# Do not change existing lines.
...
end
```
To run `integration_test/foo_test.dart` on your iOS device, rebuild your iOS
targets with Flutter tool.
```sh
# Pass --simulator if building for the simulator.
flutter build ios integration_test/foo_test.dart
target 'RunnerTests' do
inherit! :search_paths
end
end
```
Run `flutter build ios` from your project file to hook up the new settings.
Open Xcode project (by default, it's `ios/Runner.xcodeproj`). Create a test target
(navigating `File > New > Target...` and set up the values) and a test file `RunnerTests.m` and
change the code. You can change `RunnerTests.m` to the name of your choice.
In Xcode, add a test file called `RunnerTests.m` (or any name of your choice) to the new target and
replace the file:
```objective-c
#import <XCTest/XCTest.h>
#import <integration_test/IntegrationTestIosTest.h>
@import XCTest;
@import integration_test;
INTEGRATION_TEST_IOS_RUNNER(RunnerTests)
```
Now you can start RunnerTests to kick-off integration tests!
Run `Product > Tests` to run the integration tests on your selected device.
To build `integration_test/foo_test.dart` from the command line, run:
```sh
# Pass --simulator if building for the simulator.
flutter build ios integration_test/foo_test.dart
```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment