1

In android world to run UI test with ADB, you need to execute this command

adb shell am instrument -w com.tarek360.sample.test

but before running this command you need to install your test package and main application Android package files (.apk files) to your current Android device or emulator, more info here.

Normally the APKs package names will be in the following format:

  • Main APK: com.tarek360.sample
  • Test APK: com.tarek360.sample.test

but in Flutter world, when I run flutter drive, for example, the following command:

flutter drive --target=test_driver/app.dart

I see only the main APK has installed and I don't see any test APK has installed on my device, I'm wondering how does Flutter Driver works with Android, it's important for me to understand because I have very customized CI and I build APKs in a completely different environment than the test runner environment.

Tarek360
  • 1,251
  • 1
  • 13
  • 19
  • Hi @Tarek360 did you get any information on this? I am exactly looking for the same. Need to generate androidTest.apk file. But not able understand the commands. – Raghu Mudem Mar 28 '21 at 14:13

1 Answers1

0

Tests on your computer use Flutter Driver to connect to Flutter Driver Extension, that you must enable separately, inside your application using TCP and send commands to it using adb with port forwarding

Artur Korobeynyk
  • 955
  • 1
  • 9
  • 24