你好,歡迎來到IOS教程網

 Ios教程網 >> IOS編程開發 >> IOS開發綜合 >> 寫給iOS法式員的敕令行應用秘笈

寫給iOS法式員的敕令行應用秘笈

編輯:IOS開發綜合

Mac OS是Unix體系的分支,有著壯大的敕令行功效。許多工作在敕令行下處置會事半功倍,所以我就IOS法式員能夠會用到的功效講述一下。

終端設置

Mac的終端有一個很症結的設置裝備擺設,就是“應用 Option 鍵作為 Meta 鍵”。勾上這個選項以後,便可以應用Emacs的編纂敕令了。

我發明有些人的終端沒有設置“膩滑文本”,招致終端上的文字很好看。趕忙把這個選項勾上吧。

經常使用的幾個快捷鍵以下。

control+a,跳到敕令行開端地位;control+e,跳到敕令行開頭地位。
option+f,向後跳一個word;option+b,向前跳一個word。
option+d,向後刪除一個word;option+delete,向前刪除一個word。
control+_,撤消之前一次編纂操作。
control+k,刪除到行尾;control+u,刪除到行首。

終端色彩高亮也不錯,看起來感到會更有感到。好比ls可以看到目次會是藍色的,通俗文件是白色的,可履行法式會是綠色的。

homebrew

homebrew是一個異常有效擔保理對象,經由過程homebrew可以裝置更多有效的unix對象,好比wget、tree等等。

裝置

今朝最好的裝置方法都是上面如許的,一句敕令弄定。

Ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

應用

[~]$ brew install tree
==> Downloading http://mama.indstate.edu/users/ice/tree/src/tree-1.7.0.tgz
Already downloaded: /Library/Caches/Homebrew/tree-1.7.0.tgz
==> make prefix=/usr/local/Cellar/tree/1.7.0 MANDIR=/usr/local/Cellar/tree/1.7.0/share/man/man1 CC=clang CFLAGS=-fomit-frame-pointer LD
/usr/local/Cellar/tree/1.7.0: 7 files, 128K, built in 2 seconds

tree這個對象看目次的內容異常直不雅悅目。

[~/ilaiwang/LWShareTo]$ tree
.
├── LWShareTo
│  ├── LWShareContent.h
│  ├── LWShareContent.m
│  ├── LWShareTo-Prefix.pch
│  ├── LWShareTo.h
│  ├── LWShareTo.m
│  ├── LWShareToMacro.h
│  ├── LWShareToUtils.h
│  ├── LWShareToUtils.m
│  ├── ShareModule
│  │  ├── LWShareChannelService.h
│  │  ├── LWShareChannelService.m
│  │  ├── LWShareToBaseClass.h
│  │  ├── LWShareToBaseClass.m
│  │  ├── LWShareToClipboard.h
│  │  ├── LWShareToClipboard.m
│  │  ├── LWShareToDouban.h
│  │  ├── LWShareToDouban.m
│  │  ├── LWShareToInside.h
│  │  ├── LWShareToInside.m
│  │  ├── LWShareToLWFeed.h
│  │  ├── LWShareToLWFeed.m
│  │  ├── LWShareToLWSession.h
│  │  ├── LWShareToLWSession.m
│  │  ├── LWShareToOutside.h
│  │  ├── LWShareToOutside.m
│  │  ├── LWShareToQQSession.h
│  │  ├── LWShareToQQSession.m
│  │  ├── LWShareToQQZone.h
│  │  ├── LWShareToQQZone.m
│  │  ├── LWShareToRenren.h
│  │  ├── LWShareToRenren.m
│  │  ├── LWShareToSinaWeibo.h
│  │  ├── LWShareToSinaWeibo.m
│  │  ├── LWShareToTencentWeibo.h
│  │  ├── LWShareToTencentWeibo.m
│  │  ├── LWShareToWechatSession.h
│  │  ├── LWShareToWechatSession.m
│  │  ├── LWShareToWechatTimeline.h
│  │  └── LWShareToWechatTimeline.m
│  ├── WebviewRender.h
│  └── WebviewRender.m
├── LWShareTo.xcodeproj
│  └── project.pbxproj
└── LWShareToTests
  ├── LWShareToTests-Info.plist
  ├── LWShareToTests.m
  └── en.lproj
    └── InfoPlist.strings

