Installing and running Appium client in mobile device and testing the same device

Like one can install and run Appium in Windows PC and testing Windows application on the same PC, can Appium be installed in Android and IOS and testing another mobile app on the same device? With the Mobile device getting more powerful and the popularity of fold phone, it will be very convienent to test moble apps on the go, without connecting to a PC or Mac.

I have tried to install Appium in Termux in Android and got some success. But it still involves connecting through wireless adb, which seems redundant giving everything is in the same device. In principle it should be doable installing and running appium client and server in the same mobile device and testing another mobile app in the same device.