有没有办法在Xcode中设置一个触发器,以便在每次构建之后自动打开Safari调试器,或者可能是构建shell脚本或automator *** 作来构建并立即打开调试器的方法?
解决方法 这是一个部分解决方案。这将打开一个Safari的调试窗口,这是一个很好的,但不是自动的。在Mac上打开脚本编辑器(命令空间栏并键入脚本编辑器)
粘贴在此代码中:
-- `menu_click`,by Jacob Rus,September 2006-- -- Accepts a List of form: `{"Finder","VIEw","Arrange By","Date"}`-- Execute the specifIEd menu item. In this case,assuming the Finder -- is the active application,arranging the frontmost folder by date.on menu_click(mList) local appname,topMenu,r -- ValIDate our input if mList's length < 3 then error "Menu List is not long enough" -- Set these variables for clarity and brevity later on set {appname,topMenu} to (items 1 through 2 of mList) set r to (items 3 through (mList's length) of mList) -- This overly-long line calls the menu_recurse function with -- two arguments: r,and a reference to the top-level menu tell application "System Events" to my menu_click_recurse(r,((process appname)'s ¬ (menu bar 1)'s (menu bar item topMenu)'s (menu topMenu)))end menu_clickon menu_click_recurse(mList,parentObject) local f,r -- `f` = first item,`r` = rest of items set f to item 1 of mList if mList's length > 1 then set r to (items 2 through (mList's length) of mList) -- either actually click the menu item,or recurse again tell application "System Events" if mList's length is 1 then click parentObject's menu item f else my menu_click_recurse(r,(parentObject's (menu item f)'s (menu f))) end if end tellend menu_click_recursemenu_click({"Safari","Develop","Simulator","index.HTML"})
模拟器打开后,单击运行脚本(您可能需要首先允许脚本编辑器在设置中)。
(可选)您可以将脚本保存为应用程序,以便不必将脚本编辑器打开。
总结以上是内存溢出为你收集整理的iPhone模拟器启动时自动打开Safari Debugger全部内容,希望文章能够帮你解决iPhone模拟器启动时自动打开Safari Debugger所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)