5 directories, 44 files

shell

GNU Coreutils包括了各類GNU好用的對象。依據我的不雅察,我發明Mac預裝了Coreutils,只是版本比擬低,建議本身裝置一下,否者sort連”-h”參數都沒有。

Xcode圖形化操作挺好用的,不外曉得一些敕令行的操作會更佳。鄙人面這個處所看到Xcode編譯的具體進程。

假如在編譯的時刻碰到鏈接毛病,在敕令行下檢討一下就異常有需要了。上面這個敕令就是鏈接生成交往二進制法式的,可以拷貝到終端外面運轉。假如鏈接失足誤了,可以細心檢討一下這個敕令。

Ld /Users/henshao/Library/Developer/Xcode/DerivedData/Laiwang-fxscnxkslrypubbeazdfkveysldy/Build/Products/Debug-iphoneos/Laiwang.app/Laiwang normal arm64
  cd /Users/henshao/ilaiwang/LaiwangV3
  export IPHONEOS_DEPLOYMENT_TARGET=6.0
  export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
  /Applications/Xcode.app/Contents/Developer/Toolchains/Xcodedefault.xctoolchain/usr/bin/clang++ -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk -L/Users/henshao/Library/Developer/Xcode/DerivedData/Laiwang-fxscnxkslrypubbeazdfkveysldy/Build/Products/Debug-iphoneos -L/Users/henshao/ilaiwang/LaiwangV3/../Pods/LWComponentKits/LWComponentKits/AMAP/liboffset -L/Users/henshao/ilaiwang/LaiwangV3/../Pods/LWXiamiMusic/Output -L/Users/henshao/ilaiwang/LaiwangV3/../Pods/QupaiSDK/libQupaiSDK -L/Users/henshao/ilaiwang/LaiwangV3/../Pods/VoIPSDK/SDK/lib -F/Users/henshao/Library/Developer/Xcode/DerivedData/Laiwang-fxscnxkslrypubbeazdfkveysldy/Build/Products/Debug-iphoneos -F/Users/henshao/ilaiwang/LaiwangV3/../Pods/AMap3DMap -F/Users/henshao/ilaiwang/LaiwangV3/../Pods/AMapSearch -F/Users/henshao/ilaiwang/LaiwangV3/../Pods/DevicePrint -F/Users/henshao/ilaiwang/LaiwangV3/../Pods/TBSecuritySDK -F/Users/henshao/ilaiwang/LaiwangV3/../Pods/SecurityGuardSDK -F/Users/henshao/ilaiwang/LaiwangV3/../Pods/UserTrack -F/Users/henshao/ilaiwang/LaiwangV3/../Pods/plcrashReporter/IOS\ Framework -F/Users/henshao/ilaiwang/LaiwangV3/../Pods/MtopSDK -F/Users/henshao/ilaiwang/LaiwangV3/../Pods/SpeechRecognizer -F/Users/henshao/ilaiwang/LaiwangV3/../Pods/TBScanLib -F/Users/henshao/ilaiwang/LaiwangV3/../Pods/TBShortURL -F/Users/henshao/ilaiwang/LaiwangV3 -F/Users/henshao/ilaiwang/LaiwangV3/../Pods/TencentOpenApiSDK/64Bit -F/Users/henshao/ilaiwang/LaiwangV3/../Pods/huoyanSDK_laiwang -F/Users/henshao/ilaiwang/LaiwangV3/../Pods/mtopext -F/Users/henshao/ilaiwang/LaiwangV3/Laiwang/LWUIKits/AlipaySDK_2 -F. -FLaiwang -FLaiwangShare -FLaiwangTests -FLaiwang/BaseFrame -FLaiwang/BaseLogic -FLaiwang/Cache -FLaiwang/DataProvider -FLaiwang/DataSource -FLaiwang/DevTools -FLaiwang/H5_Slider_local -FLaiwang/Init -FLaiwang/Integration -FLaiwang/LWSafeMode -FLaiwang/LWUIKits -FLaiwang/PageViews -FLaiwang/SDK -FLaiwang/Sounds -FLaiwang/TestUtility -FLaiwang/UserControls -FLaiwang/Utils -FLaiwangTests/LWServiceTests -FLaiwangTests/Other -FLaiwang/BaseFrame/LWController -FLaiwang/BaseFrame/LWUISDK -FLaiwang/BaseFrame/URLCoordinator -FLaiwang/Cache/LWDataCache -FLaiwang/Cache/LWDB -FLaiwang/Cache/LWDBModel -FLaiwang/H5_Slider_local/app.slide -FLaiwang/Integration/LWService -FLaiwang/Integration/LWServiceTests -FLaiwang/LWUIKits/AlipaySDK_2 -FLaiwang/LWUIKits/LWAlbumPhotoPreview -FLaiwang/LWUIKits/LWCameraCaptureView -FLaiwang/LWUIKits/LWMovieView -FLaiwang/LWUIKits/MMDrawerController -FLaiwang/LWUIKits/TableViewCell -FLaiwang/PageViews/AlbumPage -FLaiwang/PageViews/ChatPage -FLaiwang/PageViews/DiscoveryExPage -FLaiwang/PageViews/EmotionBoxPage -FLaiwang/PageViews/EventPage -FLaiwang/PageViews/FeedPage -FLaiwang/PageViews/FriendPage -FLaiwang/PageViews/FriendRadarPage -FLaiwang/PageViews/IntroducePage -FLaiwang/PageViews/KnockPage -FLaiwang/PageViews/LoginPage -FLaiwang/PageViews/MinePage -FLaiwang/PageViews/MorePage -FLaiwang/PageViews/MoviePage -FLaiwang/PageViews/MusicPage -FLaiwang/PageViews/NearByPage -FLaiwang/PageViews/NewGuidePage -FLaiwang/PageViews/NotificationPage -FLaiwang/PageViews/OAuthPage -FLaiwang/PageViews/PhotoEditorPage -FLaiwang/PageViews/PhotoFilterPage -FLaiwang/PageViews/PostPage -FLaiwang/PageViews/PubAccountPage -FLaiwang/PageViews/SearchPage -FLaiwang/PageViews/SharedPage -FLaiwang/PageViews/ShareMsgPage -FLaiwang/PageViews/XiamiPage -FLaiwang/SDK/EggShell -FLaiwang/SDK/InternalSDK -FLaiwang/SDK/LWFileUploadManager -FLaiwang/SDK/LWHostService -FLaiwang/SDK/LWShareTo -FLaiwang/SDK/SSOApiEngine -FLaiwang/SDK/ViewModels -FLaiwang/SDK/VOIP -FLaiwang/Sounds/asr -FLaiwang/Sounds/radar -FLaiwang/TestUtility/APNSTest -FLaiwang/TestUtility/TimeCounter -FLaiwang/UserControls/BigImageControl -FLaiwang/UserControls/LWAsrBoard -FLaiwang/UserControls/LWAvatarView -FLaiwang/UserControls/LWBrowserViewController -FLaiwang/UserControls/LWCloudAudioPlayerBox -FLaiwang/UserControls/LWCustomUI -FLaiwang/UserControls/LWEasyInputView -FLaiwang/UserControls/LWEmotionView -FLaiwang/UserControls/LWLocationDirectionView -FLaiwang/UserControls/LWLocationDisplayView -FLaiwang/UserControls/LWNativeBridgeWebView -FLaiwang/UserControls/LWObjSelectControl -FLaiwang/UserControls/LWPicker -FLaiwang/UserControls/LWPictureViewer -FLaiwang/UserControls/LWProgressView -FLaiwang/UserControls/LWRichTextContentView -FLaiwang/UserControls/LWScrollTabBar -FLaiwang/UserControls/LWSettingsItem -FLaiwang/UserControls/LWTextZoomView -FLaiwang/UserControls/LWToastView -FLaiwang/UserControls/LWVoiceWidget -FLaiwang/UserControls/LWVoipView -FLaiwang/UserControls/LWWebImageView -FLaiwang/UserControls/LWWebViewController -FLaiwang/UserControls/LWXiamiBar -FLaiwang/UserControls/QBImagePicker -FLaiwang/Utils/ABContact -FLaiwang/Utils/ALAssetsLibrary-CustomPhotoAlbum -FLaiwang/Utils/ASR -FLaiwang/Utils/AWActionSheet -FLaiwang/Utils/Category -FLaiwang/Utils/CompatibleUtil -FLaiwang/Utils/GDataXmlRss/ target=_blank class=infotextkey>XmlNode -FLaiwang/Utils/Huoyan -FLaiwang/Utils/ImageDownloader -FLaiwang/Utils/LWAppURLNavigator -FLaiwang/Utils/LWBizSearch -FLaiwang/Utils/LWDataStore -FLaiwang/Utils/LWFav -FLaiwang/Utils/LWLocalPageURLRouter -FLaiwang/Utils/LWLocationManager -FLaiwang/Utils/LWMusic -FLaiwang/Utils/LWPushDispatcher -FLaiwang/Utils/LWStatistics -FLaiwang/Utils/NSStringAdditions -FLaiwang/Utils/OffLineSendUtil -FLaiwang/Utils/QupaiSDK -FLaiwang/Utils/SDWebImage -FLaiwang/Utils/SoundEffect -FLaiwang/Utils/UIImageAdditions -FLaiwang/Utils/UIImagePickerControllerAdditions -FLaiwang/Utils/UT -FLaiwang/BaseFrame/LWController/LWTabBarController -FLaiwang/H5_Slider_local/app.slide/css -FLaiwang/H5_Slider_local/app.slide/images -FLaiwang/H5_Slider_local/app.slide/js -FLaiwang/Integration/LWService/IOS -FLaiwang/Integration/LWServiceTests/LWPackTests -FLaiwang/Integration/LWServiceTests/LWServiceTests -FLaiwang/LWUIKits/AlipaySDK_2/AlipaySDK.bundle -FLaiwang/PageViews/AlbumPage/Cells -FLaiwang/PageViews/AlbumPage/UserControls -FLaiwang/PageViews/ChatPage/BubbleDay -FLaiwang/PageViews/ChatPage/Cells -FLaiwang/PageViews/ChatPage/MessageSender -FLaiwang/PageViews/ChatPage/MomoChat -FLaiwang/PageViews/ChatPage/UserControls -FLaiwang/PageViews/EventPage/EventCommon -FLaiwang/PageViews/EventPage/EventCreate -FLaiwang/PageViews/EventPage/EventDeprecated -FLaiwang/PageViews/EventPage/EventList -FLaiwang/PageViews/EventPage/EventLottery -FLaiwang/PageViews/EventPage/EventMain -FLaiwang/PageViews/EventPage/EventNotification -FLaiwang/PageViews/EventPage/EventPostDetail -FLaiwang/PageViews/EventPage/EventRecent -FLaiwang/PageViews/EventPage/EventRecommend -FLaiwang/PageViews/EventPage/EventSearch -FLaiwang/PageViews/EventPage/EventSetting -FLaiwang/PageViews/EventPage/EventWall -FLaiwang/PageViews/EventPage/EventZan -FLaiwang/PageViews/EventPage/PubEventRecent -FLaiwang/PageViews/FeedPage/Cells -FLaiwang/PageViews/FeedPage/UserControls -FLaiwang/PageViews/FriendPage/Cells -FLaiwang/PageViews/FriendPage/UserControls -FLaiwang/PageViews/FriendRadarPage/PSCollectionView -FLaiwang/PageViews/FriendRadarPage/PulsingHalo -FLaiwang/PageViews/FriendRadarPage/RNBlurModalView -FLaiwang/PageViews/KnockPage/Answer -FLaiwang/PageViews/KnockPage/Browse -FLaiwang/PageViews/KnockPage/KnockList -FLaiwang/PageViews/KnockPage/SetQuestion -FLaiwang/PageViews/KnockPage/Setting -FLaiwang/PageViews/KnockPage/Statistic -FLaiwang/PageViews/KnockPage/UserControls -FLaiwang/PageViews/KnockPage/VoiceCard -FLaiwang/PageViews/MinePage/UserControls -FLaiwang/PageViews/MorePage/Cells -FLaiwang/PageViews/NotificationPage/Cells -FLaiwang/PageViews/NotificationPage/UserControls -FLaiwang/PageViews/PhotoEditorPage/DataProvider -FLaiwang/PageViews/PhotoEditorPage/DBModel -FLaiwang/PageViews/PhotoEditorPage/UserControls -FLaiwang/PageViews/PostPage/cells -FLaiwang/PageViews/PostPage/UserControls -FLaiwang/PageViews/PubAccountPage/Cells -FLaiwang/PageViews/PubAccountPage/PubToolBar -FLaiwang/PageViews/PubAccountPage/UserControls -FLaiwang/PageViews/SearchPage/SearchCell -FLaiwang/PageViews/SearchPage/SearchCellModel -FLaiwang/PageViews/SearchPage/SearchMsgListPage -FLaiwang/PageViews/SharedPage/Cells -FLaiwang/PageViews/SharedPage/UserControls -FLaiwang/PageViews/ShareMsgPage/UserControls -FLaiwang/SDK/InternalSDK/InternalModel -FLaiwang/SDK/InternalSDK/InternalService -FLaiwang/SDK/LWFileUploadManager/LWProgressObserverCenter -FLaiwang/SDK/LWHostService/BizTasks -FLaiwang/SDK/LWHostService/Utils -FLaiwang/SDK/LWShareTo/ShareModule -FLaiwang/SDK/LWShareTo/ShareRes -FLaiwang/SDK/LWShareTo/ShareService -FLaiwang/SDK/ViewModels/Friends -FLaiwang/SDK/ViewModels/Knock -FLaiwang/SDK/ViewModels/Others -FLaiwang/UserControls/LWProgressView/DACircularProgress -FLaiwang/UserControls/QBImagePicker/LWQBImagePicker+External -FLaiwang/Utils/LWFav/core -FLaiwang/Utils/LWFav/Images -FLaiwang/Utils/LWFav/libs -FLaiwang/Utils/LWFav/UI -FLaiwang/Utils/LWMusic/XiamiSDK -FLaiwang/Utils/NSStringAdditions/NSString_HTML -FLaiwang/Utils/UT/SinaWeibo.bundle -FLaiwang/Integration/LWService/ios/lwservice -FLaiwang/PageViews/EventPage/EventCommon/AttachmentView -FLaiwang/PageViews/EventPage/EventCommon/Comment -FLaiwang/PageViews/EventPage/EventSearch/LWBubbleView -FLaiwang/PageViews/EventPage/EventSearch/LWEventSearchCell -FLaiwang/PageViews/EventPage/EventWall/EventSignIn -FLaiwang/PageViews/KnockPage/Browse/KnockFlipTransition -FLaiwang/PageViews/KnockPage/Browse/LWKnockLocationManager -FLaiwang/Utils/LWFav/libs/CDClient -FLaiwang/Utils/LWFav/libs/file_hash -FLaiwang/Utils/LWFav/libs/GHKit -FLaiwang/Utils/LWFav/libs/PopoverView -FLaiwang/Utils/LWFav/UI/views -FLaiwang/Utils/LWMusic/XiamiSDK/Classes -FLaiwang/Utils/UT/SinaWeibo.bundle/images -FLaiwang/Integration/LWService/ios/lwservice/LaiwangRPC -FLaiwang/Utils/LWMusic/XiamiSDK/Classes/Player -F/Users/henshao/ilaiwang/LaiwangV3/Laiwang -filelist /Users/henshao/Library/Developer/Xcode/DerivedData/Laiwang-fxscnxkslrypubbeazdfkveysldy/Build/Intermediates/Laiwang.build/Debug-iphoneos/Laiwang.build/Objects-normal/arm64/Laiwang.LinkFileList -dead_strip -ObjC -lCNG -lG711 -lG729 -lPods-AMap3DMap -lPods-AMapSearch -lPods-CocoaAsyncSocket -lPods-DevicePrint -lPods-FLEX -lPods-HTTPDNS -lPods-JDStatusBarNotification -lPods-JSONKit -lPods-LWComponentKits -lPods-LWGPUImage -lPods-LWGraffiti -lPods-LWHttpDNSInterceptor -lPods-LWImageAssets -lPods-LWImageFilter -lPods-LWJSONKit -lPods-L.networkKit -lPods-LWPlugin -lPods-LWShareKit -lPods-LWXiamiMusic -lPods-MJRefresh -lPods-MtopSDK -lPods-NJKWebViewProgress -lPods-OpenUDID -lPods-plcrashReporter -lPods-PSTCollectionView -lPods-QupaiSDK -lPods-Reachability -lPods-RegexKitLite -lPods-SDWebImage -lPods-SecurityGuardSDK -lPods-SpeechRecognizer -lPods-TBMstore -lPods-TBScanLib -lPods-TBSecuritySDK -lPods-TBShortURL -lPods-THLabel -lPods-TencentOpenApiSDK -lPods-UserTrack -lPods-VoIPSDK -lPods-ZipArchive -lPods-crossplay -lPods-huoyanSDK_laiwang -lPods-libextobjc -lPods-libwebp -lPods-lwsdk -lPods-mtopext -lQupaiSDK -laudio_coding_module -laudio_conference_mixer -laudio_decoder_interface -laudio_device -laudio_encoder_interface -laudio_processing -lavcodec -lavformat -lavutil -lbitrate_controller -lc++ -lcommon_audio -lcommon_video -lfield_trial_default -liSAC -liSACFix -licucore -lmedia_file -lmetrics_default -.neteq -loffset -lopus -lpaced_sender -lrbe_components -lred -lremote_bitrate_estimator -lrtc_base_approved -lrtc_sound -lrtp_rtcp -lSQLite3 -lsrtp -lstdc++ -lstdc++.6.0.9 -lswscale -lsystem_wrappers -ltbconf -lvideo_coding_utility -lvideo_engine_core -lvideo_processing -lvideo_render_module -lvideo_render_module_impl -lvideo_render_module_internal_impl -lvoice_engine -lwebrtc -lwebrtc_common -lwebrtc_h264 -lwebrtc_i420 -lwebrtc_opus -lwebrtc_utility -lwebrtc_video_coding -lx264 -lxiamiMusic -lXmlRss/ target=_blank class=infotextkey>Xml2 -lyuv -lyuv_neon -lz -framework AMapSearchKit -framework AVFoundation -framework AudioToolbox -framework CFNetwork -framework CoreFoundation -framework CoreGraphics -framework CoreLocation -framework CoreMedia -framework CoreTelephony -framework CoreText -framework CrashReporter -framework DevicePrint -framework Foundation -framework GLKit -framework ImageIO -framework MAMapKit -framework MobileCoreServices -framework MtopSDK -framework OpenGLES -framework QuartzCore -framework Security -framework SecurityGuardSDK -framework SpeechRecognizer -framework SystemConfiguration -framework TBScanLib -framework TBSecuritySDK -framework TBShortURLResolve -framework TencentOpenAPI -framework UIKit -framework UT -framework huoyan -framework mtopext -weak_framework AdSupport -lstdc++ -ObjC -fobjc-arc -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=6.0 -framework LocalAuthentication -framework GameKit -framework AddressBookUI -framework Accelerate -lstdc++.6.0.9 -lXml2 -framework MediaPlayer -framework GLKit -lz -framework SystemConfiguration -framework CoreTelephony -framework Security -framework MessageUI -framework AudioToolbox -framework MobileCoreServices -framework ImageIO -framework QuartzCore -lSQLite3 -lz.1.2.5 -lresolv -liconv -framework AlipaySDK -licucore -framework OpenGLES -framework MapKit -framework CFNetwork -framework AddressBook -framework AssetsLibrary -framework AVFoundation -framework CoreAudio -framework CoreData -framework ShareSDK -framework CoreLocation -framework CoreMedia -framework CoreVideo -framework CoreGraphics -framework UIKit -framework Foundation -lPods -Xlinker -dependency_info -Xlinker /Users/henshao/Library/Developer/Xcode/DerivedData/Laiwang-fxscnxkslrypubbeazdfkveysldy/Build/Intermediates/Laiwang.build/Debug-iphoneos/Laiwang.build/Objects-normal/arm64/Laiwang_dependency_info.dat -o /Users/henshao/Library/Developer/Xcode/DerivedData/Laiwang-fxscnxkslrypubbeazdfkveysldy/Build/Products/Debug-iphoneos/Laiwang.app/Laiwang

