Check which app is currently open on device

I can launch app through appium and use that driver to do UI interaction through Python. But I am trying to launch app through python script. e.g. facebook app. Can I determine which app is currently open? Or can I use appium to do UI interaction on currently open app?

I want to know which app is currently open or which url is launched either in playstore on in browser? Can appium handle this or I need to use something else? Or can I use adb to pull this info?

thanks I found the way with appium driver.current_activity

similar topic

I couldn’t find any inbuilt method for iOS native app, decided to check for element in app

Regards,
Vikram