Skip to content

Commit bb88dc5

Browse files
committed
docs: update README
chore: update correct ext for installation ci: update ignore path
1 parent 86dbbb8 commit bb88dc5

3 files changed

Lines changed: 138 additions & 14 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,16 @@ name: Continuous Integration
33
on:
44
push:
55
branches: [main]
6+
paths-ignore:
7+
- "**.md"
8+
- "art/**"
9+
- "install.sh"
610
pull_request:
711
branches: [main]
12+
paths-ignore:
13+
- "**.md"
14+
- "art/**"
15+
- "install.sh"
816

917
jobs:
1018
analyze:

README.md

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,84 @@
1-
# Simutil - TUI application for launching Android Simulators / iOS Simulators and more ...
1+
<h1 align="center">Simutil</h1>
2+
3+
<p align="center">
4+
<strong>A terminal UI for managing Android Emulators / iOS Simulators and more</strong><br>
5+
<strong>Launch, connect, and manage your devices — all from the terminal</strong>
6+
</p>
7+
8+
<p align="center">
9+
<a href="https://github.com/dungngminh/simutil/actions/workflows/ci.yaml"><img src="https://github.com/dungngminh/simutil/actions/workflows/ci.yaml/badge.svg" alt="Build" /></a>
10+
<a href="https://github.com/dungngminh/simutil/releases/latest"><img src="https://img.shields.io/github/v/release/dungngminh/simutil" alt="GitHub release" /></a>
11+
</p>
12+
13+
Browse your available emulators and simulators side-by-side, launch with custom options, and connect to physical devices wirelessly.
14+
15+
Simutil is written with [Nocterm](https://nocterm.dev/), a terminal UI framework for Dart with similar syntax to Flutter.
16+
17+
// TODO: Add screenshot of Simutil
18+
19+
### Features
20+
21+
- **One-Key Launch** — Start any device with `Enter`, no need to open Android Studio or Xcode
22+
- **Android Launch Options** — Provide launch option for Android Emulators: Normal, Cold Boot, No Audio, or Cold Boot + No Audio,...
23+
- **ADB Tools Built-in** — Connect to physical Android devices wirelessly:
24+
- Connect via IP address
25+
- Pair with 6-digit code (Android 11+)
26+
- QR code pairing (Android 11+)
27+
28+
### Installation
29+
30+
```bash
31+
curl -fsSL https://raw.githubusercontent.com/dungngminh/simutil/main/install.sh | bash
32+
```
33+
34+
**Using Homebrew (macOS/Linux):**
35+
36+
```bash
37+
brew tap dungngminh/simutil
38+
brew install simutil
39+
```
40+
41+
**From pub.dev:**
42+
43+
```bash
44+
dart pub global activate simutil
45+
```
46+
47+
**From source:**
48+
49+
```bash
50+
git clone https://github.com/dungngminh/simutil.git
51+
cd simutil
52+
dart pub get
53+
dart pub global activate --source path .
54+
```
55+
56+
Then run:
57+
58+
```bash
59+
simutil
60+
```
61+
62+
### Supported platforms
63+
64+
- [x] macOS
65+
- [x] Linux
66+
- [ ] Windows
67+
68+
69+
### Contributing
70+
71+
```bash
72+
git clone https://github.com/dungngminh/simutil.git
73+
cd simutil
74+
dart pub get
75+
dart run bin/simutil.dart # Run locally
76+
```
77+
78+
1. Fork this repository
79+
2. Create a branch and make your changes
80+
3. Open a Pull Request
81+
82+
### License
83+
84+
MIT — see [LICENSE](LICENSE)

install.sh

Lines changed: 46 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ CYAN='\033[0;36m'
1414
BOLD='\033[1m'
1515
RESET='\033[0m'
1616

17-
info() { echo -e "${CYAN}[info]${RESET} $*"; }
18-
success() { echo -e "${GREEN}[✔]${RESET} $*"; }
19-
warn() { echo -e "${YELLOW}[warn]${RESET} $*"; }
20-
error() { echo -e "${RED}[✘]${RESET} $*"; exit 1; }
17+
info() { echo -e "${CYAN}[info]${RESET} $*" >&2; }
18+
success() { echo -e "${GREEN}[✔]${RESET} $*" >&2; }
19+
warn() { echo -e "${YELLOW}[warn]${RESET} $*" >&2; }
20+
error() { echo -e "${RED}[✘]${RESET} $*" >&2; exit 1; }
2121

2222
detect_os() {
2323
local os
@@ -46,8 +46,8 @@ resolve_version() {
4646
if [ "$version" = "latest" ]; then
4747
info "Resolving latest release..."
4848
version=$(curl -fsSL "https://api.github.com/repos/$REPO/releases/latest" \
49-
| grep '"tag_name"' \
50-
| sed -E 's/.*"tag_name":\s*"([^"]+)".*/\1/')
49+
| grep -m 1 '"tag_name":' \
50+
| cut -d '"' -f 4)
5151

5252
if [ -z "$version" ]; then
5353
error "Could not determine the latest release. Check https://github.com/$REPO/releases"
@@ -62,9 +62,9 @@ install() {
6262
local arch="$2"
6363
local version="$3"
6464

65-
local ext=""
65+
local ext=".tar.gz"
6666
if [ "$os" = "windows" ]; then
67-
ext=".exe"
67+
ext=".zip"
6868
fi
6969

7070
local asset_name="${BINARY_NAME}-${os}-${arch}${ext}"
@@ -74,20 +74,53 @@ install() {
7474
info "Version: ${BOLD}${version}${RESET}"
7575
info "Downloading ${BOLD}${asset_name}${RESET}..."
7676

77+
local tmp_dir
78+
tmp_dir="$(mktemp -d)"
79+
local tmp_file="${tmp_dir}/${asset_name}"
80+
7781
# Create install directory
7882
mkdir -p "$INSTALL_DIR"
7983

80-
local target_path="${INSTALL_DIR}/${BINARY_NAME}${ext}"
81-
8284
# Download
8385
local http_code
84-
http_code=$(curl -fsSL -w "%{http_code}" -o "$target_path" "$download_url" 2>&1) || true
86+
http_code=$(curl -fsSL -w "%{http_code}" -o "$tmp_file" "$download_url" 2>&1) || true
8587

86-
if [ ! -f "$target_path" ] || [ ! -s "$target_path" ]; then
87-
rm -f "$target_path"
88+
if [ ! -f "$tmp_file" ] || [ ! -s "$tmp_file" ]; then
89+
rm -rf "$tmp_dir"
8890
error "Download failed. URL: $download_url\n Make sure release $version exists with asset $asset_name."
8991
fi
9092

93+
info "Extracting..."
94+
if [ "$os" = "windows" ]; then
95+
unzip -q -o "$tmp_file" -d "$INSTALL_DIR" || {
96+
rm -rf "$tmp_dir"
97+
error "Failed to extract $tmp_file"
98+
}
99+
else
100+
tar -xzf "$tmp_file" -C "$INSTALL_DIR" || {
101+
rm -rf "$tmp_dir"
102+
error "Failed to extract $tmp_file"
103+
}
104+
fi
105+
106+
rm -rf "$tmp_dir"
107+
108+
local extracted_file="${INSTALL_DIR}/${BINARY_NAME}-${os}-${arch}"
109+
local target_path="${INSTALL_DIR}/${BINARY_NAME}"
110+
111+
if [ "$os" = "windows" ]; then
112+
target_path="${target_path}.exe"
113+
if [ -f "${extracted_file}.exe" ]; then
114+
extracted_file="${extracted_file}.exe"
115+
fi
116+
fi
117+
118+
if [ -f "$extracted_file" ]; then
119+
mv "$extracted_file" "$target_path"
120+
else
121+
error "Could not find expected binary '$extracted_file' after extraction."
122+
fi
123+
91124
# Make executable (skip on Windows)
92125
if [ "$os" != "windows" ]; then
93126
chmod +x "$target_path"

0 commit comments

Comments
 (0)