經常使用的對象以下。

find,查找文件。好比我想剖析一上去往源代碼各個部門的文件數目。可以發明營業外面文件數目最多的三個營業分離是扎堆、敲門和聊天。

[~/ilaiwang/LaiwangV3/Laiwang/PageViews]$ find . -maxdepth 1 -type d -print0 | xargs -0 -I {} sh -c 'echo $(find {} -type f | wc -l) {}' | sort -nr
914 .
167 ./EventPage
92 ./ChatPage
91 ./KnockPage
88 ./FriendPage
86 ./PubAccountPage
54 ./FeedPage
47 ./SharedPage
44 ./PostPage
29 ./SearchPage
29 ./PhotoEditorPage
29 ./MorePage
28 ./NearByPage
26 ./FriendRadarPage
15 ./LoginPage
14 ./MinePage
14 ./AlbumPage
12 ./PhotoFilterPage
10 ./EmotionBoxPage
9 ./ShareMsgPage
8 ./XiamiPage
8 ./NotificationPage
4 ./IntroducePage
2 ./OAuthPage
2 ./NewGuidePage
2 ./MusicPage
2 ./MoviePage
2 ./DiscoveryExPage

grep,搜刮文本。聯合正則表達式,剖析日記甚麼的,異常之壯大。grep有幾個有效的選項,分離是“-r”遞歸搜刮目次;“-i”,疏忽年夜小寫;“-c”,統計相符搜刮前提的文本的行數;“–color”,高亮搜刮成果。

