https://developer.apple.com/download/more/
get a list of all simulators. Actually running simulators will be marked as (booted in the list). Identify the UUID for the simulator that you want to use from the list
xcrun simctl list
#!/bin/bash
cd;
IFS=$'\n'; # for likes to split strings into items by IFS, to process the string line by line it is necessary to reduce IFS to \n
for i in $(xcrun simctl list -v devices | grep Booted); do
CURRENT_DEVICE="${i:$((${#i} - 47)):36}"; # extract 36 long substring beginning in -46 position which should be UUID
xcrun simctl shutdown "$CURRENT_DEVICE";
xcrun simctl erase "$CURRENT_DEVICE";
xcrun simctl boot "$CURRENT_DEVICE";
done;
unset IFS;
xcrun simctl shutdown all
xcrun simctl erase all
xcrun simctl boot "iPhone 8 Plus"
$xcrun simctl install ~/Library/Developer/Xcode/DerivedData//Build/Products/Debug-iphonesimulator/.app
if you intentionally chaged the deriveddata path you should naturally use that path here.
(should look similar to this: xcrun simctl install F77DFD12-730C-48A8-B937-85D3AE1C1EA8 ~/Library/Developer/Xcode/DerivedData/Mein_o2-alhzujwksbfabyeyappxkmiqezvt/Build/Products/Debug-iphonesimulator/Mein o2 Beta.app)
You can't just dump a normal .ipa or .app file into the simultor. You need a specific .app file for a simulator. XCode actually creates this file automatically each the time you build an .ipa but will not hand it to you. You have to go into system folders and get it for yourself.
Because XCode makes the file for every .ipa build you can probably immediately find it in ~/Library/Developer/Xcode/DerivedData//Build/Products/Debug-iphonesimulator/.app
For Jenkins jobs you will want to build with CLI commands. Navigate to the project folder and do the following.
$xcodebuild -workspace './Mein o2.xcworkspace/' -scheme '' -arch x86_64 -sdk (example: >$xcodebuild -workspace './Mein o2.xcworkspace/' -scheme 'Mein o2 Beta' -arch i386 -sdk iphonesimulator12.1)
Either way you can search for the the results using >$find ~/Library/Developer/Xcode/DerivedData -name ".app"
You can change the weird path with the compiler option -derivedDataPath //
xcodebuild -derivedDataPath <some path> -workspace '<filename>.xcworkspace' -scheme '<one single scheme>' \ -sdk iphonesimulator12.1 -arch x86_64 clean build;
xcodebuild -showsdks
This will dump a list of discovered paths:
xcode-select -p /Applications/Xcode-7.2.app/Contents/Developer This will programmatically set the path to use: sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
instruments -s devices
#Simulator
open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/