I try to use automation by launching Android app or browser.
When I use this automation, I need to be able to change the sensor value of my Android device or change the name of my device to change the browser's preferences.
Change the user-agent value of the browser, or change the tilt sensor value of the mobile phone.
I looked into the appium or seldroid, but I don't know if I can perform the above function. Is there another framework?
With android itself you can perform a lot of testing stuff like shown in this documentation. To get a further understanding I suggest to read the following articles:
Framework that can change sensor value and the device name are (I checked):
To get a detailed overview and more usefull frameworks compared, Perfecto will help you to figure out what to use.
Good luck with testing and automation! Cheers :)