du,統計目次年夜小。好比我想曉得交往圖片資本的情形。可以看出圖片資本一共有8.2MB,個中同享的圖片占到2.1MB,其次是聊天的圖片占了1.4MB。

[~/iOS_release/lwimageassets]$ du -sh LWImageAssets
8.2M  LWImageAssets

[~/iOS_release/lwimageassets/LWImageAssets]$ du -sh * | sort -hr
2.1M  shared_img
1.4M  chat_img
636K  event_img
528K  icon_default
524K  feed_img
472K  post_img
464K  knock_img
392K  radar_img
284K  profile_img
264K  friend_img
236K  pub_account_map_img
140K  editor_img
132K  yifa_img
132K  emotion_img
84K  neighbour_img
80K  lwuikits_img
76K  discovery_img
72K  graffiti_img
72K  asr_img
60K  login_img
52K  video_guide_img
44K  qr_img
40K  more_img
36K  share_msg_img
32K  my_img
20K  slide_img
16K  animal_img
12K  xiamibar_img
4.0K  search_img
4.0K  movie_img

file,用於檢查文件信息。

$ file libxiamiMusic.a 
libxiamiMusic.a: Mach-O universal binary with 4 architectures
libxiamiMusic.a (for architecture armv7):  current ar archive random library
libxiamiMusic.a (for architecture i386):  current ar archive random library
libxiamiMusic.a (for architecture x86_64):  current ar archive random library
libxiamiMusic.a (for architecture arm64):  current ar archive random library

