@@ -11,11 +11,18 @@ function download_apps() {
11
11
# Skip if Calculator.apk already exists
12
12
if [ -f " Calculator.apk" ]; then
13
13
echo " Calculator.apk already exists, skipping download"
14
- return
14
+ else
15
+ local android_app_url=" https://www.browserstack.com/app-automate/sample-apps/android/Calculator.apk"
16
+ curl -o Calculator.apk $android_app_url
15
17
fi
16
18
17
- local app_url=" https://www.browserstack.com/app-automate/sample-apps/android/Calculator.apk"
18
- curl -o Calculator.apk $app_url
19
+ # Skip if BrowserStack-SampleApp.ipa already exists
20
+ if [ -f " BrowserStack-SampleApp.ipa" ]; then
21
+ echo " BrowserStack-SampleApp.ipa already exists, skipping download"
22
+ else
23
+ local ios_app_url=" https://www.browserstack.com/app-automate/sample-apps/ios/BrowserStack-SampleApp.ipa"
24
+ curl -o BrowserStack-SampleApp.ipa $ios_app_url
25
+ fi
19
26
}
20
27
21
28
function ensure_deps() {
@@ -86,6 +93,9 @@ function testO11YValidBuild() {
86
93
function testAppLive() {
87
94
echo " Testing App Live..."
88
95
testAppLiveAndroid
96
+ # # echo "Sleeping for 5 seconds before starting iOS test..."
97
+ # # sleep 5
98
+ # testAppLiveiOS
89
99
}
90
100
91
101
function testAppLiveAndroid() {
@@ -101,6 +111,19 @@ function testAppLiveAndroid() {
101
111
exit 1
102
112
fi
103
113
}
114
+ function testAppLiveiOS() {
115
+ realpath=$( realpath " ./BrowserStack-SampleApp.ipa" )
116
+ response=$( npx @modelcontextprotocol/inspector -e BROWSERSTACK_USERNAME=$_BROWSERSTACK_USERNAME -e BROWSERSTACK_ACCESS_KEY=$_BROWSERSTACK_ACCESS_KEY --cli node dist/index.js --method tools/call --tool-name runAppLiveSession --tool-arg desiredPlatform=' ios' --tool-arg desiredPlatformVersion=' 17.0' --tool-arg appPath=" $realpath " --tool-arg desiredPhone=' iPhone 15 Pro Max' )
117
+
118
+ echo " Response was: $response "
119
+ if echo " $response " | grep -q " Successfully started a session" ; then
120
+ log_success " Successfully started iOS app live session"
121
+ else
122
+ log_failure " Failed to start iOS app live session"
123
+ echo " Response was: $response "
124
+ exit 1
125
+ fi
126
+ }
104
127
105
128
function testBrowserLive() {
106
129
echo " Testing Browser Live..."
@@ -170,8 +193,8 @@ echo -e "\n\t Starting manual tests...\n\n"
170
193
171
194
# testO11Y
172
195
# sleep 5
173
- # testAppLive
196
+ testAppLive
174
197
# sleep 5
175
198
# testBrowserLive
176
199
sleep 5
177
- testAccessibility
200
+ # testAccessibility
0 commit comments