Docker Mac下载地址 下载完安装,然后打开按照提示更新(下载完之后一定要打开按照提示做,不然在terminal使用时无法使用)
cd go/src
./all.bash
==出现错误❌ == ##### Building Go bootstrap tool.
cmd/dist
ERROR: Cannot find /Users/sarah/go1.4/bin/go.
Set $GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4.
默认去编译1.4版本,要告诉go boostrap tool,有一个(>=1.4)新版本,让它能编译你想要安装的go最新版本,修改环境变量GOROOT_BOOSTRAP=/Users/sarah/.gvm/gos/go1.8
但还是不可以出现了同样的问题
8. 改换brew install go
==出现:没有支持我系统的版本==
You are using OS X 10.12. We do not provide support for this pre-release version. You may encounter build failures or other breakages. Please create pull-requests instead of filing issues.
尝试安装一个指定的版本brew install go1.8
出现:
Error: /usr/local is not writable. You should change the ownership
and permissions of /usr/local back to your user account:
sudo chown -R $(whoami) /usr/local
Error: No available formula with the name "go1.8"
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
install the go tools
里面有多种安装方法可以使用第一种或者Mac OS X package installer
直接下载pkg安装完配置PATHtar -C /usr/local -xzf go1.8.1.src.tar.gz
/usr/local/go/bin
添加到环境变量 export PATH=$PATH:/usr/local/go/bin
export PATH=/usr/local/go/bin:${PATH}
export GOPATH=/Users/sarah/androidTest/goWorkSpace
但是没次关闭terminal下次还是不能直接使用go,每次都要source .bash_profile
12. 下载Battery Historian代码: go get -d -u github.com/google/battery-historian/...
这个会自动下载到上面自己配置的GOPATH中,也就自己建立的workspace
$ cd $GOPATH/src/github.com/google/battery-historian
# Compile Javascript files using the Closure compiler,这个过程会去下载Closure
$ go run setup.go
# Run Historian on your machine (make sure $PATH contains $GOBIN)
$ go run cmd/battery-historian/battery-historian.go [--port <default:9999>]
go run setup.go
Downloading Closure library...
failed to run command "git clone https://github.com/google/closure-l ibrary /Users/sarah/androidTest/goWorkSpace/src/github.com/google/ battery-historian/third_party/closure-library":
exit status 128
Cloning into '/Users/sarah/androidTest/goWorkSpace/src/github.com/ google/ battery-historian/third_party/closure-library'...
error: RPC failed; result=56, HTTP code = 200
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
Downloading Closure compiler...
Downloading 3rd-party JS files...
Generating JS runfiles...
Couldn't generate runfile: failed to run command "python /Users/sarah/ androidTest/goWorkSpace/src/github.com/google/battery-historian/ third_party/closure-library/closure/bin/build/depswriter.py --root=/ Users/sarah/androidTest/goWorkSpace/src/github.com/google/battery- historian/third_party/closure-library/closure/goog -- root_with_prefix=js ../../../../js":
exit status 2
python: can't open file '/Users/sarah/androidTest/goWorkSpace/src/ github.com/google/battery-historian/third_party/closure-library/closure/ bin/build/depswriter.py': [Errno 2] No such file or directory
在下载一个git项目closure-library时出现错误,自己clone下该项目再执行run go
要一直运行Battery Historian
cd $GOPATH/src/github.com/google/battery-historian
go run cmd/battery-historian/battery-historian.go [--port <default:9999>]
运行成功后打开的链接http://localhost:9999/,选择bugreport.txt或者zip包
要从运行Android 7.0及更高版本的开发设备获取错误报告:$ adb bugreport bugreport.zip
对于6.0及更低的设备:$ adb bugreport > bugreport.txt
==出现的问题:==在生成错误报告的时候出现不支持低于Android7.0的,原因升级SDK到25,里面的工具也会相应升级,改回旧版的adb
~~~
adb bugreport > xxx.log
Failed to get bugreportz version, which is only available on devices running Android 7.0 or later.
Trying a plain-text bug report instead.
~~~
解决方法:
下载旧版adbhttp://www.androiddevtools.cn/下载一个比较旧版本的adb(我下的是20),打开android SDK $ open ~/Library/Android/sdk/platform-tools
将platform中的adb替换下载的adb(不用替换整个platform-tools)