Skip to content

Instantly share code, notes, and snippets.

@zhEdward
zhEdward / AndroidManifest.xml
Last active October 27, 2016 02:03 — forked from pyricau/LeakSlackUploadService.java
使用leakCanary 在debug的时候 进行 leak heapdump 日志收集(fork 的例子 UploadService主要使用 Slack API+retrofit2 机制上传)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
>
<application android:name="com.example.DebugExampleApplication">
·····

For more adb-cheat-sheet follow this link

查看设备 ip地址

C:\Users\Edward\Desktop> adb -s Baytrail26AB2111 shell netcfg
lo       UP                                   127.0.0.1/8   0x00000049 00:00:00:00:00:00
sit0     DOWN                                   0.0.0.0/0   0x00000080 00:00:00:00:00:00
p2p0 UP 0.0.0.0/0 0x00001003 02:09:4c:11:27:e5
@zhEdward
zhEdward / OomExceptionHandler.java
Created September 27, 2016 06:22 — forked from pyricau/OomExceptionHandler.java
Dump the heap on OutOfMemoryError crashes in your debug builds.
import android.content.Context;
import android.os.Debug;
import java.io.File;
public class OomExceptionHandler implements Thread.UncaughtExceptionHandler {
private static final String FILENAME = "out-of-memory.hprof";
public static void install(Context context) {
Thread.UncaughtExceptionHandler defaultHandler = Thread.getDefaultUncaughtExceptionHandler();