Skip to content

Instantly share code, notes, and snippets.

@Pitometsu
Last active April 20, 2017 15:09
Show Gist options
  • Select an option

  • Save Pitometsu/dbca5f60cb4cbe0eb5fbf2a447923186 to your computer and use it in GitHub Desktop.

Select an option

Save Pitometsu/dbca5f60cb4cbe0eb5fbf2a447923186 to your computer and use it in GitHub Desktop.
Debug iOS
$ xcrun xcodebuild -configuration Debug -destination 'platform=iOS Simulator,name=iPhone 7,OS=10.3' clean build
$ xcrun lldb -- $DerivedData/$AppName/Build/Products/Debug-iphonesimulator/$AppName.app
(lldb) process attach --name '$AppName' --waitfor
(lldb) platform select ios-simulator
(lldb) platform connect $UDID
$ xcrun instruments -w "`xcrun instruments -s | grep 'iPhone 7 (10.3)' | head -1`"
$ open -a "Simulator" --args -CurrentDeviceUDID "`xcrun instruments -s | grep 'iPhone 7 (10.3)' | head -1 | sed -E -e 's/[^][]*\[([^][]*)\][^][]*/\1/g'`"
$ xcrun simctl install booted $DerivedData/$AppName/Build/Products/Debug-iphonesimulator/$AppName.app
$ xcrun simctl launch booted $AppBundleID
# xcrun simctl launch --wait-for-debugger
$ ios-sim start --devicetypeid 'iPhone-7, 10.3'
$ ios-sim install --devicetypeid 'iPhone-7, 10.3' $DerivedData/$AppName/Build/Products/Debug-iphonesimulator/$AppName.app
$ ios-sim launch --devicetypeid 'iPhone-7, 10.3' $DerivedData/$AppName/Build/Products/Debug-iphonesimulator/$AppName.app
(lldb) continue
(lldb) process interrupt
(lldb) repl
1> import UIKit
2>
#!/bin/sh
PROJECT_ENV_DIR="${PROJECT_DIR:=`dirname $0`}"
source "${PROJECT_ENV_DIR:=$PWD}"/.env || true
osascript <<EOF
tell application "iTerm2"
set newWindow to (create window with default profile command "xcrun lldb -n \"$EXECUTABLE_NAME\" -w -- \"$CODESIGNING_FOLDER_PATH\"")
end tell
EOF
#!/bin/sh
export | sed '/UID=/d' | sort > `dirname "$0"`/.env
#!/bin/sh
"$PROJECT_DIR"/env.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment