Retroarch CLI for android

Apologies if this is covered somewhere. I couldn’t find anything specific on the subject in the libretro docs.

When starting RA from an activity manager or the CLI on android, what do all the different options actually do, and which are required? Most of the info I could glean on them is directly from the git source code and this super helpful page for the pegasus front end launcher.

There’s a myriad of flags, but I can’t fully understand what they all do:

am start --user 0
  -n com.retroarch/.browser.retroactivity.RetroActivityFuture
  -e ROM {file path}. #Required
  -e LIBRETRO {core path} #Required
  -e CONFIGFILE {config file path} #Required
  -e IME com.android.inputmethod.latin/.LatinIME #Standard android fluff as far as i can tell, and its required otherwise the app wont launch
  -e DATADIR /data/data/com.retroarch ???  What is this needed for, if at all?
  -e APK /data/app/com.retroarch-1/base.apk ???  What is this needed for, if at all?
  -e SDCARD /storage/emulated/0 ???  What is this needed for, if at all?
  -e EXTERNAL /storage/emulated/0/Android/data/com.retroarch/files ???  What is this needed for, if at all?
  --activity-clear-task   #Will basically 'start fresh' the application, if I'm reading the docs correctly:  https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_CLEAR_TASK
  --activity-clear-top. #Use the running instance of the app if its already open, if I'm reading the docs correctly:  https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_CLEAR_TOP
  --activity-no-history. #Prevent any android gui stuff getting in the way of launching, if I'm reading the docs correctly:  https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NO_HISTORY

this is actually the first I’ve seen of any of the intents stuff, so I won’t be much help, but this is very useful information to have lol