我正在尝试修改plist文件:/Volumes/MacintoshHD/Users/christian/Library/Application Support/iPhone Simulator/4.3.2/Library/Preferences/com.apple.Accessibility.plist
这是我的noob python脚本:
import plistlib
import os.path
#set path
prefs_path = os.path.expanduser("~/Library/Application\ Support/iPhone\ Simulator/5.0/Library/Preferences/com.apple.Accessibility.plist")
#parse
prefs = plistlib.readPlist(prefs_path)
我得到IOError: 2, 'No such file or directory'
如果我从路径中删除反斜杠,我会得到ExpatError: 'not well-formed (invalid token): line 1, column 8'
Ignacio Vazquez-Abram's answer表示该文件已损坏。它仍然可以使用Xcode编辑,并可以通过Quicklook查看。模拟器工作正常。
当我在文本中打开它时,我看到的是:
bplist00ÿ
D _ApplicationAccessibilityEnabled_VOTQuickNavEnabled_AccessibilityEnabled]ScreenCurtain_"VoiceOverTouchRotorItemsPreference_AXInspector.enabled_AXInspector.frame_AXInspectorEnabled Ø"%(+.147:=@“ YRotorItemWEnabledYCharacter “ TWord “ TLine “ VHeader “ TLink “ [FormElement “# ZTableStart “&YListStart“)YLandmarks“,[VisitedLink“/^NonVisitedLink“2VButton“5YTextField“8UImage“;ZStaticText“>\InternalLink“ATZoom_{{0, 0}, {276, 166}} ;Pguö∞ƒŸ⁄€‹›Òˆ#().56;@AFRSXcdistyÉÑâïñõ™´∞∑∏Ω«»Õ”‘Ÿ‰Â͘¯˝F
iPhone模拟器是否因python而无法编辑,或者这是一个损坏的文件?有没有解决的办法?
答案 0 :(得分:3)