API are only available on the chrome://version page. It allows the use of tools such as Browserstack for test automation. Do not activate the corresponding options (available in the developer settings) if you do not know what you are doing.
20 lines
720 B
Bash
20 lines
720 B
Bash
#!/bin/bash
|
|
|
|
APP_NAME=$1
|
|
APP_APK=$2
|
|
|
|
echo Removing $APP_NAME
|
|
for id in $(curl -s -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY" \
|
|
-X GET "https://api-cloud.browserstack.com/app-automate/recent_apps" | \
|
|
jq --arg APP_NAME "$APP_NAME" -rc '.[] | select (.custom_id == $APP_NAME) | .app_id') ; do
|
|
echo ..Removing $id
|
|
curl -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY" \
|
|
-X DELETE "https://api-cloud.browserstack.com/app-automate/app/delete/${id}"
|
|
done
|
|
|
|
echo Uploading $APP_NAME from $APP_APK
|
|
curl -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY" \
|
|
-X POST "https://api-cloud.browserstack.com/app-automate/upload" \
|
|
-F "file=@$APP_APK" \
|
|
-F "custom_id=$APP_NAME"
|