You can check whether an accelerometer is available:
B4X:
Private Sub IsMotionSupported As Boolean
Dim m As Motion 'iPhone library
m.Initialize
Return m.As(NativeObject).GetField("accelerometerAvailable").AsBoolean
End Sub
There is a class called NSProcessInfo (Obj-C) / ProcessInfo (Swift) that has a boolean var called isiOSAppOnMac. Based on Erel's answer, it doesn't sound like it's implemented in B4i though.
Private Sub IsAppOnMac As Boolean
Dim ProcessInfo As NativeObject
ProcessInfo = ProcessInfo.Initialize("NSProcessInfo").RunMethod("new", Null)
Return ProcessInfo.GetField("isiOSAppOnMac").AsBoolean
End Sub
Note that it is only available on iOS 14+. What is the output of: