Skip to content

Commit e114ab8

Browse files
feat: Add app installation functionality and documentation for CLI and desktop app
1 parent b277b71 commit e114ab8

File tree

13 files changed

+565
-12
lines changed

13 files changed

+565
-12
lines changed

.github/workflows/build-and-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
version:
1010
description: 'Release version (e.g., v1.0.0)'
1111
required: true
12-
default: 'v1.0.9'
12+
default: 'v1.0.10'
1313

1414
permissions:
1515
contents: write

ios-bridge-cli/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,27 @@ ios-bridge info <session-id>
9191
ios-bridge terminate <session-id>
9292
```
9393

94+
### App Installation
95+
```bash
96+
# Install iOS app (.ipa or .zip) on simulator
97+
ios-bridge install-app /path/to/MyApp.ipa
98+
99+
# Install and launch immediately (shows upload progress)
100+
ios-bridge install-app /path/to/MyApp.ipa --launch
101+
102+
# Install on specific session (auto-detects if only one session)
103+
ios-bridge install-app /path/to/MyApp.zip <session-id> --launch
104+
105+
# Skip confirmation prompt with visual progress
106+
ios-bridge install-app /path/to/MyApp.ipa --force
107+
```
108+
109+
**Features:**
110+
- 📊 **Visual Progress Bar**: Real-time upload progress indicator
111+
- ⚙️ **Installation Status**: Clear feedback during processing
112+
- 🎯 **File Size Display**: Shows file size before upload
113+
- 🚀 **Launch Integration**: Automatic app launching after installation
114+
94115
### Streaming & Control
95116
```bash
96117
# Stream session (auto-detects if only one session)

ios-bridge-cli/USAGE.md

Lines changed: 99 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,73 @@ ios-bridge screenshot a1b2c3d4e5f6 --output ~/Desktop/ios-screenshot.png
8686
ios-bridge screenshot a1b2c3d4e5f6 --server http://localhost:8000 --output device.png
8787
```
8888

89+
### 5. App Installation
90+
91+
Install iOS apps (.ipa files) or app bundles (.zip files) directly onto simulator sessions:
92+
93+
```bash
94+
# Install app on auto-detected session (if only one exists)
95+
ios-bridge install-app /path/to/MyApp.ipa
96+
97+
# Install and launch immediately
98+
ios-bridge install-app /path/to/MyApp.ipa --launch
99+
100+
# Install on specific session
101+
ios-bridge install-app /path/to/MyApp.ipa a1b2c3d4e5f6
102+
103+
# Install app bundle from ZIP file
104+
ios-bridge install-app /path/to/MyAppBundle.zip --launch
105+
106+
# Skip confirmation prompts (useful for automation)
107+
ios-bridge install-app /path/to/MyApp.ipa --force --launch
108+
109+
# With custom server
110+
ios-bridge install-app /path/to/MyApp.ipa --server http://localhost:8000 --launch
111+
```
112+
113+
Example output:
114+
```
115+
📱 Installing app on iOS simulator:
116+
App: MyApp.ipa (15.2 MB)
117+
Device: iPhone 14 Pro iOS 16.0
118+
Session: a1b2c3d4e5f6...
119+
Action: Install and launch
120+
121+
💡 Do you want to install and launch MyApp.ipa? [y/N]: y
122+
123+
🚀 Installing and launching MyApp.ipa...
124+
📤 Uploading MyApp.ipa [████████████████████████████████] 100%
125+
⚙️ Processing installation...
126+
✅ App installed and launched successfully!
127+
128+
📋 App Details:
129+
Name: My Awesome App
130+
Bundle ID: com.company.myapp
131+
Version: 1.0.0
132+
133+
🚀 App launched:
134+
Bundle ID: com.company.myapp
135+
Process ID: 12345
136+
```
137+
138+
**Progress Features:**
139+
- **Upload Progress Bar**: Visual progress indicator showing upload status
140+
- **File Size Display**: Shows file size in MB before upload
141+
- **Installation Phases**: Clear indicators for upload and installation phases
142+
- **Real-time Updates**: Progress bar updates smoothly during upload
143+
144+
**Supported formats:**
145+
- `.ipa` files (iOS app archives)
146+
- `.zip` files (containing `.app` bundles)
147+
148+
**Error handling:**
149+
The command provides detailed error messages for common issues:
150+
- File not found or unreadable
151+
- Unsupported file format
152+
- Session not found
153+
- Installation failures with specific error codes
154+
- Network connection issues
155+
89156
## Desktop Controls
90157

91158
Once the desktop window opens, you can use these controls:
@@ -156,6 +223,19 @@ Create `~/.ios-bridge-cli.json`:
156223
for session in $(ios-bridge list --format json | jq -r '.[].session_id'); do
157224
ios-bridge stream "$session" &
158225
done
226+
227+
# Install app on all active sessions
228+
for session in $(ios-bridge list --format json | jq -r '.[].session_id'); do
229+
echo "Installing app on session $session"
230+
ios-bridge install-app /path/to/MyApp.ipa "$session" --force --launch
231+
done
232+
233+
# Automated testing workflow
234+
SESSION_ID=$(ios-bridge create "iPhone 14 Pro" "16.0" --wait | grep "Session ID:" | awk '{print $3}')
235+
ios-bridge install-app /path/to/TestApp.ipa "$SESSION_ID" --force --launch
236+
sleep 5 # Wait for app to fully launch
237+
ios-bridge screenshot "$SESSION_ID" --output test-result.png
238+
ios-bridge terminate "$SESSION_ID" --force
159239
```
160240

161241
### Scripting Integration
@@ -164,6 +244,7 @@ done
164244
#!/usr/bin/env python3
165245
import subprocess
166246
import json
247+
import sys
167248

