{"id":1584,"date":"2024-04-09T10:06:08","date_gmt":"2024-04-09T02:06:08","guid":{"rendered":"https:\/\/www.gyxwsjdxh.com\/?p=1584"},"modified":"2024-04-09T10:06:08","modified_gmt":"2024-04-09T02:06:08","slug":"%e5%b9%b2%e8%b4%a7%ef%bd%9c%e6%89%8b%e6%8a%8a%e6%89%8b%e6%95%99%e4%bd%a0%e5%81%9aapp%e8%87%aa%e5%8a%a8%e5%8c%96%e6%b5%8b%e8%af%95","status":"publish","type":"post","link":"https:\/\/www.gyxwsjdxh.com\/1584.html","title":{"rendered":"\u5e72\u8d27\uff5c\u624b\u628a\u624b\u6559\u4f60\u505aapp\u81ea\u52a8\u5316\u6d4b\u8bd5"},"content":{"rendered":"\n

\n

\u4ec0\u4e48\u662fApp\u81ea\u52a8\u5316\uff1f\u4e3a\u4ec0\u4e48\u8981\u505aApp\u81ea\u52a8\u5316\uff1f<\/h1>\n

App\u81ea\u52a8\u5316\u662f\u6307\u7ed9 Android\u6216iOS\u4e0a\u7684\u8f6f\u4ef6\u5e94\u7528\u7a0b\u5e8f\u505a\u7684\u81ea\u52a8\u5316\u6d4b\u8bd5\u3002<\/strong><\/p>\n

\u624b\u5de5\u6d4b\u8bd5\u548c\u81ea\u52a8\u5316\u6d4b\u8bd5\u7684\u5bf9\u6bd4\u5982\u4e0b\uff1a<\/strong><\/p>\n

\u624b\u5de5\u6d4b\u8bd5\u4f18\u52bf\uff1a<\/strong>\u4e0d\u53ef\u66ff\u4ee3\u3001\u53d1\u73b0\u66f4\u591abug\u3001\u5305\u542b\u4e86\u4eba\u7684\u60f3\u8c61\u529b\u4e0e\u7406\u89e3\u529b\u3002<\/p>\n

\u6ce8\u610f\uff0c\u4e0d\u662f\u6240\u6709\u529f\u80fd\u90fd\u9700\u8981\u81ea\u52a8\u5316\u3002<\/span><\/p>\n

\u81ea\u52a8\u5316\u6d4b\u8bd5\u4f18\u52bf\uff1a<\/strong>\u53ef\u91cd\u590d\u3001\u6548\u7387\u9ad8\uff0c\u589e\u52a0\u8f6f\u4ef6\u4fe1\u4efb\u5ea6\u3002<\/p>\n

\u6267\u884c\u81ea\u52a8\u5316\u6d4b\u8bd5\u53ef\u4ee5\u8ba9\u6d4b\u8bd5\u540c\u4e8b\u6709\u66f4\u591a\u7684\u7cbe\u529b\u6765\u5173\u6ce8\u590d\u6742\u573a\u666f\uff0c\u505a\u66f4\u591a\u66f4\u6df1\u5c42\u6b21\u7684\u6d4b\u8bd5\u3002<\/p>\n

\u98ce\u9669\u5206\u6790<\/h1>\n

\u81ea\u52a8\u5316\u6d4b\u8bd5\u7684\u4e3b\u8981\u98ce\u9669\u5206\u6790\u5982\u4e0b\uff1a<\/strong><\/p>\n

\uff081\uff09\u6d4b\u8bd5\u7528\u4f8b\u8986\u76d6\u7387\uff08\u8986\u76d6\u7387\u51b3\u5b9a\u6d4b\u8bd5\u6548\u7387\uff0c\u9009\u62e9\u5408\u9002\u7528\u4f8b\uff0c\u5e94\u7ea6\u5360\u529f\u80fd\u7528\u4f8b\u96c6\u768420%~50%\uff09<\/p>\n

\uff082\uff09\u6d4b\u8bd5\u7ed3\u679c\u51c6\u786e\u5ea6\uff08\u51c6\u786e\u5ea6\u51b3\u5b9a\u4e86\u6d4b\u8bd5\u6709\u6548\u6027\uff0c\u5e94\u5c3d\u53ef\u80fd\u51cf\u5c11\u8bef\u62a5\uff09\u3002<\/p>\n

\uff083\uff09\u81ea\u52a8\u5316\u4ee3\u7801\u7ef4\u62a4\uff08\u7ef4\u62a4\u51b3\u5b9a\u4e86\u6210\u672c\uff0c\u6570\u636e\u5173\u952e\u5b57\u9a71\u52a8\u81ea\u52a8\u5316\u6846\u67b6\uff0c\u4ee3\u7801\u5e94\u5c3d\u53ef\u80fd\u4f18\u5316\u548c\u5c11\u6539\u52a8\uff09\u3002<\/p>\n

\uff084\uff09\u7248\u672c\u5f00\u53d1\u548c\u6d4b\u8bd5\u65f6\u95f4\u8fdb\u5ea6\uff08\u5f53\u9879\u76ee\u9700\u6c42\u548c\u529f\u80fd\u8f83\u4e3a\u7a33\u5b9a\u65f6\uff0c\u5efa\u8bae\u7528\u81ea\u52a8\u5316\uff09\u3002<\/p>\n

\uff085\uff09\u5f00\u53d1\u5bf9\u63a7\u4ef6\u5143\u7d20\u589e\u4fee\u6539\u7684\u7a0b\u5ea6\uff08\u9700\u5f00\u53d1\u4eba\u5458\u5c3d\u53ef\u80fd\u5730\u7528name\u5143\u7d20\uff0c\u5e76\u4e14\u548cUI\u8bbe\u8ba1\u4e00\u81f4\uff0c\u4fee\u6539\u53d8\u52a8\u7a0b\u5ea6\u4e0d\u5927\uff0c\u6d4b\u8bd5\u4eba\u5458\u53ef\u6839\u636e\u63d0\u4f9b\u7684\u5143\u7d20\u63d0\u524d\u4ecb\u5165\uff0c\u5f00\u53d1\u81ea\u52a8\u5316\u811a\u672c\uff09\u3002<\/p>\n

App\u6e90\u7801\u6743\u9650\u63a7\u5236\uff0ciOS\u4e0a\u6d4b\u8bd5\u9700\u8981\u6e90\u7801\u3002\u5b9e\u9645\u6d4b\u8bd5\u53ea\u9700SVN\u6216\u8005git\u4e0b\u8f7d\u6743\u9650\uff0c\u800c\u4e0d\u9700\u8981\u4e0a\u4f20\u6743\u9650\u3002\u9632\u6b62\u6539\u52a8SVN\u6216\u8005git \u4e0a\u7684\u6e90\u7801\u3002<\/p>\n

\u6280\u672f\u6846\u67b6<\/h1>\n

1\u3001\u81ea\u52a8\u5316\u5b66\u4e60\u8fc7\u7a0b<\/strong><\/p>\n

\u81ea\u52a8\u5316\u6d4b\u8bd5\u73af\u5883\u7684\u90e8\u7f72–>\u81ea\u52a8\u5316\u6d4b\u8bd5\u811a\u672c\u5f00\u53d1\u80fd\u529b—>\u81ea\u52a8\u5316\u6d4b\u8bd5\u6846\u67b6\u7814\u53d1—>\u624b\u673a\u81ea\u52a8\u5316\u6301\u7eed\u96c6\u6210<\/p>\n

2\u3001andorid \u7cfb\u7edf\u67b6\u6784\u56fe<\/strong><\/p>\n

\"\u5e72\u8d27\uff5c\u624b\u628a\u624b\u6559\u4f60\u505aapp\u81ea\u52a8\u5316\u6d4b\u8bd5\u63d2\u56fe\"<\/div>\n

3\u3001\u624b\u673a\u81ea\u52a8\u5316\u6d4b\u8bd5\u73af\u5883<\/strong><\/p>\n

\u5b89\u88c5Appium–>\u5b89\u88c5\u624b\u673a\u6a21\u62df\u5668–>\u5b89\u88c5selenium\u548cappium\u7684\u5ba2\u6237\u7aef–>\u5b89\u88c5\u88ab\u6d4b\u8bd5app<\/p>\n

4\u3001Appium \u8f6f\u4ef6\u67b6\u6784<\/strong><\/p>\n

\"\u5e72\u8d27\uff5c\u624b\u628a\u624b\u6559\u4f60\u505aapp\u81ea\u52a8\u5316\u6d4b\u8bd5\u63d2\u56fe1\"<\/div>\n

5\u3001\u5e38\u7528\u7684\u5b9a\u4f4d\u6280\u672f\u548c\u5de5\u5177<\/strong><\/p>\n

\"\u5e72\u8d27\uff5c\u624b\u628a\u624b\u6559\u4f60\u505aapp\u81ea\u52a8\u5316\u6d4b\u8bd5\u63d2\u56fe2\"<\/div>\n

6\u3001\u81ea\u52a8\u5316\u6d4b\u8bd5\u811a\u672c\u6280\u672f<\/strong><\/p>\n

\"\u5e72\u8d27\uff5c\u624b\u628a\u624b\u6559\u4f60\u505aapp\u81ea\u52a8\u5316\u6d4b\u8bd5\u63d2\u56fe3\"<\/div>\n

7\u3001\u6280\u672f\u6846\u67b6\u7ed3\u6784\u56fe<\/strong><\/p>\n

\"\u5e72\u8d27\uff5c\u624b\u628a\u624b\u6559\u4f60\u505aapp\u81ea\u52a8\u5316\u6d4b\u8bd5\u63d2\u56fe4\"<\/div>\n

APP\u81ea\u52a8\u5316\u6d4b\u8bd5\u6d41\u7a0b<\/h1>\n

1\u3001\u73af\u5883\u7684\u5b89\u88c5<\/strong><\/p>\n

1.1 \u73af\u5883\u7684\u51c6\u5907<\/strong><\/p>\n

1\uff1ajdk1.6\u4ee5\u4e0a<\/p>\n

2\uff1apython2.7\u4ee5\u4e0a<\/p>\n

3: android-sdk<\/p>\n

4:Appium desktop \u5b89\u88c5<\/p>\n

1.2 jdk \u5b89\u88c5<\/strong><\/p>\n

1\uff1a\u4e0b\u8f7dJDK\u540e\u50bb\u74dc\u5f0f\u5b89\u88c5\uff0c\u6ce8\u610f\uff1a\u4e0d\u8981\u6709\u4e2d\u6587\u8def\u5f84\u548c\u7a7a\u683c<\/p>\n

2\uff1a\u914d\u7f6e\u73af\u5883\u53d8\u91cf\uff1a<\/p>\n

\u53f3\u51fb\u201c\u6211\u7684\u7535\u8111\u201d–>”\u5c5e\u6027”–>”\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e”–>”\u9ad8\u7ea7”–>”\u73af\u5883\u53d8\u91cf” <\/span><\/strong><\/p>\n

1\uff09\u5728\u7cfb\u7edf\u53d8\u91cf\u91cc\u65b0\u5efa”JAVA_HOME”\u53d8\u91cf\uff0c\u53d8\u91cf\u503c\u4e3a\uff1aC:\\Program Files\\Java\\jdk1.8.0_60\uff08\u6839\u636e\u81ea\u5df1\u7684jdk\u7684\u5b89\u88c5\u8def\u5f84\u586b\u5199\uff09<\/span><\/p>\n

2\uff09\u5728\u7cfb\u7edf\u53d8\u91cf\u91cc\u65b0\u5efa”classpath”\u53d8\u91cf\uff0c\u53d8\u91cf\u503c\u4e3a\uff1a.;%JAVA_HOME%\\lib;%JAVA_HOME%\\lib\\tools.jar (\u6ce8\u610f\u6700\u524d\u9762\u6709\u4e00\u70b9)<\/span><\/p>\n

3\uff09\u627e\u5230path\u53d8\u91cf\uff08\u5df2\u5b58\u5728\u4e0d\u7528\u65b0\u5efa\uff09\u6dfb\u52a0\u53d8\u91cf\u503c\uff1a%JAVA_HOME%\\bin;%JAVA_HOME%\\jre\\bin<\/span><\/p>\n

1.3 python \u5b89\u88c5<\/strong><\/p>\n

1:\u50bb\u74dc\u5f0f\u5b89\u88c5\uff0c<\/p>\n

2:\u914d\u7f6e\u73af\u5883\u53d8\u91cf\uff1a\u7535\u8111\u5c5e\u6027\u7cfb\u7edf\u53d8\u91cf\u6dfb\u52a0python\u6839\u76ee\u5f55<\/p>\n

1.4 \u5b89\u88c5Android\u7684\u6d4b\u8bd5\u5f00\u53d1\u73af\u5883<\/strong><\/p>\n

1:Android-SDK\u7684\u5b89\u88c5\uff1aSDK manager.exe \u53cc\u51fb\u6253\u5f00\u4e0b\u8f7d<\/p>\n

\"\u5e72\u8d27\uff5c\u624b\u628a\u624b\u6559\u4f60\u505aapp\u81ea\u52a8\u5316\u6d4b\u8bd5\u63d2\u56fe5\"<\/div>\n

2:android-sdk\u73af\u5883\u53d8\u91cf\u7684\u914d\u7f6e<\/p>\n

\u5177\u4f53\u64cd\u4f5c\u6b65\u9aa4\uff1a<\/strong><\/p>\u65b0\u5efaANDROID_HOME

\u8def\u5f84\u4e3aC:\\Program Files (x86)\\Android\\android-sdk\\<\/p>\u5728Path \u53d8\u91cf\u4e2d\u52a0\u5165\u8def\u5f84

%ANDROID_HOME%\\platform-tools \u548c %ANDROID_HOME%\\tools<\/p>\u68c0\u67e5adb \u73af\u5883\u53d8\u91cf

\"\u5e72\u8d27\uff5c\u624b\u628a\u624b\u6559\u4f60\u505aapp\u81ea\u52a8\u5316\u6d4b\u8bd5\u63d2\u56fe6\"<\/div>\u8fde\u63a5\u624b\u673a

\u5982\u679c\u662f\u771f\u673a\uff0c\u624b\u673a\u63d2\u4e0aUSB\u8fde\u63a5\u7535\u8111\uff0c\u6253\u5f00\u5f00\u53d1\u8005\u6a21\u5f0f\uff0ccmd\u8f93\u5165adb devices<\/p>\n

\u5982\u679c\u662f\u6a21\u62df\u5668\uff0c\u9700\u8981\u8f93\u5165adb connect 127.0.0.1:62001\u6216\u800552001\u8fde\u63a5\uff0c\u7136\u540e\u518d\u8f93\u5165adb devices<\/p>\n

Appium desktop \u5b89\u88c5<\/strong><\/p>\n

\u4e0b\u8f7d\u5730\u5740\uff1ahttps:\/\/github.com\/appium\/appium-desktop\/releases\/tag\/v1.3.1<\/span><\/p>\n

\u50bb\u74dc\u5f0f\u5b89\u88c5 \u6ce8\u610f\uff1a\u4e00\u5b9a\u8981\u9009\u62e9\u6240\u6709\u7528\u6237\u6743\u9650\u8981\u4e0d\u7136\u7528\u4e0d\u4e86<\/span>UiAutomator2<\/span><\/strong><\/p>\n

2\u3001 API\u811a\u672c<\/strong><\/p>\n

2.1 \u5982\u4f55\u83b7\u53d6APP\u542f\u52a8\u7684AppPackage\u548cAppActivity<\/strong><\/p>\n

1:\u901a\u8fc7appt\u83b7\u53d6\u5207\u6362\u5230aapt\u6240\u5728\u7684\u76ee\u5f55\uff0c\u6267\u884caapt dump\uff08aapt\u662fsdk\u81ea\u5e26\u7684\u4e00\u4e2a\u5de5\u5177\uff0c\u5728sdk\\builds-tools\\\u76ee\u5f55\u4e0b\uff09\u4f7f\u7528\u547d\u4ee4aapt dump badging \u201cD:\\ jinritoutiao_7500.apk\u201d\u8fd0\u884c\u540e\u7684\u7ed3\u679c\u4e2d\u4ee5\u4e0b\u4e24\u884c\u5206\u522b\u662f\u5e94\u7528\u5305\u540dpackage\u548c\u5165\u53e3activity\u540d\u79f0<\/p>\n

package: name=\u2019 com.ss.android.article.news\u2019<\/p>\n

launchable-activity: name=\u2018com.ss.android.article.news.activity.LaunchActivity\u2019<\/p>\n

2: \u901a\u8fc7 adb shell am start <\/p>com.ss.android.article.news\/com.ss.android.article.news.activity.MainActivity\n \n

\u6765\u5224\u65ad\u542f\u52a8\u7684app \u662f\u5426\u6b63\u786e<\/p>\n

2.2 \u542f\u52a8appium<\/strong><\/p>\n

\"\u5e72\u8d27\uff5c\u624b\u628a\u624b\u6559\u4f60\u505aapp\u81ea\u52a8\u5316\u6d4b\u8bd5\u63d2\u56fe7\"<\/div>\n
\"\u5e72\u8d27\uff5c\u624b\u628a\u624b\u6559\u4f60\u505aapp\u81ea\u52a8\u5316\u6d4b\u8bd5\u63d2\u56fe8\"<\/div>\n

2.3:\u5199\u811a\u672c<\/strong><\/p>\n

1.platformName\uff1a\u8fd9\u91cc\u662f android \u7684 apk<\/p>\n

2.deviceName\uff1a\u624b\u673a\u8bbe\u5907\u540d\u79f0\uff0c\u901a\u8fc7 adb devices \u67e5\u770b<\/p>\n

3.platformVersion\uff1aandroid \u7cfb\u7edf\u7684\u7248\u672c\u53f7<\/p>\n

4.appPackage\uff1aapk \u5305\u540d<\/p>\n

5.appActivity\uff1aapk \u7684 launcherActivity<\/p>\n

\"\u5e72\u8d27\uff5c\u624b\u628a\u624b\u6559\u4f60\u505aapp\u81ea\u52a8\u5316\u6d4b\u8bd5\u63d2\u56fe9\"<\/div>\n

2.4\u751f\u6210\u6d4b\u8bd5\u62a5\u544a<\/strong><\/p>\n

\"\u5e72\u8d27\uff5c\u624b\u628a\u624b\u6559\u4f60\u505aapp\u81ea\u52a8\u5316\u6d4b\u8bd5\u63d2\u56fe10\"<\/div>\n\n\n<\/p>\n","protected":false},"excerpt":{"rendered":"

\u4ec0\u4e48\u662fApp\u81ea\u52a8\u5316\uff1f\u4e3a\u4ec0\u4e48\u8981\u505aApp\u81ea\u52a8\u5316\uff1f App\u81ea\u52a8\u5316\u662f\u6307\u7ed9 Android\u6216iOS\u4e0a\u7684\u8f6f\u4ef6\u5e94\u7528\u7a0b\u5e8f\u505a\u7684\u81ea\u52a8\u5316\u6d4b\u8bd5\u3002 \u624b\u5de5\u6d4b\u8bd5\u548c\u81ea\u52a8\u5316\u6d4b… <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[19],"tags":[],"class_list":["post-1584","post","type-post","status-publish","format-standard","hentry","category-news"],"_links":{"self":[{"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/posts\/1584"}],"collection":[{"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/comments?post=1584"}],"version-history":[{"count":1,"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/posts\/1584\/revisions"}],"predecessor-version":[{"id":1585,"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/posts\/1584\/revisions\/1585"}],"wp:attachment":[{"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/media?parent=1584"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/categories?post=1584"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/tags?post=1584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}