问题
I want to test a compass app on the emulator. Is this possible or do I have to use a real device. Also I do not want to use gps.
回答1:
It's possible to install sensorsimulator from openintents but you can only use this as an app on the emulator and send commands from the pc. The weird thing is once you quit the app on the emulator then it stops receiving sensor simulation data. So it's useless for testing your own app! Is it possible to simulate sensor commands on the emulator to actually send sensor data? like DDMS does for GPS?
回答2:
It seems that at the moment testing hardware sensor input is not possible with the emulator. At least this is what I read from the emulator docs. Maybe there is some badly documented console program that you can use via telnet.
来源:https://stackoverflow.com/questions/2376512/can-i-emulate-a-compass-on-android