It works perfectly fine for 1 package:
❯ adb shell 'am instrument -w -e package com.myapp.package1 com.myapp.test/com.myapp.MyTestRunner'
com.myapp.package1.ClassXTest:.......
Time: 22.288
OK (7 tests)
❯ adb shell 'am instrument -w -e package com.myapp.package2 com.myapp.test/com.myapp.MyTestRunner'
com.myapp.package2.ClassYTest:.....
Time: 6.959
OK (5 tests)
However, it detects 0 test when I use multiple packages; therefore, skipping running all the tests!
❯ adb shell 'am instrument -w -e package com.myapp.package1,com.myapp.package2 com.myapp.test/com.myapp.MyTestRunner'
Time: 0
OK (0 tests)
What's happening?
Google has acknowledged this as a bug and it should have been fixed by now: https://issuetracker.google.com/u/1/issues/111567467