You can build an .apk file for Android, .ipa file for iOS physical devices or .app bundle for iOS Simulator testing.
This file needs to be uploaded to TestingBot for automated or manual testing.
Please see the table below on how to build your app:
OS
Build Mode
Command
Android
debug
Copy
flutter build apk --debug
profile
Copy
flutter build apk --profile
iOS
debug
Copy
flutter build ios --debug
simulator
Copy
flutter build ios --simulator
profile
Copy
flutter build ios --profile
For iOS 14 and higher, please build the app in profile mode only.
Release mode is not supported by Appium's Flutter Driver.
For iOS real device testing, please use flutter build ipa, then do:
Copy
mkdir Payload
mv Runner.app Payload/
zip --symlinks-qr test-app.ipa Payload
Uploading Your App
Please see our Upload Mobile App documentation to find out how to upload your app to TestingBot for testing.
Example
TestingBot has created a flutter-demo-app which you can use to run your first Flutter Automated test with TestingBot.
Please see the example below where we run an automated Flutter test on TestingBot.
Copy
constwdio=require('webdriverio');constassert=require('assert');const{byValueKey}=require('appium-flutter-finder');constcaps={platformName:'Android',deviceName:'Pixel 6',version:'13.0',realDevice:true,app:'https://github.com/testingbot/flutter-demo-app/releases/download/v1.0.0/demo.apk'// or tb://[yourapp]'};constopts={capabilities:{...caps,automationName:'Flutter',retryBackoffTime:500,hostname:'hub.testingbot.com'},user:'...',key:'...'};(async ()=>{constcounterTextFinder=byValueKey('counter');constbuttonFinder=byValueKey('incrementButton');constdriver=awaitwdio.remote(opts);assert.strictEqual(awaitdriver.getElementText(counterTextFinder),'0');awaitdriver.elementClick(buttonFinder);awaitdriver.touchAction({action:'tap',element:{elementId:buttonFinder}});assert.strictEqual(awaitdriver.getElementText(counterTextFinder),'2');driver.deleteSession();})();
This example test will open the flutter-demo-app, find both the counter number and increment button by valueKey.
It will then verify the initial number, click the button twice and verify if the number is correct.
You can use the following demo applications to try out automated Flutter testing:
To run your existing tests on TestingBot, your tests will need to be configured to use the TestingBot remote devices.
If the test was running on your local machine or network, you can simply change your existing test like this:
To let TestingBot know on which device you want to run your test on, you need to specify the deviceName, version, platformName and other optional options in the capabilities field.