Last active
September 7, 2020 12:03
-
-
Save carlosefonseca/ab749c9f8192e622c6513e07f3593efa to your computer and use it in GitHub Desktop.
Takes booted iOS simulators and changes their current keyboard to PT_PT.
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
sim_set_pt_booted() { | |
for d in $(xcrun simctl list devices booted | grep Booted | perl -pe "s/.*\(([^ ]+)\) \(Booted\)/\1/") | |
do | |
echo -n $d | |
/usr/libexec/PlistBuddy -c "Set :AppleKeyboards:2 pt_PT@sw=QWERTY;hw=Automatic" -c "Set :AppleLanguages:1 pt-PT" -c "Set :AppleKeyboards:3 pt_PT@sw=QWERTY;hw=Automatic" ~/Library/Developer/CoreSimulator/Devices/$d/data/Library/Preferences/.GlobalPreferences.plist | |
# This is reset on restart (last checked on iOS 13.7) | |
/usr/libexec/PlistBuddy -c "Set :AutomaticMinimizationEnabled false" ~/Library/Developer/CoreSimulator/Devices/$d/data/Library/Preferences/com.apple.Preferences.plist | |
echo " Files patched. Restarting device… " | |
xcrun simctl shutdown $d | |
xcrun simctl boot $d | |
done | |
echo "Done" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment