I am creating an ios application for the iphone. I would like to make it run only on a 4 inch device (so the iphone 5 and the iPod touch 5). When I run it on one of these tw
You can not limit your app to run on a specific screen size or not, only specific iOS versions. There are ways to check the orientation and size of the screen and have it look a certain way, but the app will still run.
You should just design the app to look good on both the 3.5 and 4 inch screens. You can do that by toggling the screen size button when creating in IB (if you use IB).
If you want to make your app able to run on both iPad and 3.5 and 4 inch iOS devices, you should make your app a "Universal" app.
But I understand what you mean by running it on the iPad simulator, and as @Scott said, the screen size displayed in the iPad simulator means nothing.
Instead of avoiding the problem (looks bad on 3.5") solve it (make it look good on both)!
You cannot choose an app to only be released for 4" devices, and you have no influence on what display the iPad simulates when it runs an iPhone only app. What you want is simply impossible.