LogcatViewer是一个Androidæµ®åŠ¨çª—å£æ—¥å¿—输出库ï¼èŽ·å–应用程åºçš„logcat输出日志并以窗å£çš„形弿‚¬æµ®åœ¨åº”ç”¨ä¸Šå±‚ï¼Œæ”¯æŒæ‚¬æµ®çª—å£ç¼©æ”¾ï¼Œæ‹–åŠ¨ï¼Œæ”¯æŒæ—¥å¿—文件过滤,清除,ä¿å˜åˆ†äº«ã€‚å¯ä»¥è‡ªå®šä¹‰æŽ¥å£è¿œç¨‹åŠ¨æ€æŽ§åˆ¶LogcatVieweræµ®åŠ¨æ—¥å¿—çª—å£æ˜¾ç¤ºä¸Žå…³é—,测试阶段(方便测试人员和开å‘者定ä½å¼‚常),å‘布线上阶段(åŠ¨æ€æŽ§åˆ¶æŒ‡å®šè´¦å·ç”¨æˆ·LogcatVieweræµ®åŠ¨æ—¥å¿—çª—å£æ˜¾ç¤ºä¸Žå…³é—,方便异常机型的用户å馈问题,开å‘人员针对指定机型进行适é…)ã€‚è¯´æ˜Žï¼šåŠ¨æ€æŽ§åˆ¶æŒ‡å®šè´¦å·ç”¨æˆ·LogcatVieweræµ®åŠ¨æ—¥å¿—çª—å£æ˜¾ç¤ºä¸Žå…³é—,集æˆè¯¥åº“å¹¶å‚考示例代ç UseLogcatControlActivityç±»ä¸çš„remoteControlLogviewer()方法,isOpenLogcatViewer.equals(isOpenLogcatViewerCode)&& accountId.equals(loginAccountId),åŽå°åŠ¨æ€æŽ§åˆ¶LogcatViewer控制接å£ç½‘ç»œè¯·æ±‚è¿”å›žçš„å‚æ•°isOpenLogcatViewer,accountId å’Œ isOpenLogcatViewerCode,loginAccountId 比较,确定用户或指定账å·ç”¨æˆ·çš„LogcatVieweræµ®åŠ¨æ—¥å¿—çª—å£æ˜¾ç¤ºä¸Žå…³é—。
- 日志输出过滤
- æ‚¬æµ®çª—å£æ‹–动
- 日志输出清除
- 分享ä¿å˜log日志文本
- logæ—¥å¿—é¡µé¢æ”¾å¤§ç¼©å°
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
dependencies {
implementation 'com.github.weijiaxing:LogcatViewer:1.0.3'
}
<provider
android:name="com.weijiaxing.logviewer.LogcatFileProvider"
android:authorities="${applicationId}.logcat_fileprovider"
android:grantUriPermissions="true"
android:exported="false">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/logcat_filepaths" />
</provider>
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//Use this method
LogcatActivity.launch(MainActivity.this);
}
}
Copyright (C) weijiaxing Inc. Open source codes for study only.
Do not use for commercial purpose.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.