When someone shakes your iPhone?
You would need to install an application with the ability to detect motion events and report them to you somehow (I assume you want to detect that when the phone is not in your hands).
If you are a developer wanting to write such app, there could be a different answer depending on the OS version and the type of movement you want to detect.
You would have to detect Motion Events.
Here’s a simple article with a basic example: Detecting Shakes Using Motion Events