$ file Laiwang 
Laiwang: Mach-O 64-bit executable

strings,檢查文件中的文本信息。

$ strings Laiwang | head -n 10
kSearchTextKey
kSearchedPersonKey
invalid_token
user_in_black_list
user_blocked
expired_token
invalid_grant
refreshed_token
client_id
client_secret

nm,檢查可履行法式外面的符號信息。

$ nm Laiwang | head -n 10
00000001001425e4 t +[ABContact addressWithStreet:withCity:withState:withZip:withCountry:withCode:]
0000000100142484 t +[ABContact arrayForProperty:inRecord:]
0000000100146438 t +[ABContact contactWithData:]
000000010014591c t +[ABContact contactWithDictionary:]
000000010014191c t +[ABContact contactWithRecord:]
0000000100141984 t +[ABContact contactWithRecordID:]
0000000100141b70 t +[ABContact contact]
000000010014252c t +[ABContact dictionaryWithValue:andLabel:]
0000000100141c50 t +[ABContact localizedPropertyName:]
00000001001424e8 t +[ABContact objectForProperty:inRecord:]

vim

做簡略的文本編纂和剖析,vim長短常便利的。最簡略有效的設置裝備擺設以下。在HOME目次下創立.vimrc隱蔽文件,把上面的內容拷貝出來便可。

