Reputation: 1941
I am trying to open iOS Simulator using terminal to execute an automation test script. After some thorough research, I am able to open a simulator and instruments. By default, it is launching iPhone Retina simulator. But how can I open specified simulator&version Eg: iPad 2 - 7.0
version.
I have tried using instruments -w help
from here, I have got an error like Instruments Usage Error : Unknown hardware device specified.
I have tried various sources, but i am helpless. Any idea how to launch specified simulator (if possible in XCode 5/6)?
Upvotes: 0
Views: 704
Reputation: 21436
I also got error Instruments Usage Error : Ambiguous device name/identifier
But Device name was correct. To solve it
Profit!
Upvotes: 1
Reputation: 1941
Additionally, to @Vaasu's answer, if system throws an error of device ambiguity, you can give the device id in place of device model.
For eg: in my system, these are the available devices.
Resizable iPad (8.0 Simulator) [97067B56-428E-48DE-A35E-87442AE0B2F7]
Resizable iPhone (8.0 Simulator) [A50156D2-F5B9-4781-99FC-F7D2D64C8C78]
iPad 2 (7.1 Simulator) [C298E193-48FD-451C-9173-A2B70A4B6232]
iPad 2 (7.1 Simulator) [2A03A43F-3F4F-453A-9469-E2F84598FE2D]
iPad 2 (8.0 Simulator) [95E5D9E5-6EA7-47DB-AC9D-40880CD78F98]
iPad 2 (8.0 Simulator) [F51C4654-76C8-4B33-A283-8A9B21FF403A]
iPad Air (7.1 Simulator) [0682AD59-0991-4E41-9636-F4450BC4DABC]
iPad Air (8.0 Simulator) [B5748FCD-FE67-46EE-BD4A-C1BE0FA160A7]
iPad Retina (7.1 Simulator) [E2D7C775-F0EC-4AE7-82CD-EAA8E2EE8E25]
iPad Retina (8.0 Simulator) [9C1576B3-58E4-412A-8574-64E60D43E4D0]
iPhone 4s (7.1 Simulator) [6E94CA56-62EC-45BF-AD01-5166FACC75EB]
iPhone 4s (8.0 Simulator) [39E3AD04-62B4-4D10-A60B-D48204785508]
iPhone 5 (7.1 Simulator) [EB5E3DEA-5D12-46B1-A18D-21B06F3FAC26]
iPhone 5 (8.0 Simulator) [0692F6C0-57ED-43EA-9599-A49F3BA86435]
iPhone 5s (7.1 Simulator) [EBB1E555-47B6-410A-98AF-1145728590E3]
iPhone 5s (8.0 Simulator) [26639A3B-F979-4BFD-920D-A6AB9E92D0AB]
iPhone 6 (8.0 Simulator) [22797884-9582-4813-AEFF-9155C0DCCCE6]
iPhone 6 Plus (8.0 Simulator) [DE881BB5-434C-4F38-8BF8-D199BEF57919]
for this, you can run the script in this way.
$instruments\
-w "C298E193-48FD-451C-9173-A2B70A4B6232" \
-t $TRACETEMPLATE AppLocation \
-e UIASCRIPT Script.js \
-e UIARESULTSPATH reportPath
Upvotes: 0
Reputation: 66
In Xcode 5.1, instruments command-line tool supports specifying the simulator SDK and device type using the -w flag. To see a list of the supported simulator configurations as well as attached devices, execute below command in a Terminal window.
$instruments -s devices
Example to run tests on iPhone simulator:
$instruments\
-w "iPhone Retina (4-inch 64-bit) - Simulator - iOS 7.1" \
-t $TRACETEMPLATE AppLocation \
-e UIASCRIPT Script.js \
-e UIARESULTSPATH reportPath
Upvotes: 3