Cider Isn't Darwin Emulation, Really
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720#!/bin/sh# Copyright (c) 2004-2017 Apple Inc.## get-mobility-info## Collect system & network configuration information.#PATH=/bin:/usr/bin:/sbin:/usr/sbinOUTDIR=""NO_PCAP=0NO_TAR=0while getopts f:PT OPTION ; do case ${OPTION} in f) OUTDIR="${OPTARG}" if [ ! -d "${OUTDIR}" ]; then echo "# ${PROGNAME}: \"${OUTDIR}\" is not a directory" exit 1 fi ;; P) NO_PCAP=1 ;; T) NO_TAR=1 ;; \?) ;; esacdone## Disclaimer#cat <<_END_OF_DISCLAIMERThis diagnostic tool generates files that allow Apple to investigate issueswith your computer and help Apple to improve its products. The generated filesmay contain some of your personal information, which may include, but not belimited to, the serial number or similar unique number for your device, youruser name, or your computer name. The information is used by Apple inaccordance with its privacy policy (www.apple.com/privacy) and is not sharedwith any third party. By enabling this diagnostic tool and sending a copy ofthe generated files to Apple, you are consenting to Apple's use of the contentof such files._END_OF_DISCLAIMER/bin/echo "Press 'Enter' to continue."read reply## Setup#PRIV=""if [ ${EUID} -ne 0 ]; then PRIV="sudo"fiif [ -x /usr/bin/tail ]; then TAIL_2000="/usr/bin/tail -n 2000" TAIL_25000="/usr/bin/tail -n 25000"else TAIL_2000="/bin/cat" TAIL_25000="/bin/cat"fiOUT="mobility-info-`date +'%Y.%m.%d.%H%M%S'`"if [ -z $OUTDIR ]; then OUTDIR="/var/tmp" if [ -d ~/Desktop ]; then OUTDIR=~/Desktop elif [ "`readlink /tmp`" = "private/var/tmp" ]; then OUTDIR=/Library/Logs/DiagnosticReports if [ ! -d /Library/Logs/DiagnosticReports -a -d /Library/Logs/CrashReporter ]; then OUTDIR=/Library/Logs/CrashReporter fi mkdir -p ${OUTDIR} fifiumask 077WORKDIR=`mktemp -d -q "/tmp/${OUT}"`if [ $? -ne 0 ]; then echo "Could not create snapshot directory" exit 1fiif [ $NO_TAR -eq 0 ]; then GZ_EXT="" GZ_OPT="" if [ -x /usr/bin/gzip ]; then GZ_EXT=".gz" GZ_OPT="-z" fi ARCHIVE=`mktemp -q "${OUTDIR}/${OUT}.tar${GZ_EXT}"` if [ $? -ne 0 ]; then echo "Could not create snapshot archive" rm -rf "${WORKDIR}" exit 1 fificd "${WORKDIR}"echo ""echo "Please wait, collecting information and statistics"echo ""## collect packet capture with kernel ring buffer if available#stop_pcap () { # # Stop the packet capture # if [ ${PCAP_STARTED} -ne 0 ]; then trap '' SIGINT /usr/local/bin/netdiagnose stop packetcapture 2>&1 PCAP_STARTED=0 fi}PCAP_STARTED=0if [ -x /usr/local/bin/netdiagnose -a ${NO_PCAP} -ne 1 ]; then trap stop_pcap SIGINT /usr/local/bin/netdiagnose -p "${WORKDIR}" start packetcapture 2>&1 PCAP_STARTED=1fi## get-network-info#if [ -x /System/Library/Frameworks/SystemConfiguration.framework/Resources/get-network-info ]; then /bin/sh /System/Library/Frameworks/SystemConfiguration.framework/Resources/get-network-info -s -c -P "${WORKDIR}"elif [ -x /System/Library/Frameworks/SystemConfiguration.framework/get-network-info ]; then /bin/sh /System/Library/Frameworks/SystemConfiguration.framework/get-network-info -s -c -P "${WORKDIR}"elif [ -x /System/Library/PrivateFrameworks/SystemConfiguration.framework/get-network-info ]; then /bin/sh /System/Library/PrivateFrameworks/SystemConfiguration.framework/get-network-info -s -c -P "${WORKDIR}"fi## processes#if [ -x /bin/ps ]; then /bin/ps axlww > ps 2>&1fi## AirPort info#if [ -x /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport ]; then /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport --getinfo \ > airport 2>&1fi## collect wifi dump#if [ -x /usr/bin/wdutil -a -x /bin/ls ]; then ${PRIV} /usr/bin/wdutil dump mkdir -p "wifi_dump" /bin/ls -1 /private/tmp/wifi-* 2>/dev/null \ | while read log do if [ -f "${log}" ]; then b="`basename ${log}`" ${PRIV} cat "${log}" > "wifi_dump/${b}" 2>&1 fi donefi## OS info#if [ -e /System/Library/CoreServices/SystemVersion.plist ]; then cat /System/Library/CoreServices/SystemVersion.plist \ > SystemVersion.plist 2>&1fi## IOKit info#if [ -x /usr/sbin/ioreg ]; then /usr/sbin/ioreg -i -l -w 0 > ioreg 2>&1 /usr/sbin/ioreg -i -l -p IODeviceTree -w 0 >> ioreg 2>&1fi## Power Management info#if [ -x /usr/bin/pmset ]; then echo "#" > pmset echo "# pmset -g everything" >> pmset echo "#" >> pmset /usr/bin/pmset -g everything 2>/dev/null | ${TAIL_25000} >> pmsetfi## Host configuration#if [ -x /usr/bin/hostinfo ]; then /usr/bin/hostinfo > hostinfo 2>&1fiif [ -e /etc/hostconfig ]; then cat /etc/hostconfig > etc.hostconfig 2>&1fi## System / network preferences#for f in \ /Library/Preferences/SystemConfiguration/com.apple.PowerManagement.plist \ /Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist \ /Library/Preferences/SystemConfiguration/com.apple.wifi.plist \ /Library/Preferences/com.apple.alf.plist \ /Library/Preferences/com.apple.sharing.firewall.plist \ /Library/Preferences/com.apple.wwand.plist \do if [ -e "${f}" ]; then b="`basename ${f}`" cat "${f}" > "${b}" 2>&1 fidone## Install log#if [ -e /var/log/install.log ]; then cat /var/log/install.log > install.log 2>&1fi## System / network preferences (from other volumes)#mount -t hfs | grep "/Volumes/" | sed -e 's:^.* on /Volumes/::' -e 's: ([^(]*$::' \| while read volumedo V_PATH="/Volumes/${volume}" if [ -h "${V_PATH}" ]; then # if the path is a symlink continue fi for f in \ /Library/Preferences/SystemConfiguration/Networkinterfaces.plist \ /Library/Preferences/SystemConfiguration/preferences.plist \ do if [ -f "${V_PATH}/${f}" ]; then mkdir -p "OtherPreferences/${volume}" b="`basename ${f}`" cat "${V_PATH}/${f}" > "OtherPreferences/${volume}/${b}" 2>&1 fi donedone## InternetSharing#if [ -e /etc/bootpd.plist ]; then cat /etc/bootpd.plist > bootpd.plist 2>&1 cat /etc/com.apple.named.proxy.conf > com.apple.named.proxy.conf 2>/dev/nullelif [ -e /Library/Preferences/SystemConfiguration/bootpd.plist ]; then cat /Library/Preferences/SystemConfiguration/bootpd.plist > bootpd.plist 2>&1 cat /Library/Preferences/SystemConfiguration/com.apple.named.proxy.conf > com.apple.named.proxy.conf 2>/dev/nullfi## mounted filesystems#mount > mounted-filesystems 2>&1${PRIV} cat /etc/hosts > etc.hosts 2>/dev/null## kernel extensions statistic#if [ -x /usr/sbin/kextstat ]; then /usr/sbin/kextstat > kextstat 2>&1fiif [ -x /sbin/pfctl ]; then echo "#" > pf echo "# pfctl -s all" >> pf echo "#" >> pf ${PRIV} /sbin/pfctl -s all >> pf 2>&1 echo "==============================" >> pf echo "#" >> pf echo "# pfctl -s References" >> pf echo "#" >> pf ${PRIV} /sbin/pfctl -s References >> pf 2>&1 for ANCHOR in `${PRIV} pfctl -s Anchors -v 2>/dev/null` do echo "==============================" >> pf echo "#" >> pf echo "# pfctl -a ${ANCHOR} -s all" >> pf echo "#" >> pf ${PRIV} /sbin/pfctl -a ${ANCHOR} -s all >> pf 2>&1 donefi## mach port info#if [ -x /usr/local/bin/lsmp ]; then ${PRIV} /usr/local/bin/lsmp -a -v > lsmp 2>&1fi## open files#if [ -x /usr/sbin/lsof ]; then ${PRIV} /usr/sbin/lsof +c 0 -n -O -P -T q > lsof 2>&1 & LSOF_PID=$! # Init a watchdog for lsof ( WAIT_TIME=5 while [ $WAIT_TIME -gt 0 ] do ${PRIV} kill -0 ${LSOF_PID} 2>/dev/null if [ $? -eq 0 ]; then sleep 1 # lsof is gathering data.. WAIT_TIME=$((WAIT_TIME-1)) continue fi # lsof completed gathering data break done if [ $WAIT_TIME -eq 0 ]; then # lsof timed out ${PRIV} kill ${LSOF_PID} 2>/dev/null fi ) &fi## [lib]dispatch info#if [ -x /usr/local/bin/ddt ]; then /bin/echo -n "" > dispatch-info for BIN in \ configd \ discoveryd \ do echo "#" >> dispatch-info echo "# ddt -vkp ${BIN}" >> dispatch-info echo "#" >> dispatch-info ${PRIV} /usr/local/bin/ddt -vkp ${BIN} >> dispatch-info 2>&1 donefi## OpenDirectory info#if [ -x /usr/bin/odutil ]; then echo "#" > od-info echo "# odutil show all" >> od-info echo "#" >> od-info ${PRIV} /usr/bin/odutil show all >> od-info 2>&1fi## Kerberos configuration#if [ -x /usr/bin/klist ]; then echo "#" > kerberos echo "# klist --verbose --all-content" >> kerberos echo "#" >> kerberos klist --verbose --all-content >> kerberos 2>&1 echo "#" >> kerberos echo "# ktutil list" >> kerberos echo "#" >> kerberos ${PRIV} /usr/sbin/ktutil --verbose list >> kerberos 2>&1 echo "#" >> kerberos echo "# gsstool list --verbose" >> kerberos echo "#" >> kerberos /System/Library/PrivateFrameworks/Heimdal.framework/Helpers/gsstool list --verbose >> kerberos 2>&1fi## system profiler#if [ -x /usr/sbin/system_profiler ]; then system_profiler -xml SPEthernetDataType \ SPFibreChannelDataType \ SPFireWireDataType \ SPFirewallDataType \ SPModemDataType \ SPNetworkDataType \ SPThunderboltDataType \ SPWWANDataType \ SPAirPortDataType > system_profiler.spx 2>/dev/nullfi## system usage statistics#/bin/echo -n "" > system-statisticsif [ -x /usr/bin/uptime ]; then echo "#" >> system-statistics echo "# uptime" >> system-statistics echo "#" >> system-statistics /usr/bin/uptime >> system-statistics 2>&1fiif [ -x /usr/sbin/sysctl ]; then echo "#" >> system-statistics echo "# sysctl kern hw net debug" >> system-statistics echo "#" >> system-statistics /usr/sbin/sysctl kern hw net debug >> system-statistics 2>&1fiif [ -x /usr/bin/zprint ]; then echo "#" >> system-statistics echo "# zprint" >> system-statistics echo "#" >> system-statistics ${PRIV} /usr/bin/zprint >> system-statistics 2>&1fiif [ -x /usr/sbin/lsof -a -x /bin/ls ]; then N=0 /bin/ls -1 /Library/Preferences/SystemConfiguration/*-lock \ 2>/dev/null \ | while read lock do if [ ${N} -eq 0 ]; then echo "#" >> system-statistics echo "# lsof [SCPreferences lock files]" >> system-statistics fi N=`expr ${N} + 1` echo "#" >> system-statistics ${PRIV} /usr/sbin/lsof +c 0 -- ${lock} >> system-statistics 2>&1 donefi## collect executable and plugin info#report_binary_info(){ if [ ! -f "${1}" ]; then return fi VERSION=`what "${1}"` echo "${VERSION}" >> versions 2>&1 SUM=`sum "${1}"` echo "\tsum: ${SUM}" >> versions 2>&1 LSINFO=`ls -lu "${1}"` echo "\tadditional info: ${LSINFO}" >> versions 2>&1 echo "" >> versions 2>&1}get_binary_info(){ for BIN in \ /usr/libexec/bootpd \ /usr/libexec/configd \ /usr/libexec/discoveryd \ /usr/sbin/awacsd \ /usr/sbin/mDNSResponder \ /usr/sbin/pppd \ /usr/sbin/racoon \ /usr/libexec/misd \ /usr/libexec/InternetSharing \ /System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration \ do report_binary_info "${BIN}" done if [ -x /usr/bin/xcode-select -a -x /usr/bin/xcodebuild -a -x /usr/bin/xcrun ]; then SDKPATH="`xcode-select --print-path 2>/dev/null`" if [ $? -eq 0 -a -n "${SDKPATH}" ]; then /usr/bin/xcodebuild -showsdks 2>/dev/null \ | grep iphone \ | awk '{ print $NF }' \ | while read SDK do SDKPATH="`xcrun --sdk $SDK --show-sdk-path`" for BIN in \ /usr/libexec/configd_sim \ /System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration \ do report_binary_info "${SDKPATH}${BIN}" done done else echo "*** NO SDKs ***" >> versions echo "" >> versions fi fi}get_plugins_info(){ num=0 cd /System/Library/SystemConfiguration for PLUGIN in *.bundle do plugins[$num]="${PLUGIN}" num=$(( $num + 1 )) done cd "${WORKDIR}" for PLUGIN in "${plugins[@]}" do PLUGIN_DIR="/System/Library/SystemConfiguration/${PLUGIN}" PLUGIN_INF="${PLUGIN_DIR}/Contents/Info.plist" if [ ! -f "${PLUGIN_INF}" ]; then PLUGIN_INF="${PLUGIN_DIR}/Info.plist" if [ ! -f "${PLUGIN_INF}" ]; then echo "${PLUGIN_INF}: No Info.plist" >> versions 2>&1 fi fi echo "${PLUGIN}" >> versions 2>&1 ENABLED="Enabled" BOOL=`scutil --get "${PLUGIN_INF}" / Enabled 2>/dev/null` if [ $? -eq 0 ]; then if [ ${BOOL} = "TRUE" ]; then ENABLED="Enabled*" else ENABLED="Disabled" fi fi echo "\t${ENABLED}" >> versions 2>&1 VERBOSE="" BOOL=`scutil --get "${PLUGIN_INF}" / Verbose 2>/dev/null` if [ $? -eq 0 ]; then if [ ${BOOL} = "TRUE" ]; then VERBOSE="Verbose" fi fi if [ -n "${VERBOSE}" ]; then echo "\t${VERBOSE}" >> versions 2>&1 fi VERSION=`scutil --get "${PLUGIN_INF}" / CFBundleVersion 2>/dev/null` if [ $? -eq 1 ]; then VERSION=`scutil --get "${PLUGIN_INF}" / CFBundleShortVersionString 2>/dev/null` fi echo "\tVersion: ${VERSION}" >> versions 2>&1 if [ -f "${PLUGIN_DIR}/Contents/MacOS/${PLUGIN%.*}" ]; then SUM=`sum "${PLUGIN_DIR}/Contents/MacOS/${PLUGIN%.*}"` echo "\tsum: ${SUM}" >> versions 2>&1 LSINFO=`ls -lu "${PLUGIN_DIR}/Contents/MacOS/${PLUGIN%.*}"` echo "\tadditional info: ${LSINFO}" >> versions 2>&1 elif [ -f "${PLUGIN_DIR}/${PLUGIN%.*}" ]; then SUM=`sum "${PLUGIN_DIR}/${PLUGIN%.*}"` echo "\tsum: ${SUM}" >> versions 2>&1 LSINFO=`ls -lu "${PLUGIN_DIR}/${PLUGIN%.*}"` echo "\tadditional info: ${LSINFO}" >> versions 2>&1 fi echo "" >> versions 2>&1 done}if [ -x /usr/bin/what -a -x /usr/bin/sum -a -x /bin/ls ]; then get_binary_info get_plugins_infofi## collect the logarchive#if [ -x /usr/bin/log ]; then LOGARCHIVE_START_TIME=`date -v -1d +"%Y-%m-%d %H:%M:%S"` LOGARCHIVE_OUTPUT="system_logs.logarchive" ${PRIV} /usr/bin/log collect --livedata --output "${LOGARCHIVE_OUTPUT}" --start "${LOGARCHIVE_START_TIME}" 2>/dev/null if [ -d ${LOGARCHIVE_OUTPUT} ]; then ${PRIV} chown -R ${UID} "${LOGARCHIVE_OUTPUT}" fifi## dmesg#if [ -x /sbin/dmesg ]; then ${PRIV} /sbin/dmesg > dmesgfi## ppp log file(s)#scutil <<_END_OF_INPUT \| awk -F' *: *' \ ' \ /Logfile : / { \ if (index($2, "/") == 1) { print $2 } \ else { print "/var/log/ppp/" $2 } \ } \ END { \ print "/tmp/pppotcp.log" \ } \ ' \| sort -u \| while read logFileopenshow Setup:/Network/Service/[^/]+/PPP patternquit_END_OF_INPUTdo if [ -f "${logFile}" ]; then b="`basename ${logFile}`" cat "${logFile}" > "${b}" 2>&1 fidoneif [ -x /bin/ls ]; then # # collect crash reports # for daemon in \ InternetSharing \ SCHelper \ SCMonitor \ awacsd \ bootpd \ configd \ discoveryd \ discoveryd_helper \ eapolclient \ mDNSResponder \ mDNSResponderHelper \ pppd \ racoon \ socketfilterfw \ do /bin/ls -1 /Library/Logs/DiagnosticReports/${daemon}_*.crash \ /Library/Logs/DiagnosticReports/${daemon}_*.ips \ /Library/Logs/CrashReporter/${daemon}_*.crash \ /Library/Logs/CrashReporter/${daemon}_*.ips \ /Library/Logs/CrashReporter/${daemon}_*.plist \ 2>/dev/null \ | while read log do if [ -f "${log}" ]; then b="`basename ${log}`" ${PRIV} cat "${log}" > "${b}" 2>&1 fi done donefi## stackshot#if [ -x /usr/local/bin/crstackshot ]; then /usr/local/bin/crstackshot 2>/dev/nullfi## wait for background activity (eg: lsof)#wait## Stop the packet capture#stop_pcapif [ $NO_TAR -eq 0 ]; then # # collect everything into a single archive # cd "${WORKDIR}/.." tar -c ${GZ_OPT} -f "${ARCHIVE}" "${OUT}" rm -rf "${WORKDIR}" if [ ${UID} -eq 0 ]; then if [ -n "${SUDO_UID}" -a -n "${SUDO_GID}" ]; then if [ ${UID} -ne ${SUDO_UID} ]; then chown ${SUDO_UID}:${SUDO_GID} "${ARCHIVE}" fi fi fi echo "Network data collected to \"${ARCHIVE}\""else mv "${WORKDIR}" "${OUTDIR}" if [ ${UID} -eq 0 ]; then if [ -n "${SUDO_UID}" -a -n "${SUDO_GID}" ]; then if [ ${UID} -ne ${SUDO_UID} ]; then chown -R ${SUDO_UID}:${SUDO_GID} "${OUTDIR}/${OUT}" fi fi fi echo "Network data collected to \"${OUTDIR}/${OUT}\""fi