syntax on #支撐語法高亮,看源代碼文件會很舒暢。

set hls #應用 / 查找內容的時刻,會高亮字符串。
set ic #搜刮的時刻疏忽年夜小寫

CocoaPods

CocoaPods的源都裝置在”~/.cocoapods/repos”目次下,有時刻找不到pod、版本有成績、或許想肯定一下pod的信息,都可以來這個處所翻一翻。

[~/.cocoapods/repos]$ ls
TBMainClientSpecs/ alibaba/ master/
[~/.cocoapods/repos]$ ls TBMainClientSpecs/
AMPSDK/          TBCalendar/       TBLoginCenter/     TBScanCode/     TBWeiTao/
AccsSDK/         TBCalendarService/    TBLoginService/     TBScanCodeService/ TBWeiTaoService/

[~]$ pod search swiftyjson

-> AISwiftyJSON (1.0.6)
  AISwiftyJSON makes it easy to deal with JSON data in Swift .
  pod 'AISwiftyJSON', '~> 1.0.6'
  - Homepage: https://github.com/asiainfomobile/AISwiftyJSON
  - Source:  [email protected]:asiainfomobile/AISwiftyJSON.git
  - Versions: 1.0.6, 1.0.3 [master repo]

-> SwiftyJSON (2.3.2)
  SwiftyJSON makes it easy to deal with JSON data in Swift
  pod 'SwiftyJSON', '~> 2.3.2'
  - Homepage: https://github.com/SwiftyJSON/SwiftyJSON
  - Source:  [email protected]:SwiftyJSON/SwiftyJSON.git
  - Versions: 2.3.2, 2.3.1, 2.3.0, 2.2.1, 2.2.0, 2.1.3 [master repo]

