Various improvements to test scripts
This commit is contained in:
parent
6486db2796
commit
80e130c339
|
@ -1,8 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
if ! hash jq 2>/dev/null; then
|
||||||
|
echo "This script requires jq. Do brew install jq."
|
||||||
|
fi
|
||||||
|
|
||||||
|
DEVICE_TYPE=`xcrun simctl list devicetypes "iPhone 8" --json | jq '.devicetypes[0].identifier' --raw-output`
|
||||||
|
RUNTIME=`xcrun simctl list runtimes "iOS" --json | jq '.runtimes[0].identifier' --raw-output`
|
||||||
|
|
||||||
LOGO="🧪 "
|
LOGO="🧪 "
|
||||||
DEVICE_TYPE=com.apple.CoreSimulator.SimDeviceType.iPhone-7
|
|
||||||
RUNTIME=com.apple.CoreSimulator.SimRuntime.iOS-12-2
|
|
||||||
URL='https://localhost:1443/'
|
URL='https://localhost:1443/'
|
||||||
|
|
||||||
# HTTPS server
|
# HTTPS server
|
||||||
|
@ -13,7 +18,7 @@ HTTP_SERVER_PID=$!
|
||||||
|
|
||||||
# Create simulator
|
# Create simulator
|
||||||
|
|
||||||
echo "${LOGO} Creating simulator"
|
echo "${LOGO} Creating simulator ($DEVICE_TYPE / $RUNTIME)"
|
||||||
UUID=`xcrun simctl create cert-test-iphone ${DEVICE_TYPE} ${RUNTIME}`
|
UUID=`xcrun simctl create cert-test-iphone ${DEVICE_TYPE} ${RUNTIME}`
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
|
@ -42,7 +47,7 @@ read
|
||||||
# Opening the URL
|
# Opening the URL
|
||||||
|
|
||||||
echo "${LOGO} Opening ${URL} in simulator. This should now show the contents of this directory in Safari."
|
echo "${LOGO} Opening ${URL} in simulator. This should now show the contents of this directory in Safari."
|
||||||
echo "${LOGO} Press enter when done."
|
echo "${LOGO} When confirmed, press enter to clean up, deleting this test simulator."
|
||||||
xcrun simctl openurl ${UUID} ${URL}
|
xcrun simctl openurl ${UUID} ${URL}
|
||||||
read
|
read
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,4 @@
|
||||||
|
|
||||||
# This can be useful for testing the install-ca command
|
# This can be useful for testing the install-ca command
|
||||||
|
|
||||||
openssl genrsa -out test-ca.key 4096
|
openssl req -x509 -newkey rsa:4096 -keyout test-ca.key -out test-ca.crt -days 365 -nodes -subj '/CN=localhost'
|
||||||
openssl req -x509 -new -nodes -key test-ca.key -sha256 -days 1024 -out test-ca.crt
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue