Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions mac/common-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ handle_app_upload() {
app_platform="android"
export APP_PLATFORM="$app_platform"
log_msg_to "Exported APP_PLATFORM=$APP_PLATFORM"
elif [[ "$choice" == *"Upload my App"* ]]; then
elif [[ "$choice" == *"Upload my App"* ]]; then
upload_custom_app
else
return 1
Expand All @@ -119,6 +119,7 @@ upload_sample_app() {
app_url=$(echo "$upload_response" | grep -o '"app_url":"[^"]*' | cut -d'"' -f4)
export BROWSERSTACK_APP=$app_url
log_msg_to "Exported BROWSERSTACK_APP=$BROWSERSTACK_APP"
log_info "Uploaded app URL: $app_url"

if [ -z "$app_url" ]; then
log_msg_to "❌ Upload failed. Response: $upload_response"
Expand All @@ -132,13 +133,21 @@ upload_sample_app() {
upload_custom_app() {
local app_platform=""
local file_path
file_path=$(osascript -e 'choose file with prompt "Select your .apk or .ipa file:" of type {"apk", "ipa"}' 2>/dev/null)

# Convert to POSIX path
file_path=$(osascript -e \
'POSIX path of (choose file with prompt "Select your .apk or .ipa file:" of type {"apk", "ipa"})' \
2>/dev/null)

# Trim whitespace
file_path="${file_path%"${file_path##*[![:space:]]}"}"

if [ -z "$file_path" ]; then
log_msg_to "❌ No file selected"
return 1
fi

log_info "Selected file: $file_path"
# Determine platform from file extension
if [[ "$file_path" == *.ipa ]]; then
app_platform="ios"
Expand All @@ -164,6 +173,7 @@ upload_custom_app() {

export BROWSERSTACK_APP=$app_url
log_msg_to "✅ App uploaded successfully"
log_info "Uploaded app URL: $app_url"
log_msg_to "Exported BROWSERSTACK_APP=$BROWSERSTACK_APP"

export APP_PLATFORM="$app_platform"
Expand Down
2 changes: 1 addition & 1 deletion mac/user-interaction.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ get_browserstack_credentials() {
get_tech_stack() {
local run_mode=$1
local tech_stack=""
if [[ "$RUN_MODE" == *"--silent"* || "$RUN_MODE" == *"--debug"* ]]; then
if [[ "$run_mode" == *"--silent"* || "$run_mode" == *"--debug"* ]]; then
tech_stack="$TSTACK"
log_msg_to "✅ Selected Tech Stack from environment: $tech_stack"
else
Expand Down
Loading