SQLite

Mac自帶了sqlite敕令行對象。小對象用起來很快很便利。所以簡略引見一下怎樣應用這個對象。其實”.help”講得很具體啦。

[~/Downloads]$ sqlite3 laiwang.sqlite3 
SQLite version 3.8.5 2014-08-15 22:37:57
Enter ".help" for usage hints.
sqlite> .tables
lw_messages      lw_session_event_post
lw_offline_post2    lw_sessions     
sqlite> .schema lw_sessions
CREATE TABLE lw_sessions (primaryKey INTEGER primary key autoincrement, sessionId TEXT, userId TEXT, title TEXT, icon TEXT, content TEXT, sourceType TEXT, data BLOB, actionType TEXT, actionContent TEXT, senderId TEXT, settings BLOB, unreadCount INTEGER, pushEnnabled INTEGER, lastModify TEXT, ancientStampInDB TEXT, recentStampInDB TEXT, sortIndex INTEGER, background TEXT, members BLOB);
CREATE UNIQUE INDEX idx_sessions_SidUidSt ON lw_sessions(sessionId, userId, sourceType);
CREATE INDEX idx_sessions_UidStSiLm ON lw_sessions(userId, sourceType, sortIndex, lastModify);
sqlite> select * from lw_sessions limit 1;
1|2651304|2921438|新浪消息|http://i01.lw.aliimg.com/tfs/T1vldnFFXbXXbKnNzJLAIWANGtebus_73957a0c_180_180.60x60.jpg||pubmessage|||{"type":""}|||0|0|1429026489000|||0||

python SimpleHTTPServer

SimpleHTTPServer模塊相對是python最有效的一個模塊(別的一個能夠是json)。一個敕令就可以啟動一個Web辦事器,做演示或許mock接口,不要太便利了。

[~]$ python -m SimpleHTTPServer 9876
Serving HTTP on 0.0.0.0 port 9876 ...

nomad houston

nomad houston這個對象支撐在敕令行下給APP推送信息,感到蠻不錯的。

以上就是寫給iOS法式員的敕令行應用秘笈,以為不錯的同伙珍藏起來吧!

【寫給iOS法式員的敕令行應用秘笈】的相關資料介紹到這裡,希望對您有所幫助! 提示:不會對讀者因本文所帶來的任何損失負責。如果您支持就請把本站添加至收藏夾哦!

  1. 上一頁:
  2. 下一頁:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © Ios教程網 All Rights Reserved