MacOS have built in iOS (iWatch and iTV) simulators inside xcode.
The Simulation is not like Emulator, it's not the same as a real device, for example there is no app sandboxing, but it does supporting debugging (lldb) and supports biometrics, location, iCloud and etc.
We can lunch the Simulator via xcode or via the command line
Open the app source code and press the top play button to launch the app inside a simulator.
All the Devices are stored in:
iron@MacOS Documents % cd ~/Library/Developer/CoreSimulator
iron@MacOS CoreSimulator % cd Devices
iron@MacOS Devices % ls
0FAEB267-85ED-4031-9576-0A7F052A2477 53BD11AB-D74E-4704-BF57-5E2374172EF7 764F0C81-3195-4342-9F0A-577C29E75CE9 93FF1F74-851C-4366-BE87-60D3BA6151B8 C31FC06D-25CA-4C78-859D-2A5375D6AFF6
103CD7ED-761C-4AA1-9D1D-AE09FB3CCB94 55B95F35-D9BB-4B32-97EE-3A3A383AA3C7 7ABDFB25-056D-4516-9946-369FA62B42E5 9B6BE085-E64D-419F-85AE-F65DCA49641E C6431EE5-AE6E-4A34-AA44-E602F8A506A5
15B4FC46-A673-4E4B-B810-5A0EC618D924 581F73F2-276C-428C-928B-7D9486396BD6 7D40B046-2667-438A-9A10-42A13B463805 9F90A173-DC1B-434D-B75A-7B0163F36F6C CC6CD17C-5EE1-40D2-8CB9-5C68863B9308
1DA73E58-E1F8-4BC9-BE5F-8A8C6159C84E 5F59164E-5E37-4726-BD81-738B273B2394 84412647-BAE9-41EB-B783-A67A310D0BE0 A5060494-C262-4B70-8AF3-88B605CCA022 D0748915-22E0-4AAB-8ED5-BD01F3FA2815
4321F183-A907-462B-9464-C66900813D5B 69F7DECF-7C25-4DFA-9079-28C150D03A8C 8509C040-9A86-4FEF-A498-88E761BE0F6F A660BC02-F721-47EB-AE61-C3D9DC257067 D0F0BB1E-B207-46C4-9FE3-ADC963FFCB82
477B0B28-9478-4C51-8466-406E6581EF4C 6BDFF3C7-ECD6-4E49-AEC4-240C986E8FDC 863096EF-FCA3-49AA-8BAF-227797ECFB3F AC596FCF-E635-4F9D-AABF-BE2EC5FB9BC9 EE2FF4C0-C586-4898-8362-8083510192ED
4ACA3504-5594-4D80-A799-5A425A320E51 6DA15BF7-7DDA-4659-AEAD-20129F854791 86B39158-5396-49A6-A1D7-C03029D57CAB AF7363BD-3376-4973-8D82-3CF1B5EBCAFF EF7618B2-30F1-48AB-9B6A-5DF7BCD7C8A9
4D27956B-14CD-40C9-8D30-8452F17D2091 6F8A2FCE-73BE-49F3-A5FB-344D84FA433E 8ADC0BD3-251F-4F2C-9EF5-E375B9A39C59 BC01184A-F22E-49D4-8CCB-866B9532D712 EFAE1B3A-C4CC-4A25-A670-6B3E4A83B54D
4E1C2F27-5176-479A-AE4D-20752F094F64 71C5A363-4414-4BE2-94C6-E2D3B2A3F9E6 8C92072D-920A-4FFF-B7B2-53E5521BCE5E BFF89B62-153C-423A-A020-1B1DA8FE2953 F2706485-9175-4445-8A45-D67805664DD8
51F85F3D-4B11-445E-BFE7-0F1A6CFF68F9 7291317D-F9DE-407A-ACF5-93CA7D86F981 90D22871-A8A9-4C4A-ADFB-10FADE7F0537 C10709BF-B458-4914-BB1F-947CFCD06349 F6C24404-1B43-4195-9ECA-53C3283AE747
5319E7A1-A766-4C28-BCEB-2360DEDD8441 762FFBC0-6B1E-4B7F-8C31-93D538327D78 92AB816A-980A-4FC0-9783-0003D4FC83B9 C25CA993-85DE-451D-AF20-8F898B7891B4 device_set.plist
execute the simulator from command line:
Note: The UUID can be found above or from 'xcrun simctl list'
iron@MacOS Devices % open -a Simulator --args -CurrentDeviceUDID A5060494-C262-4B70-8AF3-88B605CCA022
Open a url inside the simulated devices:
iron@MacOS ~ % xcrun simctl openurl booted '<https://google.com>'
Find where is a app installed in the simulator:
iron@MacOS DVIA-v2.app % xcrun simctl get_app_container booted com.highaltitudehacks.DVIAswiftv2
/Users/iron/Library/Developer/CoreSimulator/Devices/A5060494-C262-4B70-8AF3-88B605CCA022/data/Containers/Bundle/Application/0A0344CF-0D20-4A4D-9385-44DF69F168BA/DVIA-v2.app
Record Screen
iron@MacOS Documents % xcrun simctl io booted recordVideo sim.mov
Recording started
^C^CWrote video to: sim.mov
iron@MacOS Documents % open sim.mov
View logs
xcrun simctl spawn booted log stream -level=debug | grep APP_NAME