If I want to log a message that Android Studio will show in its console, I can do this:
import 'dart:developer';
void main() {
log('Hello world!');
runApp(const MyApp());
}
But if I package the app, run it and then look for it with logcat, it's not there.
flutter build apk
adb install build/app/outputs/flutter-apk/app-release.apk
adb shell am start -a android.intent.action.MAIN -n com.example.myapp/.MainActivity
adb logcat -t '12-08 00:00:00.000' | grep Hello
This results in empty output. So how do I log a system message, not just an IDE debug message?