168249
# Get list of sessions
169250
result = subprocess.run([
@@ -172,12 +253,26 @@ result = subprocess.run([
172253

173254
sessions = json.loads(result.stdout)
174255

175-
# Stream the first available session
176-
if sessions:
177-
session_id = sessions[0]['session_id']
256+
if not sessions:
257+
print("No sessions available")
258+
sys.exit(1)
259+
260+
# Install app on first available session
261+
session_id = sessions[0]['session_id']
262+
app_path = "/path/to/MyApp.ipa"
263+
264+
print(f"Installing app on session: {session_id}")
265+
install_result = subprocess.run([
266+
'ios-bridge', 'install-app', app_path, session_id, '--launch', '--force'
267+
], capture_output=True, text=True)
268+
269+
if install_result.returncode == 0:
270+
print("✅ App installed successfully")
271+
# Stream the session
178272
subprocess.run(['ios-bridge', 'stream', session_id])
179273
else:
180-
print("No sessions available")
274+
print(f"❌ App installation failed: {install_result.stderr}")
275+
sys.exit(1)
181276
```
182277

183278
## Integration Examples

ios-bridge-cli/ios_bridge_cli.egg-info/PKG-INFO

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.4
22
Name: ios-bridge-cli
3-
Version: 1.0.6
3+
Version: 1.0.9
44
Summary: Desktop streaming client for iOS Bridge simulator sessions with Electron app integration
55
Home-page: https://github.com/AutoFlowLabs/ios-bridge-cli
66
Author: iOS Bridge Team
@@ -33,6 +33,16 @@ Requires-Dist: pillow>=8.0.0
3333
Requires-Dist: psutil>=5.8.0
3434
Requires-Dist: aiohttp>=3.8.0
3535
Requires-Dist: packaging>=21.0
36+
Requires-Dist: fastapi>=0.100.0
37+
Requires-Dist: uvicorn>=0.23.0
38+
Requires-Dist: pydantic>=2.0.0
39+
Requires-Dist: starlette>=0.27.0
40+
Requires-Dist: python-multipart>=0.0.6
41+
Requires-Dist: opencv-python>=4.5.0
42+
Requires-Dist: numpy>=1.21.0
43+
Requires-Dist: av>=10.0.0
44+
Requires-Dist: jinja2>=3.0.0
45+
Requires-Dist: aiortc>=1.6.0
3646
Provides-Extra: dev
3747
Requires-Dist: pytest>=6.0; extra == "dev"
3848
Requires-Dist: pytest-asyncio>=0.18.0; extra == "dev"
@@ -41,6 +51,8 @@ Requires-Dist: flake8>=4.0; extra == "dev"
4151
Requires-Dist: mypy>=0.900; extra == "dev"
4252
Requires-Dist: build>=0.8.0; extra == "dev"
4353
Requires-Dist: twine>=4.0.0; extra == "dev"
54+
Provides-Extra: server
55+
Requires-Dist: fb-idb>=1.1.0; extra == "server"
4456
Dynamic: author
4557
Dynamic: home-page
4658
Dynamic: license-file
@@ -139,6 +151,27 @@ ios-bridge info <session-id>
139151
ios-bridge terminate <session-id>
140152
```
141153

154+
### App Installation
155+
```bash
156+
# Install iOS app (.ipa or .zip) on simulator
157+
ios-bridge install-app /path/to/MyApp.ipa
158+
159+
# Install and launch immediately (shows upload progress)
160+
ios-bridge install-app /path/to/MyApp.ipa --launch
161+
162+
# Install on specific session (auto-detects if only one session)
163+
ios-bridge install-app /path/to/MyApp.zip <session-id> --launch
164+
165+
# Skip confirmation prompt with visual progress
166+
ios-bridge install-app /path/to/MyApp.ipa --force
167+
```
168+
169+
**Features:**
170+
- 📊 **Visual Progress Bar**: Real-time upload progress indicator
171+
- ⚙️ **Installation Status**: Clear feedback during processing
172+
- 🎯 **File Size Display**: Shows file size before upload
173+
- 🚀 **Launch Integration**: Automatic app launching after installation
174+
142175
### Streaming & Control
143176
```bash
144177
# Stream session (auto-detects if only one session)

ios-bridge-cli/ios_bridge_cli.egg-info/SOURCES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ requirements.txt
1515
setup.py
1616
test_package.py
1717
ios_bridge_cli/__init__.py
18+
ios_bridge_cli/__main__.py
1819
ios_bridge_cli/app_manager.py
1920
ios_bridge_cli/cli.py
2021
ios_bridge_cli/client.py

ios-bridge-cli/ios_bridge_cli.egg-info/requires.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ fastapi>=0.100.0
99
uvicorn>=0.23.0
1010
pydantic>=2.0.0
1111
starlette>=0.27.0
12+
python-multipart>=0.0.6
13+
opencv-python>=4.5.0
14+
numpy>=1.21.0
15+
av>=10.0.0
16+
jinja2>=3.0.0
17+
aiortc>=1.6.0
1218

1319
[dev]
1420
pytest>=6.0

ios-bridge-cli/ios_bridge_cli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
iOS Bridge CLI - Desktop streaming client for iOS Bridge simulator sessions
33
"""
44

5-
__version__ = "1.0.9"
5+
__version__ = "1.0.10"
66
__author__ = "iOS Bridge Team"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""
2+
Main entry point for ios_bridge_cli package when run as a module.
3+
This allows the package to be executed with: python -m ios_bridge_cli
4+
"""
5+
6+
from .cli import main
7+
8+
if __name__ == '__main__':
9+
main()

0 commit comments

Comments
 (0)