Skip to content

Instantly share code, notes, and snippets.

View behdaad's full-sized avatar
👻
Boo!

behdad behdaad

👻
Boo!
View GitHub Profile
@behdaad
behdaad / Keybase.md
Last active September 28, 2018 08:19

Keybase proof

I hereby claim:

  • I am behdaad on github.
  • I am behdaad (https://keybase.io/behdaad) on keybase.
  • I have a public key ASBH4MValbWVpndhKQ13fozLFv7ucuApo9k2q7Ko64spcQo

To claim this, I am signing this object:

git branch -d `git branch --merged | grep -v master`
@behdaad
behdaad / iOS gitignore
Created March 14, 2018 08:20
.gitignore
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData/
## Various settings
*.pbxuser
@behdaad
behdaad / gist:20b343a2823c168863046f716cd49c48
Last active September 12, 2018 06:32
CocoaPods "attempted to initialize an object with an unknown UUID"
cat Snapp.xcodeproj/project.pbxproj | grep SECOND_UDID
# prints: BAFD5C521DBF396B0089BDB3 /* Localizable.strings in Resources */,

Then you need to remove and add Localizable.strings to your project again. It can be done via unchecking / checking the mark the target membership in the file inspector.

@behdaad
behdaad / simpleHTTP.py
Created September 30, 2018 20:55
Simple HTTP Server in python3
python3 -m http.server
@behdaad
behdaad / swift.swift
Last active October 15, 2018 15:24
swift snippet
class SplashInteractor: OnboardingIntractor {
// MARK: - Properties
var presenter: SplashPresenterProtocol!
var splashRouter: SplashRouterProtocol! {
return router as? SplashRouterProtocol
}
weak var viewController: SplashViewControllerProtocol!
var startTime: Date = Date()
// MARK: - Methods
@behdaad
behdaad / Xcode.md
Created December 12, 2018 09:45
Remove unavailable simulators

xcrun simctl delete unavailable

@behdaad
behdaad / instruments.md
Created March 22, 2019 21:19
Use Xcode Instruments for iOS apps from App Store, without jailbreak
  1. Turn off SIP so you can debug Instruments.app
  2. lldb -n Instruments
  3. put a breakpoint on - [XRRemoteDevice launchProcess:suspended:error:]
  4. select target device and apps, perform the task that you are interested in
  5. when the breakpoint is hit, reg write rcx 0 (override 3rd argument to false)
  6. continue
@behdaad
behdaad / resign.sh
Created March 23, 2019 15:15
Resign IPA file
IPA="/path/to/file.ipa"
PROVISION="/path/to/file.mobileprovision"
CERTIFICATE="Name of certificate: To sign with" # must be in keychain
# unzip the ipa
unzip -q "$IPA"
# remove the signature
rm -rf Payload/*.app/_CodeSignature Payload/*.app/CodeResources
# replace the provision
cp "$PROVISION" Payload/*.app/embedded.mobileprovision
# sign with the new certificate
@behdaad
behdaad / export.md
Last active March 23, 2019 15:26
Export IPA from Archive w/o Developer Account
  1. Just build (Command+B) your app from Xcode by setting proper code signing identities
  2. From Xcode's file search at left bottom, search for .app (This will be under product directory)
  3. Right Click on this .app file and select Show in Finder
  4. Now, create directory and name it as Payload, copy .app into Payload directory.
  5. Archive/Compress(.zip) this Payload directory, rename file extension from .zip to .ipa
  • Create Archive
  • Go to Organizer
  • Get location of Archive by Right Click and selecting Show in Finder