Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
DEL /uiautomator status 500->200, close #26
Browse files Browse the repository at this point in the history
  • Loading branch information
codeskyblue committed Mar 25, 2019
1 parent 16ec6a8 commit 806b769
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,16 @@ Success
# 停止
$ curl -X DELETE $DEVICE_URL/uiautomator
Success

# 再次停止
$ curl -X DELETE $DEVICE_URL/uiautomator
Already stopped

# 获取uiautomator状态
$ curl $DEVICE/uiautomator
{
"running": true
}
```

## 启动应用
Expand Down
4 changes: 2 additions & 2 deletions restapi.go → httprestapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ func (server *Server) initHTTPServer() {
if err == nil {
io.WriteString(w, "Success")
} else {
http.Error(w, err.Error(), 500)
io.WriteString(w, "Already stopped")
}
}).Methods("DELETE")

Expand All @@ -355,7 +355,7 @@ func (server *Server) initHTTPServer() {
renderJSON(w, map[string]interface{}{
"running": running,
})
})
}).Methods("GET")

m.HandleFunc("/raw/{filepath:.*}", func(w http.ResponseWriter, r *http.Request) {
filepath := mux.Vars(r)["filepath"]
Expand Down

0 comments on commit 806b769

Please sign in to comment.