上一篇文章講瞭iOS模擬器的基本用法,這一篇主要講模擬器更深層次的用法,對開發、測試有用,主要參考瞭apple官方文檔。
與模擬器交互
Menu option |
Hardware action |
---|---|
Rotate Left |
Rotates the simulator to the left.(向左旋轉,測試橫豎屏切換) |
Rotate Right |
Rotates the simulator to the right.(向右旋轉,測試橫豎屏切換) |
Shake Gesture |
Simulates shaking the device.(搖動模塊器,測試傳感器) |
Home |
Displays the Home screen of the simulated device.(切到後臺,測試前後臺切換) |
Lock |
Displays the Lock screen.(鎖屏) |
Simulate Memory Warning |
Sends the frontmost app a simulated low-memory warning.(模擬內存警告,必測點,校驗app在模擬內存警告時的處理) For information on how to handle low-memory situations, see “Observing |
Toggle In-Call Status Bar |
Toggles the status bar between its normal state and its in-call state. This command shows how your app’s user interface looks when a user launches your app |
Simulate Hardware Keyboard |
Toggles the software keyboard on an iPad simulator. Turn off the software keyboard to simulate using a keyboard dock or wireless keyboard with an iPad device. Note: The Mac’s keyboard can be used as input into the simulator at all times. |
iOS Uses Same Keyboard Layout As OS X |
Automatically selects the iOS keyboard that most closely matches the keyboard layout of your Mac. |
TV Out |
Opens a window simulating a device’s TV Out signal. Note: Several TV Out resolutions are available by choosing Hardware > TV Out > desired resolution. |
模擬手勢
Gesture |
Desktop action |
---|---|
Tap |
Click. |
Touch and hold |
Press and hold down the mouse button or trackpad. |
Double-tap |
Double-click. |
Drag |
Drag. |
Swipe |
Drag. |
Flick |
Drag quickly. |
Two-finger Drag |
1. Place the pointer where you want the two-finger drag to occur. 2. Hold down the Option key. 3. Move the circles that represent finger touches to the start position. 4. Move the center of the pinch target by holding down the Shift key, moving the circles to the desired center position, and releasing the Shift key. 5. Hold down the Shift key and the mouse button, move the circles in the direction you want to drag, and release both the Shift key and the mouse button. |
Pinch |
1. Place the pointer where you want the pinch to occur. 2. Hold down the Option key. 3. Move the circles that represent finger touches to the start position. 4. Move the center of the pinch target by holding down the Shift key, moving the circles to the desired center position, and releasing the Shift key. 5. Hold down the mouse button, move the circles in and out to the end position, and release the Option key. |
Rotate |
1. Place the pointer where you want the rotation to occur. 2. Hold down the Option key. 3. Move the circles that represent finger touches to the start position. 4. Move the center of the pinch target by holding down the Shift key, moving the circles to the desired center position, and releasing the Shift key. 5. Hold down the mouse button, rotate the circles to the end position, and release the Option key. |
-
截屏
-
Accelerometer
-
Gyroscope
-
Camera
-
Proximity Sensor
-
Microphone Input
2、OpenGL ES Limitations(略)
3、API Limitations-
Apple Push Services
-
Privacy alerts for access to Photos, Contacts, Calendar, and Reminders
-
The
UIBackgroundModes
key -
iCloud document syncing and key-value storage support
Unsupported frameworks include:
-
External Accessory
-
Media Player
-
Message UI
-
Event Kit
-
In UIKit, the
UIVideoEditorController
class4、固件版本號限制
如何在模擬器上測試iPad mini:
選擇非retina的iPad即可。
Testing App Accessibility,通過這個可以查看每個控件的坐標。模擬器的調試菜單,感覺主要是跟性能相關的,沒深究。查看crash log:
1、打開Applications/Utilities/Console2、查看CrashReporter文件夾
-
-
To take a screenshot and save it to your Mac’s pasteboard, choose Edit > Copy Screen.
To save a screenshot as a file, choose File > Save Screen Shot. The screenshot is saved to the desktop of your Mac.(存儲屏幕快照,圖片保存在Mac的桌面,常用,比如發現瞭bug需提交給開發)
更改模擬器的縮放比例
支持3種比例:100%,75%,50%
快捷鍵(command+1,command+2,command+3)
iOS模擬器的限制
1、硬件限制: