@@ -86,6 +86,73 @@ ios-bridge screenshot a1b2c3d4e5f6 --output ~/Desktop/ios-screenshot.png
8686ios-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
91158Once the desktop window opens, you can use these controls:
@@ -156,6 +223,19 @@ Create `~/.ios-bridge-cli.json`:
156223for session in $( ios-bridge list --format json | jq -r ' .[].session_id' ) ; do
157224 ios-bridge stream " $session " &
158225done
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
164244# !/usr/bin/env python3
165245import subprocess
166246import json
247+ import sys
167248
168249# Get list of sessions
169250result = subprocess.run([
@@ -172,12 +253,26 @@ result = subprocess.run([
172253
173254sessions = 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])
179273else :
180- print (" No sessions available" )
274+ print (f " ❌ App installation failed: { install_result.stderr} " )
275+ sys.exit(1 )
181276```
182277
183278## Integration Examples
0 commit comments