Created
June 14, 2018 22:41
-
-
Save ricardopereira/adae5038191ac9f8d4ee03c23fde1b8c to your computer and use it in GitHub Desktop.
How to enable/disable “Show as run destination” for all simulators https://stackoverflow.com/questions/50796954/how-to-enable-disable-show-as-run-destination-for-all-simulators
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
simulatorsIdentifiers=$(instruments -s devices | | |
grep -o "iPhone .* (.*) \[.*\]" | #only iPhone | |
grep -o "\[.*\]" | #only UUID | |
sed "s/^\[\(.*\)\]$/\1/" | #remove square brackets | |
sed 's/^/"/;$!s/$/"/;$s/$/"/' | #add quotes | |
sed '$!s/$/,/' #add comma to separate each element | |
) | |
arrayOfSimulatorsIdentifiers=($(echo "$simulatorsIdentifiers" | tr ',' '\n')) | |
# Add simulators to DVTIgnoredDevices | |
echo "${#arrayOfSimulatorsIdentifiers[@]}" | |
for index in "${!arrayOfSimulatorsIdentifiers[@]}" | |
do | |
echo "$index Adding: ${arrayOfSimulatorsIdentifiers[index]}" | |
done | |
defaults write com.apple.dt.Xcode DVTIgnoredDevices -array ${arrayOfSimulatorsIdentifiers[@]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for xcode 13 this works for me