SlideShare a Scribd company logo
Simulator
Simulator
Tips & Tricks
CLI, simctl
Testing
Demo
Simulator allows you to rapidly prototype and
test builds of your app during the development process.
Simulator customizing & testing for Xcode 9
open -a Simulator
open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/
open -a Simulator --args -CurrentDeviceUDID $UDID
Simulator customizing & testing for Xcode 9
Simulator customizing & testing for Xcode 9
Simulator customizing & testing for Xcode 9
Simulator customizing & testing for Xcode 9
sudo mkdir /AppleInternal
Allow Fullscreen Mode
Simulator customizing & testing for Xcode 9
Simulator customizing & testing for Xcode 9
Show Chrome UI Rects
Simulator customizing & testing for Xcode 9
Simulator customizing & testing for Xcode 9
Simulator customizing & testing for Xcode 9
Simulator customizing & testing for Xcode 9
Simulator customizing & testing for Xcode 9
Simulator customizing & testing for Xcode 9
Simulator customizing & testing for Xcode 9
$ xcrun simctl list
$ xcrun simctl list devicetypes
$ xcrun simctl list -j runtimes
$ xcrun simctl list devices | grep Booted
xcrun simctl list [-j | ——json] [devices|devicetypes|runtimes|pairs]
Simulator customizing & testing for Xcode 9
xcrun simctl delete <device> [… <device n>] | unavailable
$ xcrun simctl delete 1418D7BD-CD6E-4C8A-AF95-580680AD5B2A
Delete
$ cd /Library/Developer/CoreSimulator/Profiles/Runtimes
$ sudo rm -rf <iOS version>.simruntime
$ xcrun simctl delete unavailable
2.72 GB
Simulator customizing & testing for Xcode 9
$ xcrun simctl create 'Giftbott X'  <- name
com.apple.CoreSimulator.SimDeviceType.iPhone-X  <- device type id
com.apple.CoreSimulator.SimRuntime.iOS-11-1 <- runtime id
xcrun simctl create <name> <device type id> <runtime id>
Simulator customizing & testing for Xcode 9
$ xcrun simctl rename 9E7DEEE4-035D-4CBC-B468-61D4D62618E7 'mySimulator'
xcrun simctl rename <device> <name>
xcrun simctl clone <device> <new name>
$ xcrun simctl clone 9E7DEEE4-035D-4CBC-B468-61D4D62618E7 'iPhone SE clone'
$ xcrun simctl boot A08C8834-1547-4EBB-BD3E-06D3732830F7
xcrun simctl boot <device> [-disabledJob=<job>] [-disabledJob=<job>]
xcrun simctl shutdown <device> | all
Booted / Shutdown
$ xcrun simctl shutdown A08C8834-1547-4EBB-BD3E-06D3732830F7
$ xcrun simctl shutdown all
$ xcodebuild ~~~ —sdk iphonesimulator
$ xcrun simctl install booted [Build Path]/GiftbotSimulator.app
xcrun simctl install <device> <path>
xcrun simctl uninstall <device> <app identifier>
Uninstall
Install
$ xcrun simctl uninstall booted kr.giftbot.example.GiftbotSimulator
$ xcrun simctl launch booted kr.giftbot.example
$ xcrun simctl launch ——console booted kr.giftbot.example
$ xcrun simctl launch booted kr.giftbot.example -AppleLocale "en_US" 
-AppleLanguages "(ko)" -NSShowNonLocalizedStrings YES
$ xcrun simctl launch booted kr.giftbot.example -foo "['1', '2']" bar
xcrun simctl launch [-w | ——wait—for—debugger] [——console] [——stdout=<path>]
[——stderr=<path>] <device> <app identifier> [<argv 1> … <argv n>]
xcrun simctl terminate <device> <app identifier>
$ xcrun simctl terminate booted kr.giftbot.example
$ xcrun simctl erase A08C8834-1547-4EBB-BD3E-06D3732830F7
$ xcrun simctl erase all
// Unable to erase in Booted state
$ xcrun simctl shutdown <device> && xcrun simctl erase <device>
xcrun simctl erase <device> [… <device n>] | all
erase
screenshot [--type=<type>] [--display=<display>] <file or url>
$ xcrun simctl io booted screenshot ——type=jpeg image.jpeg
$ xcrun simctl io booted screenshot ——display=external image.png
recordVideo [--type=<type>] [--display=<display>] <file or url>
$ xcrun simctl io booted recordVideo ——type="mp4" SwiftKorea.mp4
$ xcrun simctl io 90D0D799-69BA-4800-8682-1533100CDD7B recordVideo sim.mp4
xcrun simctl io <device> <operation> <arguments>
$ xcrun simctl keyboard booted ko
$ xcrun simctl keyboard booted ja
xcrun simctl keyboard <device> <language>
Add
$ xcrun simctl openurl booted https://google.com/search?q=SwiftKorea
$ xcrun simctl openurl booted https://swiftkorea.github.io/meetup/2
xcrun simctl openurl <device> <URL>
xcrun simctl <addmedia | addphoto | addvideo> <device> <path> [… <path>]
$ xcrun simctl addmedia booted ~/image.jpeg
$ xcrun simctl addmedia booted ~/video.mp4 ~/image.png …
$ xcrun simctl addphoto booted ~/Desktop/image.jpeg
$ xcrun simctl addvideo booted ~/movie/video.mp4
addmedia
$ xcrun simctl listapps booted
$ xcrun simctl listapps booted | grep '"com.apple.*" = ' | grep -o '".*"'
$ xcrun simctl listapps booted | sed -n '1,/kr.giftbot/!p' | sed -n '1,14p'
xcrun simctl listapps <device>
$ xcrun simctl appinfo booted kr.giftbot.example.GiftbotSimulator
xcrun simctl appinfo <device> <bundle identifier>
$ xcrun simctl spawn booted log stream
$ xcrun simctl spawn booted log stream --type=activity 
--style=json —timeout=1m
$ xcrun simctl spawn booted log stream --predicate 'processID == 50854 and 
messageType == info'
$ xcrun simctl spawn booted log stream --predicate "eventMessage contains 
'Giftbot' and messageType == debug and eventType == logEvent"
$ xcrun simctl spawn booted log collect
xcrun simctl spawn [-w | --wait-for-debugger] [-s | --standalone] [-a <arch> |
--arch=<arch>] <device> <path to executable> [<argv 1> <argv 2> ... <argv n>]
bootstatus
darwinup
diagnose
get_app_container
getenv
icloud_sync
logverbose
monitor
notify_post
notify_get_state / notify_set_state
pair / unpair
pair_activate
pbinfo / pbsync
pbcopy / pbpaste
register / unregister
upgrade
Simulator customizing & testing for Xcode 9
$ xcrun simctl list devices
$ xcrun simctl list devices 
| sed -n '{ 1,/iOS 10/d; /iPhone 6s/p; }'
$ xcrun simctl list devices 
| sed -n '{ 1,/iOS 10/d; /iPhone 6s/p; }' 
| egrep -o '([A-Z0-9-]*){36}'
$ xcrun simctl list devices 
| sed -n '{ 1,/iOS 10/d; /iPhone 6s/p; }' 
| egrep -o '([A-Z0-9-]*){36}' 
| xargs -I udid xcrun simctl boot udid
Simulator customizing & testing for Xcode 9
$ xcrun simctl list devices 
| grep 'iPhone [8X]' 
| awk -F "[()]" '{ print $2 }' 
| xargs -I udid xcrun simctl shutdown udid
$ list=(`xcrun simctl list devices 
| awk '/iPhone/{ if ($2 > 7 && $2 != "SE") print $(NF-1) }' 
| cut -c 2-37`)
$ for udid in $list; do
xcrun simctl shutdown $udid
done
$ xcrun simctl list devices 
| grep -i 'iphone.*plus' 
| tail -n 4 
| grep -v Booted 
| awk -F "[()]" '{ print $2 }' 
| xargs -I udid xcrun simctl erase udid
$ xcrun simctl list devices 
| grep Shutdown 
| egrep -o '[A-Z0-9-]{36}' 
| tail -n 4 
| xargs -I udid xcrun simctl erase udid
Case 1. Localization
Case 4. Devices
Case 5. Network
Case 2. Arguments
Case 3. Configurations
Shutdown
List
Create / Clone
Boot
[ 1 ]
Shutdown
List
Create / Clone
Boot
Build
Install
Launch
Test
[ 1 ] [ 2 ]
Shutdown
List
Create / Clone
Boot
Build
Install
Launch
Test
Terminate
Shutdown
Erase / Delete
[ 1 ] [ 3 ][ 2 ]
Simulator customizing & testing for Xcode 9
[ Simulator 1 ] - English + Locale(US)
[ Simulator 2 ] - Korean
[ Simulator 3 ] - Japanese
[ Simulator 4 ] - Base + DoubleLocalizedString + RightToLeftWritingDirection
[ Simulator 1 ] - English + Locale(US)
[ Simulator 2 ] - Korean
[ Simulator 3 ] - Japanese
[ Simulator 4 ] - Base + DoubleLocalizedString + RightToLeftWritingDirection
$ xcrun simctl launch <device> <bundle id> [<argv 1> ...]
[ Simulator 1 ] - English + Locale(US)
[ Simulator 2 ] - Korean
[ Simulator 3 ] - Japanese
[ Simulator 4 ] - Base + DoubleLocalizedString + RightToLeftWritingDirection
$ xcrun simctl launch booted kr.giftbot.example [<argv 1> ...]
[ 1 ] -AppleLanguages "(en)" -AppleLocale "en_US"
[ 2 ] -AppleLanguages "(ko)"
[ 3 ] -AppleLanguages "(ja)"
[ 4 ] -NSDoubleLocalizedString YES -NSForceRightToLeftWritingDirection YES
Simulator customizing & testing for Xcode 9
$ xcrun simctl launch booted kr.giftbot.example foo bar -swift true
let args = ProcessInfo.processInfo.arguments
for (idx, arg) in args.enumerated() {
print("idx : (idx), argument : (arg)")
}
$ xcrun simctl launch booted kr.giftbot.example foo bar -swift true
let args = ProcessInfo.processInfo.arguments
for (idx, arg) in args.enumerated() {
print("idx : (idx), argument : (arg)")
}
$ xcrun simctl launch booted kr.giftbot.example foo bar -swift true
idx : 0, argument : <appPath>/<scheme>
idx : 1, argument : foo
idx : 2, argument : bar
idx : 3, argument : -swift
idx : 4, argument : true
-Argument => UserDefaults
let isSwift = UserDefaults.standard.bool(forKey: "swift")
print(isSwift) // true
-Argument => UserDefaults
let isSwift = UserDefaults.standard.bool(forKey: "swift")
print(isSwift) // true
-arr "( 'Swift', 'Korea', 'Giftbot', 'Simulator Customizing & Testing' )"
-dict "{ 'Swift'='Korea'; '2nd'='Meetup'; 'Hi'='Nice to meet you'; }"
-xml "<dict><key>foo</key><string>bar</string></dict>"
let arrArg = UserDefaults.standard.array(forKey: "arr")
let dictArg = UserDefaults.standard.dictionary(forKey: “dict")
let xmlArg = UserDefaults.standard.object(forKey: "xml")
Simulator customizing & testing for Xcode 9
Simulator customizing & testing for Xcode 9
Simulator customizing & testing for Xcode 9
Simulator customizing & testing for Xcode 9
$ xcodebuild
-project <project path>
—scheme <scheme>
-sdk iphonesimulator
-configuration < Debug / Beta / Release >
$ xcodebuild
-project [projectPath]
—scheme [scheme]
-sdk iphonesimulator
-configuration [ Debug / Beta / Release ]
$ xcrun simctl install booted 
[Build Path]/Build/[Configuration]-iphonesimulator/[App Name].app
$ xcodebuild
-project <project path>
—scheme <scheme>
-sdk iphonesimulator
-configuration < Debug / Beta / Release >
$ xcrun simctl install booted 
[Build Path]/Build/<configuration>-iphonesimulator/<app name>.app
$ xcodebuild
-project <project path>
—scheme <scheme>
-sdk iphonesimulator
-configuration < Debug / Beta / Release >
$ xcrun simctl install booted 
[Build Path]/Build/<configuration>-iphonesimulator/<app name>.app
$ xcrun simctl launch <device> <bundle identifier>
Simulator customizing & testing for Xcode 9
xcrun simctl list devices | egrep ~ blah blah ~
Simulator customizing & testing for Xcode 9
Simulator customizing & testing for Xcode 9
Simulator customizing & testing for Xcode 9
Simulator customizing & testing for Xcode 9
Simulator customizing & testing for Xcode 9
Simulator customizing & testing for Xcode 9
Simulator customizing & testing for Xcode 9
Simulator customizing & testing for Xcode 9
Simulator customizing & testing for Xcode 9

More Related Content

PDF
스위프트를 여행하는 히치하이커를 위한 스타일 안내
PDF
Letswift18 워크숍#1 스위프트 클린코드와 코드리뷰
PPTX
Fact, Fiction, and FP
PDF
JavaScript and the AST
PPTX
PDF
Unbreakable: The Craft of Code
PDF
"let ECMAScript = 6"
ODP
ES6 PPT FOR 2016
스위프트를 여행하는 히치하이커를 위한 스타일 안내
Letswift18 워크숍#1 스위프트 클린코드와 코드리뷰
Fact, Fiction, and FP
JavaScript and the AST
Unbreakable: The Craft of Code
"let ECMAScript = 6"
ES6 PPT FOR 2016

What's hot (20)

PDF
async/await Revisited
PDF
Writing Your App Swiftly
PDF
AST Rewriting Using recast and esprima
PDF
Workshop 5: JavaScript testing
PDF
Your code is not a string
PDF
Workshop 10: ECMAScript 6
PDF
Letswift19-clean-architecture
PDF
Essentials and Impactful Features of ES6
PDF
Php unit the-mostunknownparts
PDF
Writing Clean Code in Swift
PDF
international PHP2011_Bastian Feder_jQuery's Secrets
PDF
An Introduction to the World of Testing for Front-End Developers
PDF
FITC Web Unleashed 2017 - Introduction to the World of Testing for Front-End ...
PDF
Capability Driven Design - Andrzej Jóźwiak - TomTom Dev Day 2021
PDF
C++ Programming - 12th Study
PDF
The jQuery Divide
PDF
C++ Programming - 9th Study
PPTX
Groovy puzzlers jug-moscow-part 2
KEY
Object-Oriented Javascript
async/await Revisited
Writing Your App Swiftly
AST Rewriting Using recast and esprima
Workshop 5: JavaScript testing
Your code is not a string
Workshop 10: ECMAScript 6
Letswift19-clean-architecture
Essentials and Impactful Features of ES6
Php unit the-mostunknownparts
Writing Clean Code in Swift
international PHP2011_Bastian Feder_jQuery's Secrets
An Introduction to the World of Testing for Front-End Developers
FITC Web Unleashed 2017 - Introduction to the World of Testing for Front-End ...
Capability Driven Design - Andrzej Jóźwiak - TomTom Dev Day 2021
C++ Programming - 12th Study
The jQuery Divide
C++ Programming - 9th Study
Groovy puzzlers jug-moscow-part 2
Object-Oriented Javascript
Ad

Similar to Simulator customizing & testing for Xcode 9 (14)

PDF
Hacking iOS Simulator: writing your own plugins for Simulator
PDF
Remote iOS Devices Server – Scaling iOS
PDF
Ci for i-os-codemash-01.2013
PDF
Alexander Dodatko «Continuous integration for iOS applications»
PDF
MPD2011 | Александр Додатко "Процесс непрерывной интеграции для iOS проектов"
PDF
Installing iOS and Android Simulators on MacOSX
KEY
iOSDevCamp 2011 - Getting "Test"-y: Test Driven Development & Automated Deplo...
PDF
Working with the AOSP - Linaro Connect Asia 2013
PDF
Owasp orlando, april 13, 2016
PDF
iOS Automation Primitives
PDF
iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (...
PDF
2011 py con
PDF
2012 java one-con3648
PDF
Embedded Android
Hacking iOS Simulator: writing your own plugins for Simulator
Remote iOS Devices Server – Scaling iOS
Ci for i-os-codemash-01.2013
Alexander Dodatko «Continuous integration for iOS applications»
MPD2011 | Александр Додатко "Процесс непрерывной интеграции для iOS проектов"
Installing iOS and Android Simulators on MacOSX
iOSDevCamp 2011 - Getting "Test"-y: Test Driven Development & Automated Deplo...
Working with the AOSP - Linaro Connect Asia 2013
Owasp orlando, april 13, 2016
iOS Automation Primitives
iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (...
2011 py con
2012 java one-con3648
Embedded Android
Ad

More from Bongwon Lee (8)

PDF
DeprecatedAPI로 알아보는 SwiftUI
PDF
Swift in SwiftUI
PDF
App Lifecycle
PDF
GraphQL over REST
PDF
The Sandbox Container Directory
PDF
LetSwift 2017 - ARKit
PDF
Realm, Mobile Database
PDF
Custom Xcode Template (with VIPER)
DeprecatedAPI로 알아보는 SwiftUI
Swift in SwiftUI
App Lifecycle
GraphQL over REST
The Sandbox Container Directory
LetSwift 2017 - ARKit
Realm, Mobile Database
Custom Xcode Template (with VIPER)

Recently uploaded (6)

DOC
Camb毕业证学历认证,格罗斯泰斯特主教大学毕业证仿冒文凭毕业证
DOC
证书学历UoA毕业证,澳大利亚中汇学院毕业证国外大学毕业证
PDF
6-UseCfgfhgfhgfhgfhgfhfhhaseActivity.pdf
PDF
Lesson 13- HEREDITY _ pedSAWEREGFVCXZDSASEWFigree.pdf
PPTX
ASMS Telecommunication company Profile
PDF
heheheueueyeyeyegehehehhehshMedia-Literacy.pdf
Camb毕业证学历认证,格罗斯泰斯特主教大学毕业证仿冒文凭毕业证
证书学历UoA毕业证,澳大利亚中汇学院毕业证国外大学毕业证
6-UseCfgfhgfhgfhgfhgfhfhhaseActivity.pdf
Lesson 13- HEREDITY _ pedSAWEREGFVCXZDSASEWFigree.pdf
ASMS Telecommunication company Profile
heheheueueyeyeyegehehehhehshMedia-Literacy.pdf

Simulator customizing & testing for Xcode 9

  • 2. Simulator Tips & Tricks CLI, simctl Testing Demo
  • 3. Simulator allows you to rapidly prototype and test builds of your app during the development process.
  • 5. open -a Simulator open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/ open -a Simulator --args -CurrentDeviceUDID $UDID
  • 14. Show Chrome UI Rects
  • 22. $ xcrun simctl list $ xcrun simctl list devicetypes $ xcrun simctl list -j runtimes $ xcrun simctl list devices | grep Booted xcrun simctl list [-j | ——json] [devices|devicetypes|runtimes|pairs]
  • 24. xcrun simctl delete <device> [… <device n>] | unavailable $ xcrun simctl delete 1418D7BD-CD6E-4C8A-AF95-580680AD5B2A Delete
  • 25. $ cd /Library/Developer/CoreSimulator/Profiles/Runtimes $ sudo rm -rf <iOS version>.simruntime
  • 26. $ xcrun simctl delete unavailable 2.72 GB
  • 28. $ xcrun simctl create 'Giftbott X' <- name com.apple.CoreSimulator.SimDeviceType.iPhone-X <- device type id com.apple.CoreSimulator.SimRuntime.iOS-11-1 <- runtime id xcrun simctl create <name> <device type id> <runtime id>
  • 30. $ xcrun simctl rename 9E7DEEE4-035D-4CBC-B468-61D4D62618E7 'mySimulator' xcrun simctl rename <device> <name> xcrun simctl clone <device> <new name> $ xcrun simctl clone 9E7DEEE4-035D-4CBC-B468-61D4D62618E7 'iPhone SE clone'
  • 31. $ xcrun simctl boot A08C8834-1547-4EBB-BD3E-06D3732830F7 xcrun simctl boot <device> [-disabledJob=<job>] [-disabledJob=<job>] xcrun simctl shutdown <device> | all Booted / Shutdown $ xcrun simctl shutdown A08C8834-1547-4EBB-BD3E-06D3732830F7 $ xcrun simctl shutdown all
  • 32. $ xcodebuild ~~~ —sdk iphonesimulator $ xcrun simctl install booted [Build Path]/GiftbotSimulator.app xcrun simctl install <device> <path> xcrun simctl uninstall <device> <app identifier> Uninstall Install $ xcrun simctl uninstall booted kr.giftbot.example.GiftbotSimulator
  • 33. $ xcrun simctl launch booted kr.giftbot.example $ xcrun simctl launch ——console booted kr.giftbot.example $ xcrun simctl launch booted kr.giftbot.example -AppleLocale "en_US" -AppleLanguages "(ko)" -NSShowNonLocalizedStrings YES $ xcrun simctl launch booted kr.giftbot.example -foo "['1', '2']" bar xcrun simctl launch [-w | ——wait—for—debugger] [——console] [——stdout=<path>] [——stderr=<path>] <device> <app identifier> [<argv 1> … <argv n>] xcrun simctl terminate <device> <app identifier> $ xcrun simctl terminate booted kr.giftbot.example
  • 34. $ xcrun simctl erase A08C8834-1547-4EBB-BD3E-06D3732830F7 $ xcrun simctl erase all // Unable to erase in Booted state $ xcrun simctl shutdown <device> && xcrun simctl erase <device> xcrun simctl erase <device> [… <device n>] | all erase
  • 35. screenshot [--type=<type>] [--display=<display>] <file or url> $ xcrun simctl io booted screenshot ——type=jpeg image.jpeg $ xcrun simctl io booted screenshot ——display=external image.png recordVideo [--type=<type>] [--display=<display>] <file or url> $ xcrun simctl io booted recordVideo ——type="mp4" SwiftKorea.mp4 $ xcrun simctl io 90D0D799-69BA-4800-8682-1533100CDD7B recordVideo sim.mp4 xcrun simctl io <device> <operation> <arguments>
  • 36. $ xcrun simctl keyboard booted ko $ xcrun simctl keyboard booted ja xcrun simctl keyboard <device> <language> Add
  • 37. $ xcrun simctl openurl booted https://google.com/search?q=SwiftKorea $ xcrun simctl openurl booted https://swiftkorea.github.io/meetup/2 xcrun simctl openurl <device> <URL>
  • 38. xcrun simctl <addmedia | addphoto | addvideo> <device> <path> [… <path>] $ xcrun simctl addmedia booted ~/image.jpeg $ xcrun simctl addmedia booted ~/video.mp4 ~/image.png … $ xcrun simctl addphoto booted ~/Desktop/image.jpeg $ xcrun simctl addvideo booted ~/movie/video.mp4 addmedia
  • 39. $ xcrun simctl listapps booted $ xcrun simctl listapps booted | grep '"com.apple.*" = ' | grep -o '".*"' $ xcrun simctl listapps booted | sed -n '1,/kr.giftbot/!p' | sed -n '1,14p' xcrun simctl listapps <device>
  • 40. $ xcrun simctl appinfo booted kr.giftbot.example.GiftbotSimulator xcrun simctl appinfo <device> <bundle identifier>
  • 41. $ xcrun simctl spawn booted log stream $ xcrun simctl spawn booted log stream --type=activity --style=json —timeout=1m $ xcrun simctl spawn booted log stream --predicate 'processID == 50854 and messageType == info' $ xcrun simctl spawn booted log stream --predicate "eventMessage contains 'Giftbot' and messageType == debug and eventType == logEvent" $ xcrun simctl spawn booted log collect xcrun simctl spawn [-w | --wait-for-debugger] [-s | --standalone] [-a <arch> | --arch=<arch>] <device> <path to executable> [<argv 1> <argv 2> ... <argv n>]
  • 44. $ xcrun simctl list devices
  • 45. $ xcrun simctl list devices | sed -n '{ 1,/iOS 10/d; /iPhone 6s/p; }'
  • 46. $ xcrun simctl list devices | sed -n '{ 1,/iOS 10/d; /iPhone 6s/p; }' | egrep -o '([A-Z0-9-]*){36}'
  • 47. $ xcrun simctl list devices | sed -n '{ 1,/iOS 10/d; /iPhone 6s/p; }' | egrep -o '([A-Z0-9-]*){36}' | xargs -I udid xcrun simctl boot udid
  • 49. $ xcrun simctl list devices | grep 'iPhone [8X]' | awk -F "[()]" '{ print $2 }' | xargs -I udid xcrun simctl shutdown udid $ list=(`xcrun simctl list devices | awk '/iPhone/{ if ($2 > 7 && $2 != "SE") print $(NF-1) }' | cut -c 2-37`) $ for udid in $list; do xcrun simctl shutdown $udid done
  • 50. $ xcrun simctl list devices | grep -i 'iphone.*plus' | tail -n 4 | grep -v Booted | awk -F "[()]" '{ print $2 }' | xargs -I udid xcrun simctl erase udid $ xcrun simctl list devices | grep Shutdown | egrep -o '[A-Z0-9-]{36}' | tail -n 4 | xargs -I udid xcrun simctl erase udid
  • 51. Case 1. Localization Case 4. Devices Case 5. Network Case 2. Arguments Case 3. Configurations
  • 56. [ Simulator 1 ] - English + Locale(US) [ Simulator 2 ] - Korean [ Simulator 3 ] - Japanese [ Simulator 4 ] - Base + DoubleLocalizedString + RightToLeftWritingDirection
  • 57. [ Simulator 1 ] - English + Locale(US) [ Simulator 2 ] - Korean [ Simulator 3 ] - Japanese [ Simulator 4 ] - Base + DoubleLocalizedString + RightToLeftWritingDirection $ xcrun simctl launch <device> <bundle id> [<argv 1> ...]
  • 58. [ Simulator 1 ] - English + Locale(US) [ Simulator 2 ] - Korean [ Simulator 3 ] - Japanese [ Simulator 4 ] - Base + DoubleLocalizedString + RightToLeftWritingDirection $ xcrun simctl launch booted kr.giftbot.example [<argv 1> ...] [ 1 ] -AppleLanguages "(en)" -AppleLocale "en_US" [ 2 ] -AppleLanguages "(ko)" [ 3 ] -AppleLanguages "(ja)" [ 4 ] -NSDoubleLocalizedString YES -NSForceRightToLeftWritingDirection YES
  • 60. $ xcrun simctl launch booted kr.giftbot.example foo bar -swift true
  • 61. let args = ProcessInfo.processInfo.arguments for (idx, arg) in args.enumerated() { print("idx : (idx), argument : (arg)") } $ xcrun simctl launch booted kr.giftbot.example foo bar -swift true
  • 62. let args = ProcessInfo.processInfo.arguments for (idx, arg) in args.enumerated() { print("idx : (idx), argument : (arg)") } $ xcrun simctl launch booted kr.giftbot.example foo bar -swift true idx : 0, argument : <appPath>/<scheme> idx : 1, argument : foo idx : 2, argument : bar idx : 3, argument : -swift idx : 4, argument : true
  • 63. -Argument => UserDefaults let isSwift = UserDefaults.standard.bool(forKey: "swift") print(isSwift) // true
  • 64. -Argument => UserDefaults let isSwift = UserDefaults.standard.bool(forKey: "swift") print(isSwift) // true -arr "( 'Swift', 'Korea', 'Giftbot', 'Simulator Customizing & Testing' )" -dict "{ 'Swift'='Korea'; '2nd'='Meetup'; 'Hi'='Nice to meet you'; }" -xml "<dict><key>foo</key><string>bar</string></dict>" let arrArg = UserDefaults.standard.array(forKey: "arr") let dictArg = UserDefaults.standard.dictionary(forKey: “dict") let xmlArg = UserDefaults.standard.object(forKey: "xml")
  • 69. $ xcodebuild -project <project path> —scheme <scheme> -sdk iphonesimulator -configuration < Debug / Beta / Release >
  • 70. $ xcodebuild -project [projectPath] —scheme [scheme] -sdk iphonesimulator -configuration [ Debug / Beta / Release ] $ xcrun simctl install booted [Build Path]/Build/[Configuration]-iphonesimulator/[App Name].app $ xcodebuild -project <project path> —scheme <scheme> -sdk iphonesimulator -configuration < Debug / Beta / Release > $ xcrun simctl install booted [Build Path]/Build/<configuration>-iphonesimulator/<app name>.app
  • 71. $ xcodebuild -project <project path> —scheme <scheme> -sdk iphonesimulator -configuration < Debug / Beta / Release > $ xcrun simctl install booted [Build Path]/Build/<configuration>-iphonesimulator/<app name>.app $ xcrun simctl launch <device> <bundle identifier>
  • 73. xcrun simctl list devices | egrep ~ blah blah ~