寒山闻钟专业版 | Zero Status
iClock - Simplest Always Best | Zero Status

读取iOS测试包(ipa)可用设备UDID列表

iOS教程 Zero Status 956 浏览 0评论

读取iOS测试包(ipa)可用设备UDID列表 - iOS - iOS教程 | Zero Status - 1

读取iOS测试包(ipa)可用设备UDID列表 - iOS - iOS教程 | Zero Status - 2

List udids found in an IPA file, without extracting the whole archive.

Works by searching for embedded.mobileprovision file(s) and selectively extracting them and printing a sorted, unique list of UDIDs.

install

Put the script somewhere in your PATH, or just run it directly.

use

listudids /path/to/build.ipa

options

-all will show a bit of extra information about where things were found.

listudids /path/to/build.ipa -all

#!/bin/bash

if [ -z "$1" ]; then
printf "Please provide an ipa file. Usage: listudids file_name.ipa [-all]\n"
exit
fi

if [ -n "$2" ] && [ "$2" == "-all" ]; then
all="all"
fi

FILE=$1
if [ -f "$FILE" ]; then
printf "Finding udids in '%s'...\n" "$FILE"
IFS=$'\n'
alludids=""
for provisionFile in $( unzip -l "$FILE" | grep embedded.mobileprovision | awk '{$1=$2=$3=""; print $0}' | sed "s/^[ \t]*//" ); do

out=$(unzip -p $FILE $provisionFile | strings | awk '/ProvisionedDevices/,/\/array/'| grep string | sed 's/<[/]*string>//g' | sed 's/^/ /g')
number=$(echo "$out" |grep \[A-Za-z0-9] | wc -l |xargs)

alludids=$(printf "%s\n$s" $alludids $out)

printf "%s udids in %s \n" $number $provisionFile;
if [ -n "$all" ]; then
for udid in $out; do
printf " %s\n" $udid
done
fi
done

printf "Here are the udids we found:\n"

for udid in $alludids; do
printf "%s\n" $udid
done | sort | uniq

else
echo "The File '$FILE' Does Not Exist"
exit
fi


读取iOS测试包(ipa)可用设备UDID列表 - iOS - iOS教程 | Zero Status - 3

读取iOS测试包(ipa)可用设备UDID列表 - iOS - iOS教程 | Zero Status - 4

转载请注明:Zero Status » 读取iOS测试包(ipa)可用设备UDID列表

您必须 登录 才能发表评论!