first, there is no official way of detecting if a player is on mobile device using Roblox APIs
but you can use UserInputService:GetLastInputType() to check if input was a from mobile of keybord
and as for UI, with detect Holding Button.InputBegan & InputEnded will work
and for squished UI i recoment always using offset for ui elements parented to the screenGui, but if you really want to use scale, UIAspectRatioConstraint will keep the shape and scaling