I removed all the listed items from Xcode's Window Menu → devices and simulators, which listed iOS 12 as their OS version. This is a long list, so use the quick-dirty AppleScript code given at the end.
Went to iOS settings → Developer and cleared paired devices.
Connected iPhone, unlocked it and chose "Don't Trust" upon prompt.
Applescript click automation in Google Chrome browser?
Run script in automator (without terminal)
brew install cliclick
Create a new (.txt) File in Finder - Keyboard Shortcut see this for using Automator + AppleScript.
Copy paste the Automator block to repeat the script, or use repeat
feature of the code, or tie it with a shortcut.
-- Click “Xcode” in the Dock.
delay 0.0387
set timeoutSeconds to 2.0
set uiScript to "click UI Element \"Xcode\" of list 1 of application process \"Dock\""
my doWithTimeout(uiScript, timeoutSeconds)
--
delay 0.273133
set timeoutSeconds to 2.0
set uiScript to "click tool bar 1 of window \"Devices\" of application process \"Xcode\""
my doWithTimeout(uiScript, timeoutSeconds)
-- Click the “Simulators” radio button.
delay 0.059993
set timeoutSeconds to 2.0
set uiScript to "click radio button \"Simulators\" of radio group 1 of group 1 of tool bar 1 of window \"Devices\" of application process \"Xcode\""
my doWithTimeout(uiScript, timeoutSeconds)
-- Type “iPad Air” into the text field.
do shell script "/usr/local/bin/cliclick rc:252,252"
-- Delete
delay 0.88761
set timeoutSeconds to 2.0
set uiScript to "click menu item \"Delete\" of menu 1 of outline 1 of scroll area 1 of splitter group 1 of group 1 of window \"Devices\" of application process \"Xcode\""
my doWithTimeout(uiScript, timeoutSeconds)
-- Click the “Delete” button.
delay 0.267897
set timeoutSeconds to 2.0
set uiScript to "click UI Element \"Delete\" of sheet 1 of window \"Devices\" of application process \"Xcode\""
my doWithTimeout(uiScript, timeoutSeconds)
on doWithTimeout(uiScript, timeoutSeconds)
set endDate to (current date) + timeoutSeconds
repeat
try
run script "tell application \"System Events\"
" & uiScript & "
end tell"
exit repeat
on error errorMessage
if ((current date) > endDate) then
error "Can not " & uiScript
end if
end try
end repeat
end doWithTimeout
Since it causes problem for iTunes backup and network sharing, Go to `/Users/ankitkumar/Library/Developer/Xcode/iOS DeviceSupport/12.4` right click on it > get info > Check locked.