{"id":69,"date":"2022-04-09T17:06:05","date_gmt":"2022-04-09T17:06:05","guid":{"rendered":"http:\/\/fanaticboy.com\/?p=69"},"modified":"2022-04-09T17:06:50","modified_gmt":"2022-04-09T17:06:50","slug":"69","status":"publish","type":"post","link":"https:\/\/fanaticboy.com\/?p=69","title":{"rendered":"app\u6d4b\u8bd5"},"content":{"rendered":"\n<p><strong>1\u4ec0\u4e48\u662factivity\uff1f<\/strong><\/p>\n\n\n\n<p>Activity\u662fAndroid\u7684\u56db\u5927\u7ec4\u4ef6\u4e4b\u4e00\uff0c\u4e5f\u662f\u5e73\u65f6\u6211\u4eec\u7528\u5230\u6700\u591a\u7684\u4e00\u4e2a\u7ec4\u4ef6\uff0c\u53ef\u4ee5\u7528\u6765\u663e\u793aView\u3002\u5b98\u65b9\u7684\u8bf4\u6cd5\u662fActivity\u4e00\u4e2a\u5e94\u7528\u7a0b\u5e8f\u7684\u7ec4\u4ef6\uff0c\u5b83\u63d0\u4f9b\u4e00\u4e2a\u5c4f\u5e55\u6765\u4e0e\u7528\u6237\u4ea4\u4e92\uff0c\u4ee5\u4fbf\u505a\u4e00\u4e9b\u8bf8\u5982\u6253\u7535\u8bdd\u3001\u53d1\u90ae\u4ef6\u548c\u770b\u5730\u56fe\u4e4b\u7c7b\u7684\u4e8b\u60c5\uff0c\u5b83\u63d0\u4f9b\u5c4f\u5e55\u8fdb\u884c\u4ea4\u4e92\u3002\u6bcf\u4e2aActivity\u90fd\u4f1a\u83b7\u5f97\u4e00\u4e2a\u7528\u4e8e\u7ed8\u5236\u5176\u7528\u6237\u754c\u9762\u7684\u7a97\u53e3\uff0c\u7a97\u53e3\u53ef\u4ee5\u5145\u6ee1\u54e6\u5c4f\u5e55\u4e5f\u53ef\u4ee5\u5c0f\u4e8e\u5c4f\u5e55\u5e76\u6d6e\u52a8\u5728\u5176\u4ed6\u7a97\u53e3\u4e4b\u4e0a\u3002\u4e00\u4e2a\u5e94\u7528\u901a\u5e38\u662f\u7531\u591a\u4e2a\u5f7c\u6b64\u677e\u6563\u8054\u7cfb\u7684Activity\u7ec4\u6210\uff0c\u4e00\u822c\u4f1a\u6307\u5b9a\u5e94\u7528\u4e2d\u7684\u67d0\u4e2aActivity\u4e3a\u4e3b\u6d3b\u52a8\uff0c\u4e5f\u5c31\u662f\u8bf4\u9996\u6b21\u542f\u52a8\u5e94\u7528\u65f6\u7ed9\u7528\u6237\u5448\u73b0\u7684Activity\u3002<\/p>\n\n\n\n<p><strong>2&nbsp;Activity\u751f\u547d\u5468\u671f?<\/strong><\/p>\n\n\n\n<p>\u5468\u671f\u5373\u6d3b\u52a8\u4ece\u5f00\u59cb\u5230\u7ed3\u675f\u6240\u7ecf\u5386\u7684\u5404\u79cd\u72b6\u6001\u3002\u751f\u547d\u5468\u671f\u5373\u6d3b\u52a8\u4ece\u5f00\u59cb\u5230\u7ed3\u675f\u6240\u7ecf\u5386\u7684\u5404\u4e2a\u72b6\u6001\u3002\u4ece\u4e00\u4e2a\u72b6\u6001\u5230\u53e6\u4e00\u4e2a\u72b6\u6001\u7684\u8f6c\u53d8\uff0c\u4ece\u65e0\u5230\u6709\u518d\u5230\u65e0\uff0c\u8fd9\u6837\u4e00\u4e2a\u8fc7\u7a0b\u4e2d\u6240\u7ecf\u5386\u7684\u72b6\u6001\u5c31\u53eb\u505a\u751f\u547d\u5468\u671f\u3002<\/p>\n\n\n\n<p>Activity\u672c\u8d28\u4e0a\u6709\u56db\u79cd\u72b6\u6001\uff1a<\/p>\n\n\n\n<p>1.\u8fd0\u884c\uff08Active\/Running\uff09:Activity\u5904\u4e8e\u6d3b\u52a8\u72b6\u6001\uff0c\u6b64\u65f6Activity\u5904\u4e8e\u6808\u9876\uff0c\u662f\u53ef\u89c1\u72b6\u6001\uff0c\u53ef\u4ee5\u4e0e\u7528\u6237\u8fdb\u884c\u4ea4\u4e92<\/p>\n\n\n\n<p>2.\u6682\u505c\uff08Paused\uff09:\u5f53Activity\u5931\u53bb\u7126\u70b9\u65f6\uff0c\u6216\u88ab\u4e00\u4e2a\u65b0\u7684\u975e\u5168\u9762\u5c4f\u7684Activity\uff0c\u6216\u88ab\u4e00\u4e2a\u900f\u660e\u7684Activity\u653e\u7f6e\u5728\u6808\u9876\u65f6\uff0cActivity\u5c31\u8f6c\u5316\u4e3aPaused\u72b6\u6001\u3002\u6b64\u523b\u5e76\u4e0d\u4f1a\u88ab\u9500\u6bc1\uff0c\u53ea\u662f\u5931\u53bb\u4e86\u4e0e\u7528\u6237\u4ea4\u4e92\u7684\u80fd\u529b\uff0c\u5176\u6240\u6709\u7684\u72b6\u6001\u4fe1\u606f\u53ca\u5176\u6210\u5458\u53d8\u91cf\u90fd\u8fd8\u5728\uff0c\u53ea\u6709\u5728\u7cfb\u7edf\u5185\u5b58\u7d27\u5f20\u7684\u60c5\u51b5\u4e0b\uff0c\u624d\u6709\u53ef\u80fd\u88ab\u7cfb\u7edf\u56de\u6536\u6389<\/p>\n\n\n\n<p>3.\u505c\u6b62\uff08Stopped\uff09:\u5f53Activity\u88ab\u7cfb\u7edf\u5b8c\u5168\u8986\u76d6\u65f6\uff0c\u88ab\u8986\u76d6\u7684Activity\u5c31\u4f1a\u8fdb\u5165Stopped\u72b6\u6001\uff0c\u6b64\u65f6\u5df2\u4e0d\u5728\u53ef\u89c1\uff0c\u4f46\u662f\u8d44\u6e90\u8fd8\u662f\u6ca1\u6709\u88ab\u6536\u56de<\/p>\n\n\n\n<p>4.\u7cfb\u7edf\u56de\u6536\uff08Killed\uff09:\u5f53Activity\u88ab\u7cfb\u7edf\u56de\u6536\u6389\uff0cActivity\u5c31\u5904\u4e8eKilled\u72b6\u6001<\/p>\n\n\n\n<p><strong>3Android\u56db\u5927\u7ec4\u4ef6&#8221;Android\u56db\u5927\u57fa\u672c\u7ec4\u4ef6\uff1a<\/strong><\/p>\n\n\n\n<p>Activity\u3001BroadcastReceiver\u5e7f\u64ad\u63a5\u6536\u5668\u3001ContentProvider\u5185\u5bb9\u63d0\u4f9b\u8005\u3001Service\u670d\u52a1\u3002<\/p>\n\n\n\n<p>Activity:\u5e94\u7528\u7a0b\u5e8f\u4e2d\uff0c\u4e00\u4e2aActivity\u5c31\u76f8\u5f53\u4e8e\u624b\u673a\u5c4f\u5e55\uff0c\u5b83\u662f\u4e00\u79cd\u53ef\u4ee5\u5305\u542b\u7528\u6237\u754c\u9762\u7684\u7ec4\u4ef6\uff0c\u4e3b\u8981\u7528\u4e8e\u548c\u7528\u6237\u8fdb\u884c\u4ea4\u4e92\u3002\u4e00\u4e2a\u5e94\u7528\u7a0b\u5e8f\u53ef\u4ee5\u5305\u542b\u8bb8\u591a\u6d3b\u52a8\uff0c\u6bd4\u5982\u4e8b\u4ef6\u7684\u70b9\u51fb\uff0c\u4e00\u822c\u90fd\u4f1a\u89e6\u53d1\u4e00\u4e2a\u65b0\u7684Activity\u3002<\/p>\n\n\n\n<p>BroadcastReceiver\u5e7f\u64ad\u63a5\u6536\u5668\uff1a\u5e94\u7528\u53ef\u4ee5\u4f7f\u7528\u5b83\u5bf9\u5916\u90e8\u4e8b\u4ef6\u8fdb\u884c\u8fc7\u6ee4\u53ea\u5bf9\u611f\u5174\u8da3\u7684\u5916\u90e8\u4e8b\u4ef6(\u5982\u5f53\u7535\u8bdd\u547c\u5165\u65f6\uff0c\u6216\u8005\u6570\u636e\u7f51\u7edc\u53ef\u7528\u65f6)\u8fdb\u884c\u63a5\u6536\u5e76\u505a\u51fa\u54cd\u5e94\u3002\u5e7f\u64ad\u63a5\u6536\u5668\u6ca1\u6709\u7528\u6237\u754c\u9762\u3002\u7136\u800c\uff0c\u5b83\u4eec\u53ef\u4ee5\u542f\u52a8\u4e00\u4e2aactivity\u6216service \u6765\u54cd\u5e94\u5b83\u4eec\u6536\u5230\u7684\u4fe1\u606f\uff0c\u6216\u8005\u7528NotificationManager\u6765\u901a\u77e5\u7528\u6237\u3002\u901a\u77e5\u53ef\u4ee5\u7528\u5f88\u591a\u79cd\u65b9\u5f0f\u6765\u5438\u5f15\u7528\u6237\u7684\u6ce8\u610f\u529b\u2500\u2500\u95ea\u52a8\u80cc\u706f\u3001\u9707\u52a8\u3001\u64ad\u653e\u58f0\u97f3\u7b49\u3002\u4e00\u822c\u6765\u8bf4\u662f\u5728\u72b6\u6001\u680f\u4e0a\u653e\u4e00\u4e2a\u6301\u4e45\u7684\u56fe\u6807\uff0c\u7528\u6237\u53ef\u4ee5\u6253\u5f00\u5b83\u5e76\u83b7\u53d6\u6d88\u606f\u3002<\/p>\n\n\n\n<p>ContentProvider\u5185\u5bb9\u63d0\u4f9b\u8005:\u5185\u5bb9\u63d0\u4f9b\u8005\u4e3b\u8981\u7528\u4e8e\u5728\u4e0d\u540c\u5e94\u7528\u7a0b\u5e8f\u4e4b\u95f4\u5b9e\u73b0\u6570\u636e\u5171\u4eab\u7684\u529f\u80fd\uff0c\u5b83\u63d0\u4f9b\u4e86\u4e00\u5957\u5b8c\u6574\u7684\u673a\u5236\uff0c\u5141\u8bb8\u4e00\u4e2a\u7a0b\u5e8f\u8bbf\u95ee\u53e6\u4e00\u4e2a\u7a0b\u5e8f\u4e2d\u7684\u6570\u636e\uff0c\u540c\u65f6\u8fd8\u80fd\u4fdd\u8bc1\u88ab\u8bbf\u95ee\u6570\u636e\u7684\u5b89\u5168\u6027\u3002\u53ea\u6709\u9700\u8981\u5728\u591a\u4e2a\u5e94\u7528\u7a0b\u5e8f\u95f4\u5171\u4eab\u6570\u636e\u65f6\u624d\u9700\u8981\u5185\u5bb9\u63d0\u4f9b\u8005\u3002\u4f8b\u5982\uff1a\u901a\u8baf\u5f55\u6570\u636e\u88ab\u591a\u4e2a\u5e94\u7528\u7a0b\u5e8f\u4f7f\u7528\uff0c\u4e14\u5fc5\u987b\u5b58\u50a8\u5728\u4e00\u4e2a\u5185\u5bb9\u63d0\u4f9b\u8005\u4e2d\u3002\u5b83\u7684\u597d\u5904\uff1a\u7edf\u4e00\u6570\u636e\u8bbf\u95ee\u65b9\u5f0f\u3002<\/p>\n\n\n\n<p>Service\u670d\u52a1\uff1a\u662fAndroid\u4e2d\u5b9e\u73b0\u7a0b\u5e8f\u540e\u53f0\u8fd0\u884c\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u5b83\u975e\u5e38\u9002\u5408\u53bb\u6267\u884c\u90a3\u4e9b\u4e0d\u9700\u8981\u548c\u7528\u6237\u4ea4\u4e92\u800c\u4e14\u8fd8\u8981\u957f\u671f\u8fd0\u884c\u7684\u4efb\u52a1\uff08\u4e00\u8fb9\u6253\u7535\u8bdd\uff0c\u540e\u53f0\u6302\u7740QQ\uff09\u3002\u670d\u52a1\u7684\u8fd0\u884c\u4e0d\u4f9d\u8d56\u4e8e\u4efb\u4f55\u7528\u6237\u754c\u9762\uff0c\u5373\u4f7f\u7a0b\u5e8f\u88ab\u5207\u6362\u5230\u540e\u53f0\uff0c\u6216\u8005\u7528\u6237\u6253\u5f00\u4e86\u53e6\u4e00\u4e2a\u5e94\u7528\u7a0b\u5e8f\uff0c\u670d\u52a1\u6254\u7136\u80fd\u591f\u4fdd\u6301\u6b63\u5e38\u8fd0\u884c\uff0c\u4e0d\u8fc7\u670d\u52a1\u5e76\u4e0d\u662f\u8fd0\u884c\u5728\u4e00\u4e2a\u72ec\u7acb\u7684\u8fdb\u7a0b\u5f53\u4e2d\uff0c\u800c\u662f\u4f9d\u8d56\u4e8e\u521b\u5efa\u670d\u52a1\u65f6\u6240\u5728\u7684\u5e94\u7528\u7a0b\u5e8f\u8fdb\u7a0b\u3002\u5f53\u67d0\u4e2a\u5e94\u7528\u7a0b\u5e8f\u8fdb\u7a0b\u88ab\u6740\u6389\u540e\uff0c\u6240\u6709\u4f9d\u8d56\u4e8e\u8be5\u8fdb\u7a0b\u7684\u670d\u52a1\u4e5f\u4f1a\u505c\u6b62\u8fd0\u884c\uff08\u6b63\u5728\u542c\u97f3\u4e50\uff0c\u7136\u540e\u628a\u97f3\u4e50\u7a0b\u5e8f\u9000\u51fa\uff09<\/p>\n\n\n\n<p><strong>5&nbsp;App\u6d4b\u8bd5\u4e2dios\u548cAndroid\u6709\u54ea\u4e9b\u533a\u522b\u5462\uff1f<\/strong><\/p>\n\n\n\n<p>1.Android\u957f\u6309home\u952e\u547c\u51fa\u5e94\u7528\u5217\u8868\u548c\u5207\u6362\u5e94\u7528\uff0c\u7136\u540e\u53f3\u6ed1\u5219\u7ec8\u6b62\u5e94\u7528\uff1b<\/p>\n\n\n\n<p>2.\u591a\u5206\u8fa8\u7387\u6d4b\u8bd5\uff0cAndroid\u7aef20\u591a\u79cd\uff0cios\u8f83\u5c11\uff1b<\/p>\n\n\n\n<p>3.\u624b\u673a\u64cd\u4f5c\u7cfb\u7edf\uff0cAndroid\u8f83\u591a\uff0cios\u8f83\u5c11\u4e14\u4e0d\u80fd\u964d\u7ea7\uff0c\u53ea\u80fd\u5355\u5411\u5347\u7ea7\uff1b\u65b0\u7684ios\u7cfb\u7edf\u4e2d\u7684\u8d44\u6e90\u5e93\u4e0d\u80fd\u5b8c\u5168\u517c\u5bb9\u4f4e\u7248\u672c\u4e2d\u7684ios\u7cfb\u7edf\u4e2d\u7684\u5e94\u7528\uff0c\u4f4e\u7248\u672cios\u7cfb\u7edf\u4e2d\u7684\u5e94\u7528\u8c03\u7528\u4e86\u65b0\u7684\u8d44\u6e90\u5e93\uff0c\u4f1a\u76f4\u63a5\u5bfc\u81f4\u95ea\u9000\uff08Crash\uff09\uff1b<\/p>\n\n\n\n<p>4.\u64cd\u4f5c\u4e60\u60ef\uff1aAndroid\uff0cBack\u952e\u662f\u5426\u88ab\u91cd\u5199\uff0c\u6d4b\u8bd5\u70b9\u51fbBack\u952e\u540e\u7684\u53cd\u9988\u662f\u5426\u6b63\u786e\uff1b\u5e94\u7528\u6570\u636e\u4ece\u5185\u5b58\u79fb\u52a8\u5230SD\u5361\u540e\u80fd\u5426\u6b63\u5e38\u8fd0\u884c\u7b49\uff1b<\/p>\n\n\n\n<p>5.\u5b89\u88c5\u5378\u8f7d\u6d4b\u8bd5\uff1aAndroid\u7684\u4e0b\u8f7d\u548c\u5b89\u88c5\u7684\u5e73\u53f0\u548c\u5de5\u5177\u548c\u6e20\u9053\u6bd4\u8f83\u591a\uff0cios\u4e3b\u8981\u6709app store\uff0ciTunes\u548ctestflight\u4e0b\u8f7d\uff1b<\/p>\n\n\n\n<p>6.\u5347\u7ea7\u6d4b\u8bd5\uff1a\u53ef\u4ee5\u88ab\u5347\u7ea7\u7684\u5fc5\u8981\u6761\u4ef6\uff1a\u65b0\u65e7\u7248\u672c\u5177\u6709\u76f8\u540c\u7684\u7b7e\u540d\uff1b\u65b0\u65e7\u7248\u672c\u5177\u6709\u76f8\u540c\u7684\u5305\u540d\uff1b\u6709\u4e00\u4e2a\u6807\u793a\u7b26\u533a\u5206\u65b0\u65e7\u7248\u672c\uff08\u5982\u7248\u672c\u53f7\uff09\uff0c<\/p>\n\n\n\n<p>\u5bf9\u4e8eAndroid\u82e5\u6709\u5185\u7f6e\u7684\u5e94\u7528\u9700\u68c0\u67e5\u5347\u7ea7\u4e4b\u540e\u5185\u7f6e\u6587\u4ef6\u662f\u5426\u5339\u914d\uff08\u5982\u5185\u7f6e\u7684\u8f93\u5165\u6cd5\uff09<\/p>\n\n\n\n<p><strong>6&nbsp;app\u51fa\u73b0ANR\uff0c\u662f\u4ec0\u4e48\u539f\u56e0\u5bfc\u81f4\u7684\uff1f<\/strong><\/p>\n\n\n\n<p>1.\u4e3b\u7ebf\u7a0b\u6267\u884c\u4e86\u8017\u65f6\u64cd\u4f5c\uff0c\u6bd4\u5982\u6570\u636e\u5e93\u64cd\u4f5c\u6216\u7f51\u7edc\u7f16\u7a0b<\/p>\n\n\n\n<p>2.\u5176\u4ed6\u8fdb\u7a0b\uff08\u5c31\u662f\u5176\u4ed6\u7a0b\u5e8f\uff09\u5360\u7528CPU\u5bfc\u81f4\u672c\u8fdb\u7a0b\u5f97\u4e0d\u5230CPU\u65f6\u95f4\u7247\uff0c\u6bd4\u5982\u5176\u4ed6\u8fdb\u7a0b\u7684\u9891\u7e41\u8bfb\u5199\u64cd\u4f5c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u8fd9\u4e2a\u95ee\u9898\u3002<\/p>\n\n\n\n<p>\u7ec6\u5206\u7684\u8bdd\uff0c\u5bfc\u81f4ANR\u7684\u539f\u56e0\u6709\u5982\u4e0b\u51e0\u70b9\uff1a<\/p>\n\n\n\n<p>1.\u8017\u65f6\u7684\u7f51\u7edc\u8bbf\u95ee<\/p>\n\n\n\n<p>2.\u5927\u91cf\u7684\u6570\u636e\u8bfb\u5199<\/p>\n\n\n\n<p>3.\u6570\u636e\u5e93\u64cd\u4f5c<\/p>\n\n\n\n<p>4.\u786c\u4ef6\u64cd\u4f5c\uff08\u6bd4\u5982camera)<\/p>\n\n\n\n<p>5.\u8c03\u7528thread\u7684join()\u65b9\u6cd5\u3001sleep()\u65b9\u6cd5\u3001wait()\u65b9\u6cd5\u6216\u8005\u7b49\u5f85\u7ebf\u7a0b\u9501\u7684\u65f6\u5019<\/p>\n\n\n\n<p>6.service binder\u7684\u6570\u91cf\u8fbe\u5230\u4e0a\u9650<\/p>\n\n\n\n<p>7.system server\u4e2d\u53d1\u751fWatchDog ANR<\/p>\n\n\n\n<p>8.service\u5fd9\u5bfc\u81f4\u8d85\u65f6\u65e0\u54cd\u5e94<\/p>\n\n\n\n<p>9.\u5176\u4ed6\u7ebf\u7a0b\u6301\u6709\u9501\uff0c\u5bfc\u81f4\u4e3b\u7ebf\u7a0b\u7b49\u5f85\u8d85\u65f6<\/p>\n\n\n\n<p>10.\u5176\u5b83\u7ebf\u7a0b\u7ec8\u6b62\u6216\u5d29\u6e83\u5bfc\u81f4\u4e3b\u7ebf\u7a0b\u4e00\u76f4\u7b49\u5f85\u3002<\/p>\n\n\n\n<p><strong>7App\u51fa\u73b0crash\u539f\u56e0\u6709\u54ea\u4e9b\uff1f<\/strong><\/p>\n\n\n\n<p><strong>\u4e3a\u4ec0\u4e48App\u4f1a\u51fa\u73b0\u5d29\u6e83\u5462\uff1f\u767e\u5ea6\u4e86\u4e00\u4e0b\uff0c\u67e5\u5230\u548cApp\u5d29\u6e83\u76f8\u5173\u7684\u51e0\u4e2a\u56e0\u7d20\uff1a\u5185\u5b58\u7ba1\u7406\u9519\u8bef\uff0c\u7a0b\u5e8f\u903b\u8f91\u9519\u8bef\uff0c\u8bbe\u5907\u517c\u5bb9\uff0c\u7f51\u7edc\u56e0\u7d20\u7b49\uff0c\u5982\u4e0b\uff1a<\/strong><\/p>\n\n\n\n<p>1.\u5185\u5b58\u7ba1\u7406\u9519\u8bef\uff1a\u53ef\u80fd\u662f\u53ef\u7528\u5185\u5b58\u8fc7\u4f4e\uff0capp\u6240\u9700\u7684\u5185\u5b58\u8d85\u8fc7\u8bbe\u5907\u7684\u9650\u5236\uff0capp\u8dd1\u4e0d\u8d77\u6765\u5bfc\u81f4App crash\u3002\u6216\u662f\u5185\u5b58\u6cc4\u9732\uff0c\u7a0b\u5e8f\u8fd0\u884c\u7684\u65f6\u95f4\u8d8a\u957f\uff0c\u6240\u5360\u7528\u7684\u5185\u5b58\u8d8a\u5927\uff0c\u6700\u7ec8\u7528\u5c3d\u5168\u90e8\u5185\u5b58\uff0c\u5bfc\u81f4\u6574\u4e2a\u7cfb\u7edf\u5d29\u6e83\u3002\u4ea6\u6216\u975e\u6388\u6743\u7684\u5185\u5b58\u4f4d\u7f6e\u7684\u4f7f\u7528\u4e5f\u53ef\u80fd\u4f1a\u5bfc\u81f4App crash\u3002<\/p>\n\n\n\n<p>2.\u7a0b\u5e8f\u903b\u8f91\u9519\u8bef\uff1a\u6570\u7ec4\u8d8a\u754c\u3001\u5806\u6808\u6ea2\u51fa\u3001\u5e76\u53d1\u64cd\u4f5c\u3001\u903b\u8f91\u9519\u8bef\u3002<\/p>\n\n\n\n<p>e.g. app\u65b0\u6dfb\u52a0\u4e00\u4e2a\u672a\u7ecf\u6d4b\u8bd5\u7684\u65b0\u529f\u80fd\uff0c\u8c03\u7528\u4e86\u4e00\u4e2a\u5df2\u91ca\u653e\u7684\u6307\u9488\uff0c\u8fd0\u884c\u7684\u65f6\u5019\u5c31\u4f1acrash\u3002<\/p>\n\n\n\n<p>3.\u8bbe\u5907\u517c\u5bb9\uff1a\u7531\u4e8e\u8bbe\u5907\u591a\u6837\u6027\uff0capp\u5728\u4e0d\u540c\u7684\u8bbe\u5907\u4e0a\u53ef\u80fd\u4f1a\u6709\u4e0d\u540c\u7684\u8868\u73b0\u3002<\/p>\n\n\n\n<p>4.\u7f51\u7edc\u56e0\u7d20\uff1a\u53ef\u80fd\u662f\u7f51\u901f\u6b20\u4f73\uff0c\u65e0\u6cd5\u8fbe\u5230app\u6240\u9700\u7684\u5feb\u901f\u54cd\u5e94\u65f6\u95f4\uff0c\u5bfc\u81f4app crash\u3002\u6216\u8005\u662f\u4e0d\u540c\u7f51\u7edc\u7684\u5207\u6362\u4e5f\u53ef\u80fd\u4f1a\u5f71\u54cdapp\u7684\u7a33\u5b9a\u6027\u3002<\/p>\n\n\n\n<p><strong>8app\u5bf9\u4e8e\u4e0d\u7a33\u5b9a\u5076\u7136\u51fa\u73b0anr\u548ccrash\u65f6\u5019\u4f60\u662f\u600e\u4e48\u5904\u7406\u7684\uff1f<\/strong><\/p>\n\n\n\n<p>app\u5076\u7136\u51fa\u73b0anr\u548ccrash\u662f\u6bd4\u8f83\u5934\u75bc\u7684\u95ee\u9898\uff0c\u7531\u4e8e\u5076\u7136\u51fa\u73b0\u65e0\u6cd5\u590d\u73b0\u6b65\u9aa4\uff0c\u8fd9\u4e5f\u662f\u4e00\u4e2a\u6d4b\u8bd5\u4eba\u5458\u5fc5\u5907\u7684\u6280\u80fd\uff0c\u9700\u8981\u6293\u65e5\u5fd7\u3002<\/p>\n\n\n\n<p>\u65b9\u6cd5\u4e00\uff1aapp\u5f00\u53d1\u4fdd\u5b58\u9519\u8bef\u65e5\u5fd7\u5230\u672c\u5730<\/p>\n\n\n\n<p>\u4e00\u822capp\u5f00\u53d1\u5728debug\u7248\u672c\uff0c\u51fa\u73b0anr\u548ccrash\u7684\u65f6\u5019\u4f1a\u81ea\u52a8\u628a\u65e5\u5fd7\u4fdd\u5b58\u5230\u672c\u5730\u5b9e\u9645\u7684sd\u5361\u4e0a\uff0c\u53bb\u5bf9\u5e94\u7684app\u76ee\u5f55\u53d6\u51fa\u6765\u5c31\u53ef\u4ee5\u4e86<\/p>\n\n\n\n<p>\u65b9\u6cd5\u4e8c\uff1a\u5b9e\u65f6\u6293\u53d6<\/p>\n\n\n\n<p>\u53ef\u4ee5\u81ea\u5df1\u5f00\u7740logcat\uff0c\u4fdd\u5b58\u65e5\u5fd7\u5230\u7535\u8111\u672c\u5730,<\/p>\n\n\n\n<p>adb logcat | find &#8220;&#8221;com.xxx.xxx&#8221;&#8221; &gt;d:\\hello.txt<\/p>\n\n\n\n<p><strong>9&nbsp;app\u7684\u5b9e\u65f6\u65e5\u5fd7\u5982\u4f55\u6293\u53d6?<\/strong><\/p>\n\n\n\n<p>app\u7684\u65e5\u5fd7\uff0c\u53ef\u4ee5\u7528logcat\u6293\u53d6adb logcat | find &#8220;&#8221;com.xxx.xxx&#8221;&#8221; &gt;d:\\hello.txt<\/p>\n\n\n\n<p>\u683c\u5f0f\u5316\u8f93\u51fa\uff1aadb logcat -v time *:E | find &#8220;&#8221;com.xxx.xxx&#8221;&#8221; &gt;d:\\hello.txt<\/p>\n\n\n\n<p><strong>10&nbsp;\u4f60\u5e73\u5e38\u4f1a\u770b\u65e5\u5fd7\u5417, \u4e00\u822c\u4f1a\u51fa\u73b0\u54ea\u4e9b\u5f02\u5e38\uff08Exception\uff09?<\/strong><\/p>\n\n\n\n<p>\u8fd9\u4e2a\u4e3b\u8981\u662f\u9762\u8bd5\u5b98\u8003\u5bdf\u4f60\u4f1a\u4e0d\u4f1a\u770b\u65e5\u5fd7\uff0c\u662f\u4e0d\u662f\u770b\u5f97\u61c2java\u91cc\u9762\u629b\u51fa\u7684\u5f02\u5e38Exception,\u4e00\u822c\u9762\u8bd5\u4e2djava Exception\uff08runtimeException \uff09\u662f\u5fc5\u4f1a\u88ab\u95ee\u5230\u7684\u95ee\u9898<\/p>\n\n\n\n<p>app\u5d29\u6e83\u7684\u5e38\u89c1\u539f\u56e0\u5e94\u8be5\u4e5f\u662f\u8fd9\u4e9b\u4e86\u3002\u5e38\u89c1\u7684\u51e0\u79cd\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p>NullPointerException &#8211; \u7a7a\u6307\u9488\u5f15\u7528\u5f02\u5e38<\/p>\n\n\n\n<p>ClassCastException &#8211; \u7c7b\u578b\u5f3a\u5236\u8f6c\u6362\u5f02\u5e38\u3002<\/p>\n\n\n\n<p>IllegalArgumentException &#8211; \u4f20\u9012\u975e\u6cd5\u53c2\u6570\u5f02\u5e38\u3002<\/p>\n\n\n\n<p>ArithmeticException &#8211; \u7b97\u672f\u8fd0\u7b97\u5f02\u5e38<\/p>\n\n\n\n<p>ArrayStoreException &#8211; \u5411\u6570\u7ec4\u4e2d\u5b58\u653e\u4e0e\u58f0\u660e\u7c7b\u578b\u4e0d\u517c\u5bb9\u5bf9\u8c61\u5f02\u5e38<\/p>\n\n\n\n<p>IndexOutOfBoundsException &#8211; \u4e0b\u6807\u8d8a\u754c\u5f02\u5e38<\/p>\n\n\n\n<p>NegativeArraySizeException &#8211; \u521b\u5efa\u4e00\u4e2a\u5927\u5c0f\u4e3a\u8d1f\u6570\u7684\u6570\u7ec4\u9519\u8bef\u5f02\u5e38<\/p>\n\n\n\n<p>NumberFormatException &#8211; \u6570\u5b57\u683c\u5f0f\u5f02\u5e38<\/p>\n\n\n\n<p>SecurityException &#8211; \u5b89\u5168\u5f02\u5e38<\/p>\n\n\n\n<p>UnsupportedOperationException &#8211; \u4e0d\u652f\u6301\u7684\u64cd\u4f5c\u5f02\u5e38<\/p>\n\n\n\n<p><strong>11&nbsp;\u89e3\u91ca\u4ec0\u4e48\u662fAppium\uff1f<\/strong><\/p>\n\n\n\n<p>Appium\u662f\u4e00\u4e2a\u514d\u8d39\u5206\u53d1\u7684\u5f00\u6e90\u79fb\u52a8\u5e94\u7528UI\u6d4b\u8bd5\u6846\u67b6,\u53ef\u4ee5\u5bf9android\u53caios\u7cfb\u7edf\u7684app\u8fdb\u884c\u81ea\u52a8\u5316\u6d4b\u8bd5<\/p>\n\n\n\n<p>12&nbsp;\u89e3\u91ca\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\u4e2d\u5982\u4f55\u67e5\u627eDOM\u5143\u7d20<\/p>\n\n\n\n<p>\u8981\u627e\u5230DOM\u5143\u7d20\uff0c\u4f7f\u7528\u201cUIAutomateviewer\u201d\u6765\u67e5\u627eAndroid\u5e94\u7528\u7a0b\u5e8f\u7684DOM\u5143\u7d20\u3002<\/p>\n\n\n\n<p><strong>13&nbsp;Appium\u652f\u6301\u54ea\u79cd\u8bed\u8a00\uff1f<\/strong><\/p>\n\n\n\n<p>Appium\u652f\u6301\u4efb\u4f55\u652f\u6301HTTP\u8bf7\u6c42\u7684\u8bed\u8a00\uff0c\u5982Java\uff0cJavaScript\u4e0eNode.js\uff0cPython\uff0cRuby\uff0cPHP\uff0cPerl\u7b49\u3002<\/p>\n\n\n\n<p><strong>14&nbsp;<\/strong>a<strong>ppium\u5b9a\u4f4d\u65b9\u6cd5\u7b56\u7565?<\/strong><\/p>\n\n\n\n<p>driver.find_element_by_id() \u2013\u5143\u7d20\u7684 resrouce-id \u5c5e\u6027<\/p>\n\n\n\n<p>driver.find_element_by_AccessibilityId() \u2013 content-desc\u5c5e\u6027\uff0c\u66ff\u4ee3\u4ee5\u524d\u7684name\u3002<\/p>\n\n\n\n<p>driver.find_element_by_xpath() \u2013\u6bd4css\u5b9a\u4f4d\u6162<\/p>\n\n\n\n<p>driver.find_element_by_class_name() \u2013\u5143\u7d20\u7684 class \u5c5e\u6027<\/p>\n\n\n\n<p>driver.find_element_by_css_selector()<\/p>\n\n\n\n<p>driver.find_element_by_link_text() \u2013\u94fe\u63a5\u5143\u7d20\u7684\u5168\u90e8\u663e\u793a\u6587\u5b57<\/p>\n\n\n\n<p>driver.find_element_by_tag_name() \u2013\u5143\u7d20\u7684\u6807\u7b7e\u540d<\/p>\n\n\n\n<p>driver.find_element_by_partial_link_text() \u2013\u94fe\u63a5\u5143\u7d20\u7684\u90e8\u5206\u663e\u793a\u6587\u5b57<\/p>\n\n\n\n<p><strong>15&nbsp;Appium\u7684\u5de5\u4f5c\u539f\u7406<\/strong><\/p>\n\n\n\n<p>\u5728Android\u7aef\uff0cappium\u57fa\u4e8eWebDriver\u534f\u8bae\uff0c\u5229\u7528Bootstrap.jar\uff0c\u6700\u540e\u901a\u8fc7\u8c03\u2f64\u7528UiAutomator\u7684\u547d\u4ee4\uff0c\u5b9e\u73b0App\u7684\u81ea\u52a8\u5316\u6d4b\u8bd5\u3002<\/p>\n\n\n\n<p>client\u7aef\u4e5f\u5c31\u662f\u6211\u4eec test script\u662f\u6211\u4eec\u7684webdriver\u6d4b\u8bd5\u811a\u672c\u3002<\/p>\n\n\n\n<p>\u4e2d\u95f4\u662f\u8d77\u7684Appium\u7684\u670d\u52a1\uff0cAppium\u5728\u670d\u52a1\u7aef\u8d77\u4e86\u4e00\u4e2aServer\uff084723\u7aef\u53e3\uff09\uff0c\u8ddfselenium Webdriver\u6d4b\u8bd5\u6846\u67b6\u7c7b\u4f3c\uff0c Appium\u2f40\u6301\u6807\u51c6\u7684WebDriver JSONWireProtocol\u3002\u5728\u8fd9\u91cc\u63d0\u4f9b\u5b83\u63d0\u4f9b\u4e86\u4e00\u5957REST\u7684\u63a5\u53e3,Appium Server\u63a5\u6536web driver client\u6807\u51c6rest\u8bf7\u6c42\uff0c\u89e3\u6790\u8bf7\u6c42\u5185\u5bb9\uff0c\u8c03\u2f64\u7528\u5bf9\u5e94\u7684\u6846\u67b6\u54cd\u5e94\u64cd\u4f5c\u3002<\/p>\n\n\n\n<p>appium server\u4f1a\u628a\u8bf7\u6c42\u8f6c\u53d1\u7ed9\u4e2d\u95f4\u4ef6Bootstrap.jar \uff0c\u5b83\u662f\u7528java\u5199\u7684\uff0c\u5b89\u88c5\u5728\u624b\u673a\u4e0a.Bootstrap\u76d1\u542c4724\u7aef\u53e3\u5e76\u63a5\u6536appium \u7684\u547d\u4ee4\uff0c\u6700\u7ec8\u901a\u8fc7\u8c03\u2f64\u7528UiAutomator\u7684\u547d\u4ee4\u6765\u5b9e\u73b0\u3002<\/p>\n\n\n\n<p>\u6700\u540eBootstrap\u5c06\u6267\u884c\u7684\u7ed3\u679c\u8fd4\u56de\u7ed9appium server\u3002<\/p>\n\n\n\n<p>appium server\u518d\u5c06\u7ed3\u679c\u8fd4\u56de\u7ed9 appium client\u3002<\/p>\n\n\n\n<p><strong>16&nbsp;iOS\u548cAndroid\u7aef\u7684\u533a\u522b\uff1a<\/strong><\/p>\n\n\n\n<p>1\u3001\u4e24\u8005\u8fd0\u884c\u673a\u5236\u4e0d\u540c\uff1aIOS\u91c7\u7528\u7684\u662f\u6c99\u76d2\u8fd0\u884c\u673a\u5236\uff0c\u5b89\u5353\u91c7\u7528\u7684\u662f\u865a\u62df\u673a\u8fd0\u884c\u673a\u5236\u3002<\/p>\n\n\n\n<p>2\u3001\u4e24\u8005\u540e\u53f0\u5236\u5ea6\u4e0d\u540c\uff1aIOS\u4e2d\u4efb\u4f55\u7b2c\u4e09\u65b9\u7a0b\u5e8f\u90fd\u4e0d\u80fd\u5728\u540e\u53f0\u8fd0\u884c\uff1b\u5b89\u5353\u4e2d\u4efb\u4f55\u7a0b\u5e8f\u90fd\u80fd\u5728\u540e\u53f0\u8fd0\u884c\uff0c\u76f4\u5230\u6ca1\u6709\u5185\u5b58\u624d\u4f1a\u5173\u95ed\u3002<\/p>\n\n\n\n<p>3\u3001IOS\u4e2d\u7528\u4e8eUI\u6307\u4ee4\u6743\u9650\u6700\u9ad8\uff0c\u5b89\u5353\u4e2d\u6570\u636e\u5904\u7406\u6307\u4ee4\u6743\u9650\u6700\u9ad8\u3002<\/p>\n\n\n\n<p><strong>17\u5b89\u88c5\u6d4b\u8bd5\u7684\u8981\u70b9\uff1f<\/strong><\/p>\n\n\n\n<p>1\uff09\u8f6f\u4ef6\u5728\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\uff08Palm OS\u3001Symbian\u3001Linux\u3001Android\u3001iOS\u3001Black Berry OS 6.0\u3001Windows Phone 7\uff09\u4e0b\u5b89\u88c5\u662f\u5426\u6b63\u5e38\u3002<\/p>\n\n\n\n<p>2\uff09\u8f6f\u4ef6\u5b89\u88c5\u540e\u7684\u662f\u5426\u80fd\u591f\u6b63\u5e38\u8fd0\u884c\uff0c\u5b89\u88c5\u540e\u7684\u6587\u4ef6\u5939\u53ca\u6587\u4ef6\u662f\u5426\u5199\u5230\u4e86\u6307\u5b9a\u7684\u76ee\u5f55\u91cc\u3002<\/p>\n\n\n\n<p>3\uff09\u8f6f\u4ef6\u5b89\u88c5\u5404\u4e2a\u9009\u9879\u7684\u7ec4\u5408\u662f\u5426\u7b26\u5408\u6982\u8981\u8bbe\u8ba1\u8bf4\u660e<\/p>\n\n\n\n<p>4\uff09\u8f6f\u4ef6\u5b89\u88c5\u5411\u5bfc\u7684UI\u6d4b\u8bd5<\/p>\n\n\n\n<p>5\uff09\u8f6f\u4ef6\u5b89\u88c5\u8fc7\u7a0b\u662f\u5426\u53ef\u4ee5\u53d6\u6d88\uff0c\u70b9\u51fb\u53d6\u6d88\u540e\uff0c\u5199\u5165\u7684\u6587\u4ef6\u662f\u5426\u5982\u6982\u8981\u8bbe\u8ba1\u8bf4\u660e\u5904\u7406<\/p>\n\n\n\n<p>6\uff09\u8f6f\u4ef6\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u610f\u5916\u60c5\u51b5\u7684\u5904\u7406\u662f\u5426\u7b26\u5408\u9700\u6c42\uff08\u5982\u6b7b\u673a\uff0c\u91cd\u542f\uff0c\u65ad\u7535\uff09<\/p>\n\n\n\n<p>7\uff09\u5b89\u88c5\u7a7a\u95f4\u4e0d\u8db3\u65f6\u662f\u5426\u6709\u76f8\u5e94\u63d0\u793a<\/p>\n\n\n\n<p>8\uff09\u5b89\u88c5\u540e\u6ca1\u6709\u751f\u6210\u591a\u4f59\u7684\u76ee\u5f55\u7ed3\u6784\u548c\u6587\u4ef6<\/p>\n\n\n\n<p>9\uff09\u5bf9\u4e8e\u9700\u8981\u901a\u8fc7\u7f51\u7edc\u9a8c\u8bc1\u4e4b\u7c7b\u7684\u5b89\u88c5\uff0c\u5728\u65ad\u7f51\u60c5\u51b5\u4e0b\u5c1d\u8bd5\u4e00\u4e0b<\/p>\n\n\n\n<p>10\uff09\u8fd8\u9700\u8981\u5bf9\u5b89\u88c5\u624b\u518c\u8fdb\u884c\u6d4b\u8bd5\uff0c\u4f9d\u7167\u5b89\u88c5\u624b\u518c\u662f\u5426\u80fd\u987a\u5229\u5b89\u88c5<\/p>\n\n\n\n<p><strong>18\u5378\u8f7d\u6d4b\u8bd5\u7684\u8981\u70b9\uff1f<\/strong><\/p>\n\n\n\n<p>1\uff09\u76f4\u63a5\u5220\u9664\u5b89\u88c5\u6587\u4ef6\u5939\u5378\u8f7d\u662f\u5426\u6709\u63d0\u793a\u4fe1\u606f\u3002<\/p>\n\n\n\n<p>2\uff09\u6d4b\u8bd5\u7cfb\u7edf\u76f4\u63a5\u5378\u8f7d\u7a0b\u5e8f\u662f\u5426\u6709\u63d0\u793a\u4fe1\u606f\u3002<\/p>\n\n\n\n<p>3\uff09\u6d4b\u8bd5\u5378\u8f7d\u540e\u6587\u4ef6\u662f\u5426\u5168\u90e8\u5220\u9664\u6240\u6709\u7684\u5b89\u88c5\u6587\u4ef6\u5939\u3002<\/p>\n\n\n\n<p>4\uff09\u5378\u8f7d\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u7684\u610f\u5916\u60c5\u51b5\u7684\u6d4b\u8bd5\uff08\u5982\u6b7b\u673a\u3001\u65ad\u7535\u3001\u91cd\u542f\uff09\u3002<\/p>\n\n\n\n<p>5\uff09\u5378\u8f7d\u662f\u5426\u652f\u6301\u53d6\u6d88\u529f\u80fd\uff0c\u5355\u51fb\u53d6\u6d88\u540e\u8f6f\u4ef6\u5378\u8f7d\u7684\u60c5\u51b5 \u3002<\/p>\n\n\n\n<p>6\uff09\u7cfb\u7edf\u76f4\u63a5\u5378\u8f7dUI\u6d4b\u8bd5\uff0c\u662f\u5426\u6709\u5378\u8f7d\u72b6\u6001\u8fdb\u5ea6\u6761\u63d0\u793a<\/p>\n\n\n\n<p><strong>19\u4ec0\u4e48\u662f\u5f31\u7f51\u6d4b\u8bd5\uff1f<\/strong><\/p>\n\n\n\n<p>\u7531\u4e8e\u7528\u6237\u81ea\u8eab\u7684\u7f51\u7edc\u73af\u5883\u6ce2\u52a8\uff0c\u6216\u8005\u662f\u672c\u8eab\u7f51\u7edc\u73af\u5883\u5c31\u8f83\u4e3a\u6076\u52a3\uff0c\u5bfc\u81f4\u4f1a\u51fa\u73b0\u4e00\u4e9b\u610f\u60f3\u4e0d\u5230\u7684\u975e\u529f\u80fd\u6027bug\uff0c\u5f71\u54cd\u7528\u6237\u4f53\u68c0\u3002\u6bd4\u5982<\/p>\n\n\n\n<p>\u5229\u7528Fiddler\uff0cCharles\u7b49\u5177\u6709\u4ee3\u7406\u670d\u52a1\u5668\u529f\u80fd\u7684\u7f51\u7edc\u6d41\u91cf\u5206\u6790\u8f6f\u4ef6\u6765\u5b9e\u73b0\u3002<\/p>\n\n\n\n<p><strong>20&nbsp;\u5982\u4f55fiddler\u5b9e\u73b0\u5f31\u7f51\u7684\u539f\u7406\uff1f<\/strong><\/p>\n\n\n\n<p>Fiddler\u9650\u901f\u662f\u4ee5\u7f51\u7edc\u5ef6\u8fdf\u7684\u65b9\u5f0f\u5b9e\u73b0\u7684\uff0c\u7f51\u7edc\u5ef6\u8fdf\u65f6\u95f4*\u7f51\u901f=\u4f20\u8f93\u5b57\u8282\u6570\u3002<\/p>\n\n\n\n<p>fiddler\u672c\u6765\u5c31\u662f\u4e2a\u4ee3\u7406\uff0c\u5b83\u63d0\u4f9b\u4e86\u5ba2\u6237\u7aef\u8bf7\u6c42\u524d\u548c\u670d\u52a1\u5668\u54cd\u5e94\u524d\u7684\u56de\u8c03\u63a5\u53e3\uff0c\u6211\u4eec\u53ef\u4ee5\u5728\u8fd9\u4e9b\u63a5\u53e3\u91cc \u9762\u81ea\u5b9a\u4e49\u4e00\u4e9b\u903b\u8f91\u3002Fiddler\u7684\u6a21\u62df\u9650\u901f\u6b63\u662f\u5728\u5ba2\u6237\u7aef\u8bf7\u6c42\u524d\u6765\u81ea\u5b9a\u4e49\u9650\u901f\u7684\u903b\u8f91\uff0c\u6b64\u903b\u8f91\u662f\u901a\u8fc7\u5ef6\u8fdf\u53d1\u9001\u6570\u636e\u6216\u63a5\u6536\u7684\u6570\u636e\u7684\u65f6\u95f4\u6765\u9650\u5236\u7f51\u7edc\u7684\u4e0b\u8f7d\u901f\u5ea6\u548c \u4e0a\u4f20\u901f\u5ea6\uff0c\u4ece\u800c\u8fbe\u5230\u9650\u901f\u7684\u6548\u679c\u3002<\/p>\n\n\n\n<p><strong>21&nbsp;fiddler\u5b9e\u73b0\u5f31\u7f51\u7684\u6b65\u9aa4\uff1f<\/strong><\/p>\n\n\n\n<p>1\u3001\u542f\u7528 &#8220;&#8221;\u6a21\u62dfModem\u901f\u5ea6&#8221;&#8221; \uff0cRules \u2013 Performances \u2013 Simulate Modem Speeds\uff0c \u9ed8\u8ba4\u672a\u52fe\u9009\uff0c\u7f51\u7edc\u6b63\u5e38\u3002\u52fe\u9009\u8be5\u9009\u9879\u540e\uff0c\u6240\u6709\u901a\u8fc7Fiddler\u4ee3\u7406\u7684\u6d41\u91cf\u90fd\u4f1a\u53d8\u5f97\u548c\u591a\u5e74\u524d\u768456k\u5c0f\u732b\u65f6\u4e0a\u7f51\u4e00\u822c\u7684\u6162\u3002<\/p>\n\n\n\n<p>2\u3001\u914d\u7f6e\u9650\u901f\u53c2\u6570\uff08 \u7f51\u7edc\u73af\u5883\u53c2\u6570\uff09\uff0c\u91c7\u7528\u9ed8\u8ba4\u7684\u914d\u7f6e\u6a21\u62df\u51fa\u6765\u7684\u73af\u5883\u8fc7\u4e8e\u6076\u52a3\uff0c\u5e76\u4e0d\u4e00\u5b9a\u7b26\u5408\u9700\u6c42\uff0c\u6b64\u65f6\u5c31\u9700\u8981\u5bf9\u9650\u901f\u7684\u53c2\u6570\u8fdb\u884c\u8c03\u6574\u3002 Rules \u2013 Customize Rules\u2026 \uff0c\u6253\u5f00\u7684\u811a\u672c\u7f16\u8f91\u5668\u4e2d\u627e\u5230\u4e00\u4e2am_SimulateModem\u6807\u5fd7\u4f4d\uff0c\u5e76\u8bbe\u7f6e\u8bf7\u6c42\u5ef6\u8fdf\u3001\u76f8\u5e94\u5ef6\u8fdf \uff0c\u5355\u4f4d\u4e3ams.<\/p>\n\n\n\n<p><strong>22\u5de5\u4f5c\u4e2d\u662f\u5982\u4f55\u6293\u53d6android\u5b9e\u65f6\u65e5\u5fd7\u7684\uff1f<\/strong><\/p>\n\n\n\n<p>\u7528\u5de5\u5177adb logcat<\/p>\n\n\n\n<p>\u6211\u7ecf\u5e38\u4f1a\u628a\u65e5\u5fd7\u7528\u91cd\u5b9a\u5411\u7684\u65b9\u5f0f\u5199\u5230\u4e00\u4e2a\u6587\u4ef6\u5939\u4e2d\uff1a &gt;D\uff1a\\log.txt<\/p>\n\n\n\n<p>\u5728\u5177\u4f53\u4f7f\u7528\u65f6\u4f1a\u5bf9\u65e5\u5fd7\u8fdb\u884c\u7b49\u7ea7\u7b5b\u9009\u8fc7\u6ee4\uff0c\u6bd4\u5982\uff1a *\uff1aE\uff08E\u662f\u7b49\u7ea7error\uff09<\/p>\n\n\n\n<p>\u4e3a\u65b9\u4fbf\u5b9a\u4f4d\u65e5\u5fd7\uff0c\u53ef\u4ee5\u663e\u793a\u65e5\u5fd7\u8bb0\u5f55\u7684\u65f6\u95f4\uff1a -v time<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u4ec0\u4e48\u662factivity\uff1f Activity\u662fAndroid\u7684\u56db\u5927\u7ec4\u4ef6\u4e4b\u4e00\uff0c\u4e5f\u662f\u5e73\u65f6\u6211\u4eec\u7528\u5230\u6700\u591a\u7684\u4e00\u4e2a\u7ec4\u4ef6\uff0c\u53ef &#8230; <a title=\"app\u6d4b\u8bd5\" class=\"read-more\" href=\"https:\/\/fanaticboy.com\/?p=69\" aria-label=\"\u9605\u8bfb app\u6d4b\u8bd5\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-69","post","type-post","status-publish","format-standard","hentry","category-face"],"_links":{"self":[{"href":"https:\/\/fanaticboy.com\/index.php?rest_route=\/wp\/v2\/posts\/69","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fanaticboy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fanaticboy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fanaticboy.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fanaticboy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=69"}],"version-history":[{"count":2,"href":"https:\/\/fanaticboy.com\/index.php?rest_route=\/wp\/v2\/posts\/69\/revisions"}],"predecessor-version":[{"id":71,"href":"https:\/\/fanaticboy.com\/index.php?rest_route=\/wp\/v2\/posts\/69\/revisions\/71"}],"wp:attachment":[{"href":"https:\/\/fanaticboy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=69"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fanaticboy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=69"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fanaticboy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=69"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}