{"id":861,"date":"2014-01-15T21:53:47","date_gmt":"2014-01-15T13:53:47","guid":{"rendered":"http:\/\/www.yeetrack.com\/?p=861"},"modified":"2023-11-23T09:52:23","modified_gmt":"2023-11-23T01:52:23","slug":"ios-monkey%e6%b5%8b%e8%af%95ui-automonkey","status":"publish","type":"post","link":"https:\/\/www.yeetrack.com\/?p=861","title":{"rendered":"IOS Monkey\u6d4b\u8bd5UI AutoMonkey"},"content":{"rendered":"<h1>UI AutoMonkey<\/h1>\n<p>UI AUtoMonkey\u662f\u4e00\u6b3e\u975e\u5e38\u7b80\u5355\u7684IOS\u538b\u529b\u6d4b\u8bd5\u5de5\u5177\u3002\u901a\u8fc7\u5b83\uff0c\u4f60\u53ef\u4ee5\u5411ios\u8bbe\u5907\u53d1\u9001\u6ed1\u52a8\u3001\u62d6\u52a8\u3001\u65cb\u8f6c\u3001\u751a\u81f3\u9501\u5c4f\u548c\u89e3\u9501\u6307\u4ee4\u3002\u539f\u6587github\u5730\u5740\uff1a<a href=\"https:\/\/github.com\/jonathanpenn\/ui-auto-monkey\"><\/a><a href=\"https:\/\/github.com\/jonathanpenn\/ui-auto-monkey\">https:\/\/github.com\/jonathanpenn\/ui-auto-monkey<\/a><\/p>\n<h2>\u5b89\u88c5<\/h2>\n<p>\u5982\u679c\u4f60\u7684mac\u7535\u8111\u5df2\u7ecf\u5b89\u88c5\u4e86xcode\uff0c\u90a3\u4e48\u73af\u5883\u5c31\u5df2\u7ecfok\u4e86\uff0cxcode\u4e2d\u5df2\u7ecf\u81ea\u5e26\u4e86UI Automation\u548cInstruments\u3002\u8ddf\u7740\u4e0b\u9762\u7684\u6b65\u9aa4\u8fdb\u884c\u64cd\u4f5c\u5c31\u53ef\u4ee5\u4f7f\u7528<code>UIAutomonkey.js<\/code>\u8fd9\u4e2ajs\u811a\u672c\uff0c\u8fdb\u884cmonkey\u6d4b\u8bd5\u3002<\/p>\n<ul>\n<li>\u9996\u5148\uff0c\u4f7f\u7528xcode\u6253\u5f00\u4f60\u7684ios\u9879\u76ee\uff0c\u4ece\u201cProduct\u201d\u83dc\u5355\u4e2d\u9009\u62e9\u201cProfile\u201d\uff08\u6216\u8005\u76f4\u63a5\u5feb\u6377\u952eCommand+i),\u8fd9\u6837\u5c31\u53ef\u4ee5\u6784\u5efaios\u9879\u76ee\uff0c\u5e76\u542f\u52a8\u5de5\u5177\u6a21\u677f\u9009\u62e9\u5668\u3002<!--more--><a href=\"https:\/\/yeetrack-space.bj.bcebos.com\/blog\/201401\/\/profile1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-863\" alt=\"profile\" src=\"https:\/\/yeetrack-space.bj.bcebos.com\/blog\/201401\/\/profile1.png\" width=\"215\" height=\"154\" \/><\/a><\/li>\n<li>\u4e0b\u4e00\u6b65\uff0c\u5728\u9009\u62e9\u5668\u4e2d\u9009\u62e9\u201cUI Automation\u201d\u3002\u5f53\u6211\u4eec\u521b\u5efa\u4e86\u81ea\u52a8\u5316\u6a21\u677f\u540e\uff0c\u5c31\u53ef\u4ee5\u6d4b\u8bd5app\u7684\u6027\u80fd\u4e86\u3002<\/li>\n<li>\u5728Scripts\u9762\u677f\u4e2d\uff0c\u70b9\u51fb\u201cEditor Log\u201d\uff0c\u5728\u4e0b\u62c9\u5217\u8868\u4e2d\u9009\u62e9\u201cScript\u201d\uff0c\u70b9\u51fb\u201cAdd\u201d\u6309\u94ae\uff0c\u5728\u4e0b\u62c9\u5217\u8868\u4e2d\u9009\u62e9\"Create\",\u5c31\u53ef\u4ee5\u65b0\u5efa\u4e00\u4e2ajs\u811a\u672c\u3002<a href=\"https:\/\/yeetrack-space.bj.bcebos.com\/blog\/201401\/\/scriptpane.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-865\" alt=\"scriptpane\" src=\"https:\/\/yeetrack-space.bj.bcebos.com\/blog\/201401\/\/scriptpane.png\" width=\"352\" height=\"213\" \/><\/a><\/li>\n<li>\u5c06<code>UIAutoMonkey.js<\/code>\u8fd9\u4e2a\u6587\u4ef6\u7684\u5185\u5bb9\u7c98\u8d34\u5230\u65b0\u5efa\u7684js\u811a\u672c\u4e2d\uff08\u6216\u8005\u53ef\u4ee5\u76f4\u63a5\u5c06<code>UIAutoMonkey.js<\/code>import\u8fdb\u53bb\u3002<a href=\"https:\/\/yeetrack-space.bj.bcebos.com\/blog\/201401\/\/createscript.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-866\" alt=\"createscript\" src=\"https:\/\/yeetrack-space.bj.bcebos.com\/blog\/201401\/\/createscript.png\" width=\"315\" height=\"187\" \/><\/a><\/li>\n<li>\u6b64\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u70b9\u51fb\u64ad\u653e\u6309\u94ae\uff0c\u6765\u6267\u884c\u8fd9\u6bb5\u811a\u672c\uff0cmonkey\u6d4b\u8bd5\u5c31\u5f00\u59cb\u4e86\u3002<\/li>\n<\/ul>\n<h2>\u989d\u5916\u914d\u7f6e<\/h2>\n<p><code>UIAutoMonkey.js<\/code>\u811a\u672c\uff0c\u5f00\u5934\u662f\u4e0b\u9762\u7684\u4ee3\u7801\uff1a<\/p>\n<pre><code>    config: {\n        numberOfEvents: 1000,\n        delayBetweenEvents: 0.05,    \/\/ In seconds\n\n        \/\/\u5404\u4e8b\u4ef6\u7684\u51e0\u7387.\n        \/\/ \u6570\u5b57\u8d8a\u5927\uff0c\u51e0\u7387\u8d8a\u5927.\n        eventWeights: {\n            tap: 30,\n            drag: 1,\n            flick: 1,\n            orientation: 1,\n            clickVolumeUp: 1,\n            clickVolumeDown: 1,\n            lock: 1,\n            pinchClose: 10,\n            pinchOpen: 10,\n            shake: 1\n        },\n\n        \/\/ Probability that touch events will have these different properties\n        touchProbability: {\n            multipleTaps: 0.05,\n            multipleTouches: 0.05,\n            longPress: 0.05\n        }\n        },\n<\/code><\/pre>\n<p><code>numberOfEvent<\/code>\u7684\u610f\u601d\u5f88\u660e\u786e\uff0c\u4ee3\u8868\u9700\u8981\u4ea7\u751f\u968f\u673a\u4e8b\u4ef6\u7684\u4e2a\u6570\u3002<\/p>\n<p><code>delayBetweenEvents<\/code>\u4ee3\u8868\u4e24\u4e2a\u4e8b\u4ef6\u4e4b\u95f4\u7684\u5ef6\u8fdf\u65f6\u95f4\u3002\u8fd9\u4e2a\u503c\u4e00\u822c\u662f\u9700\u8981\u8c03\u6574\u7684\u3002\u5982\u679c\u8be5\u503c\u4e3a0\uff0c\u90a3\u4e48\u811a\u672c\u4f1a\u5c3d\u53ef\u80fd\u5feb\u7684\u5411\u8bbe\u5907\u53d1\u9001\u4e8b\u4ef6\u3002<\/p>\n<p><code>eventWeights<\/code>\u8fd9\u4e2a\u503c\u4ee3\u8868\u6bcf\u4e2a\u4e8b\u4ef6\u7684\u89e6\u53d1\u51e0\u7387\u3002\u5982\u679c<code>tab<\/code>\u4e8b\u4ef6\u7684\u503c\u4e3a100\u3001<code>orientation<\/code>\u4e8b\u4ef6\u7684\u503c\u4e3a1\uff0c\u90a3\u4e48<code>tab<\/code>\u4e8b\u4ef6\u89e6\u53d1\u7684\u51e0\u7387\u5c31\u662f<code>orientation<\/code>\u7684100\u500d\u3002<\/p>\n<p><code>touchProbability<\/code>\u63a7\u5236\u7740\u4e0d\u540c\u79cd\u7c7b\u7684<code>tab<\/code>\u4e8b\u4ef6\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0ctab\u5c31\u662f\u5355\u51fb\u4e8b\u4ef6\u3002\u8c03\u6574\u8fd9\u4e9b\u53c2\u6570\u53ef\u4ee5\u8bbe\u7f6e\u53cc\u51fb\u3001\u957f\u6309\u4e8b\u4ef6\u53d1\u751f\u7684\u9891\u7387\u3002\u8fd9\u4e9b\u503c\u8981\u754c\u4e8e0\u30011\u4e4b\u95f4\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>UI AutoMonkey UI AUtoMonkey\u662f\u4e00\u6b3e\u975e\u5e38\u7b80\u5355\u7684IOS\u538b\u529b\u6d4b\u8bd5\u5de5\u5177\u3002\u901a\u8fc7\u5b83\uff0c\u4f60\u53ef\u4ee5\u5411ios\u8bbe\u5907\u53d1\u9001\u6ed1\u52a8\u3001\u62d6\u52a8\u3001\u65cb\u8f6c\u3001\u751a\u81f3\u9501\u5c4f\u548c\u89e3\u9501\u6307\u4ee4\u3002\u539f\u6587github\u5730\u5740\uff1ahttps:\/\/gi&#46;&#46;&#46;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"pgc_sgb_lightbox_settings":"","footnotes":""},"categories":[33],"tags":[44,7,5,16,42,41],"class_list":["post-861","post","type-post","status-publish","format-standard","hentry","category-coding","tag-ios","tag-7","tag-5","tag-16","tag-42","tag-41"],"views":16226,"_links":{"self":[{"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/posts\/861","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=861"}],"version-history":[{"count":3,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/posts\/861\/revisions"}],"predecessor-version":[{"id":1515,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/posts\/861\/revisions\/1515"}],"wp:attachment":[{"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=861"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=861"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=861"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}