GithubHelp home page GithubHelp logo

johnno1962 / injectioniii Goto Github PK

View Code? Open in Web Editor NEW
3.9K 38.0 301.0 1.66 MB

Re-write of Injection for Xcode in (mostly) Swift

License: MIT License

Swift 11.97% Objective-C 41.00% C 16.79% Rich Text Format 4.37% Shell 3.12% Java 6.91% Objective-C++ 15.85%
swift eval ios-simulator injection storyboard-injection xcode macos hot-reload remote-control reverse-engineering

injectioniii's Introduction

InjectionIII.app Project

Yes, HotReloading for Swift

Chinese language README: 中文集成指南

Icon

Code injection allows you to update the implementation of functions and any method of a class, struct or enum incrementally in the iOS simulator without having to perform a full rebuild or restart your application. This saves the developer a significant amount of time tweaking code or iterating over a design. Effectively it changes Xcode from being a "source editor" to being a "program editor" where source changes are not just saved to disk but into your running program directly.

How to use it

Setting up your projects to use injection is now as simple as downloading one of the github releases of the app or from the Mac App Store and adding the code below somewhere in your app to be executed on startup (it is no longer necessary to actually run the app itself).

#if DEBUG
Bundle(path: "/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle")?.load()
//for tvOS:
Bundle(path: "/Applications/InjectionIII.app/Contents/Resources/tvOSInjection.bundle")?.load()
//Or for macOS:
Bundle(path: "/Applications/InjectionIII.app/Contents/Resources/macOSInjection.bundle")?.load()
#endif

It's also important to add the options -Xlinker and -interposable (without double quotes and on separate lines) to the "Other Linker Flags" of targets in your project (for the Debug configuration only) to enable "interposing" (see the explanation below).

Icon

After that, when you run your app in the simulator you should see a message saying a file watcher has started for your home directory and, whenever you save a source file in the current project it should report it has been injected. This means all places that formerly called the old implementation will have been updated to call the latest version of your code.

It's not quite as simple as that as to see results on the screen immediately the new code needs to have actually been called. For example, if you inject a view controller it needs to force a redisplay. To resolve this problem, classes can implement an @objc func injected() method which will be called after the class has been injected to perform any update to the display. One technique you can use is to include the following code somewhere in your program:

#if DEBUG
extension UIViewController {
    @objc func injected() {
        viewDidLoad()
    }
}
#endif

Another solution to this problem is "hosting" using the Inject Swift Package introduced by this blog post.

What injection can't do

You can't inject changes to how data is laid out in memory i.e. you cannot add, remove or reorder properties with storage. For non-final classes this also applies to adding or removing methods as the vtable used for dispatch is itself a data structure which must not change over injection. Injection also can't work out what pieces of code need to be re-executed to update the display as discussed above. Also, don't get carried away with access control. private properties and methods can't be injected directly, particularly in extensions as they are not a global interposable symbol. They generally inject indirectly as they can only be acessed inside the file being injected but this can cause confusion. Finally, Injection doesn't cope well with source files being added/renamed/deleted during injection. You may need to build and relaunch your app or even close and reopen your project to clear out old Xcode build logs.

Injection of SwiftUI

SwiftUI is, if anything, better suited to injection than UIKit as it has specific mechanisms to update the display but you need to make a couple changes to each View struct you want to inject. To force redraw the simplest way is to add a property that observes when an injection has occurred:

    @ObserveInjection var forceRedraw

This property wrapper is available in either the HotSwiftUI or Inject Swift Package. It essentially contains an @Published integer your views observe that increments with each injection. You can use one of the following to make one of these packages available throughout your project:

@_exported import HotSwiftUI
or
@_exported import Inject

The second change you need to make for reliable SwiftUI injection is to "erase the return type" of the body property by wrapping it in AnyView using the .enableInjection() method extending View in these packages. This is because, as you add or remove SwiftUI elements it can change the concrete return type of the body property which amounts to a memory layout change that may crash. In summary, the tail end of each body should always look like this:

    var body: some View {
    	 VStack or whatever {
        // Your SwiftUI code...
        }
        .enableInjection()
    }

    @ObserveInjection var redraw

You can leave these modifications in your production code as, for a Release build they optimise out to a no-op.

Injection on an iOS, tvOS or visionOS device

This can work but you will need to actually run one of the github 4.8.0+ releases of the InjectionIII.app, set a user default to opt-in and restart the app.

$ defaults write com.johnholdsworth.InjectionIII deviceUnlock any

Then, instead of loading the injection bundles run this script in a "Build Phase": (You will also need to turn off the project build setting "User Script Sandboxing")

RESOURCES=/Applications/InjectionIII.app/Contents/Resources
if [ -f "$RESOURCES/copy_bundle.sh" ]; then
    "$RESOURCES/copy_bundle.sh"
fi

and, in your application execute the following code on startup:

    #if DEBUG
    if let path = Bundle.main.path(forResource:
            "iOSInjection", ofType: "bundle") ??
        Bundle.main.path(forResource:
            "macOSInjection", ofType: "bundle") {
        Bundle(path: path)!.load()
    }
    #endif

Once you have switched to this configuaration it will also work when using the simulator. Consult the README of the HotReloading project for details on how to debug having your program connect to the InjectionIII.app over Wi-Fi. You will also need to select the project directory for the file watcher manually from the pop-down menu.

Injection on macOS

It works but you need to temporarily turn off the "app sandbox" and "library validation" under the "hardened runtime" during development so it can dynamically load code. In order to avoid codesigning problems, use the new copy_bundle.sh script as detailed in the instructions for injection on real devices above.

How it works

Injection has worked various ways over the years, starting out using the "Swizzling" apis for Objective-C but is now largely built around a feature of Apple's linker called "interposing" which provides a solution for any Swift method or computed property of any type.

When your code calls a function in Swift, it is generally "statically dispatched", i.e. linked using the "mangled symbol" of the function being called. Whenever you link your application with the "-interposable" option however, an additional level of indirection is added where it finds the address of all functions being called through a section of writable memory. Using the operating system's ability to load executable code and the fishhook library to "rebind" the call it is therefore possible to "interpose" new implementations of any function and effectively stitch them into the rest of your program at runtime. From that point it will perform as if the new code had been built into the program.

Injection uses the FSEventSteam api to watch for when a source file has been changed and scans the last Xcode build log for how to recompile it and links a dynamic library that can be loaded into your program. Runtime support for injection then loads the dynamic library and scans it for the function definitions it contains which it then "interposes" into the rest of the program. This isn't the full story as the dispatch of non-final class methods uses a "vtable" (think C++ virtual methods) which also has to be updated but the project looks after that along with any legacy Objective-C "swizzling".

If you are interested knowing more about how injection works the best source is either my book Swift Secrets or the new, start-over reference implementation in the InjectionLite Swift Package. For more information about "interposing" consult this blog post or the README of the fishhook project. For more information about the organisation of the app itself, consult ROADMAP.md.

A bit of terminology

Getting injection to work has three components. A FileWatcher, the code to recompile any changed files and build a dynamic library that can be loaded and the injection code itself which stitches the new versions of your code into the app while it's running. How these three components are combined gives rise to the number of ways injection can be used.

"Injection classic" is where you download one of the binary releases from github and run the InjectionIII.app. You then load one of the bundles inside that app into your program as shown above in the simulator. In this configuration, the file watcher and source recompiling is done inside the app and the bundle connects to the app using a socket to know when a new dynamic library is ready to be loaded.

"App Store injection" This version of the app is sandboxed and while the file watcher still runs inside the app, the recompiling and loading is delegated to be performed inside the simulator. This can create problems with C header files as the simulator uses a case sensitive file system to be a faithful simulation of a real device.

"HotReloading injection" was where you are running your app on a device and because you cannot load a bundle off your Mac's filesystem on a real phone you add the HotReloading Swift Package to your project (during development only!) which contains all the code that would normally be in the bundle to perform the dynamic loading. This requires that you use one of the un-sandboxed binary releases. It has also been replaced by the copy_bundle.sh script described above.

"Standalone injection". This was the most recent evolution of the project where you don't run the app itself anymore but simply load one of the injection bundles and the file watcher, re-compilation and injection are all performed inside the simulator. By default this watches for changes to any Swift file inside your home directory though you can change this using the environment variable INJECTION_DIRECTORIES.

All these variations require you to add the "-Xlinker -interposble" linker flags for a Debug build or you will only be able to inject non-final methods of classes.

Further information

Consult the old README which if anything contained simply "too much information" including the various environment variables you can use for customisation. A few examples:

Environment var. Purpose
INJECTION_DETAIL Verbose output of all actions performed
INJECTION_TRACE Log calls to injected functions (v4.6.6+)
INJECTION_HOST Mac's IP address for on-device injection

With an INJECTION_TRACE environment variable, injecting any file will add logging of all calls to functions and methods in the file along with their argument values as an aid to debugging.

A little known feature of InjectionIII is that provided you have run the tests for your app at some point you can inject an individual XCTest class and have if run immediately – reporting if it has failed each time you modify it.

Acknowledgements:

This project includes code from rentzsch/mach_inject, erwanb/MachInjectSample, davedelong/DDHotKey and acj/TimeLapseBuilder-Swift under their respective licenses.

The App Tracing functionality uses the OliverLetterer/imp_implementationForwardingToSelector trampoline implementation via the SwiftTrace project under an MIT license.

SwiftTrace uses the very handy https://github.com/facebook/fishhook. See the project source and header file included in the app bundle for licensing details.

This release includes a very slightly modified version of the excellent canviz library to render "dot" files in an HTML canvas which is subject to an MIT license. The changes are to pass through the ID of the node to the node label tag (line 212), to reverse the rendering of nodes and the lines linking them (line 406) and to store edge paths so they can be coloured (line 66 and 303) in "canviz-0.1/canviz.js".

It also includes CodeMirror JavaScript editor for the code to be evaluated using injection under an MIT license.

The fabulous app icon is thanks to Katya of pixel-mixer.com.

$Date: 2024/03/26 $

injectioniii's People

Contributors

bb9z avatar danielasher avatar fabcz avatar gocy015 avatar johnno1962 avatar loohalh avatar nickgzzjr avatar raykle avatar vidahasan avatar vikas171999 avatar yeswolf avatar zenangst avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

injectioniii's Issues

xcode.activeWorkspaceDocument is nil in branch "MAS-version"

       //InjectionServer.runInBackground
        XcodeApplication *xcode = (XcodeApplication *)[SBApplication
                           applicationWithBundleIdentifier:XcodeBundleID];
        XcodeWorkspaceDocument *workspace = [xcode activeWorkspaceDocument];
        //workspace is nil
        projectFile = workspace.file.path;

but in branch "master" is not nil and work fine. why?

Library not loaded

Hi,

I have tried loading the bundle directly and using the "start injection". When trying to load the Bundle in didFinishLaunchingWithOptions, i get

2017-11-28 14:01:53.283088-0400 CN-iOS[9053:630912] Error loading /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection:  dlopen(/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection, 265): Library not loaded: @rpath/libswiftXCTest.dylib
  Referenced from: /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection
  Reason: image not found

I know for certain the bundle is in that location, so any idea what may be causing that?

Bundle not loading on Xcode 10 and macOS Mojave beta 11

When I try to load the iOS injection bundle I get this error:

Error loading /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection:  dlopen(/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection, 265): Symbol not found: __T0BOWV
  Referenced from: /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection
 in /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection

I'm using the MAS version. Any ideas? 😅

INJECTION_BUNDLE_NOTIFICATION observer not called on InjectionX

Looks like the "INJECTION_BUNDLE_NOTIFICATION" is not being fired on InjectionX.

I'm subscribing with:

    NotificationCenter.default.addObserver(self, selector: #selector(self.onInjected),
      name: NSNotification.Name(rawValue: "INJECTION_BUNDLE_NOTIFICATION"),
      object: nil)

but onInjected is never called.

  • Version 1.2 (1171)
  • "Injected" message is logged ok, so, injection is working ok.
  • Same code is working ok with previous versions of injection on Xcode9.

It seems stop working with Xcode 9.3

When using Xcode 9.2, it worked. But, I update Xcode yesterday, and InjectionIII seems not working. Icon on the menu bar not change color, and 'Start Injection' has no effect.

@objc func injected() not working

Hi again,

I have found @objc func injected() is not being called when a injection is taking place. I've set up a simple view controller hierarchy shown below:

uiviewcontroller view debugger

Only after deleting the @objc func injected() function and re-injecting (i.e. Cmd-S) does the function run. Perhaps this detail is a clue.

"INJECTION_BUNDLE_NOTIFICATION" notifications are working well. I don't have much more info, so feel free to close if there is nothing to further to be done.

Compiling /Users/danielasher/Dev/Story/SoundingOutViewController.swift
Loading /tmp/eval3.dylib. (Ignore any duplicate class warning)
objc[3360]: Class _TtC9StoryView25SoundingOutViewController is implemented in both /Users/danielasher/Library/Developer/Xcode/DerivedData/StoryExercise-fzjqrtzvufnyynccigutynyemscx/Build/Products/Debug-iphonesimulator/StoryView.framework/StoryView (0x1059da1b0) and /tmp/eval3.dylib (0x128bd9bc0). One of the two will be used. Which one is undefined.
Injected 'StoryView.SoundingOutViewController', vtable length: 608

High Sierra
Xcode 9.2
Swift 4.0

Support for AppCode

This is an excellent project, highly helpful in rapid development.

Is it a must to use XCode to run InjectionIII or is there a way to do make it work only with AppCode and build/run the app from it?

Symbol not found: ___llvm_profile_runtime

Hi Johnno,

thanks for this amazing project!

I've installed successfully and am using the AppDelegate method to start. The status icon goes from blue to green to amber. Xprobe works beautifully, but when I save a change I get this error:

Compiling /Users/danielasher/.../MyViewController.swift
Loading /tmp/eval1.dylib. (Ignore any duplicate class warning)
*** dlopen() error: dlopen(/tmp/eval1.dylib, 2): Symbol not found: ___llvm_profile_runtime
  Referenced from: /tmp/eval1.dylib
  Expected in: flat namespace
 in /tmp/eval1.dylib ***

Any clues?

thanks,

Daniel

InjectionX does not work on AppCode 2018.2.3 using XCode 10.0

Hi, I am using AppCode 2018.2.3 to run my app. The XCode I'm using is version 10.0.
When I run it with XCode and a same configuration, it works fine. But, when I tried it on AppCode, it produced an error.

I'm already adding [[NSBundle bundleWithPath:@"/Applications/InjectionX.app/Contents/Resources/iOSInjection.bundle"] load]; to my AppDelegate and turning off code coverage for the scheme.

But still I got an error:

*** Compiling /Users/doni.ramadhan/Projects/TheProject/Something.m ***
Loading .dylib - Ignore any duplicate class warning...
*** dlopen() error: dlopen(/Users/doni.ramadhan/Library/Containers/com.johnholdsworth.InjectionX/Data/eval101.dylib, 2): Symbol not found: ___llvm_profile_runtime
  Referenced from: /Users/doni.ramadhan/Library/Containers/com.johnholdsworth.InjectionX/Data/eval101.dylib
  Expected in: flat namespace
 in /Users/doni.ramadhan/Library/Containers/com.johnholdsworth.InjectionX/Data/eval101.dylib ***
*** Compiling /Users/doni.ramadhan/Projects/TheProject/Something.m ***
Loading .dylib - Ignore any duplicate class warning...
*** dlopen() error: dlopen(/Users/doni.ramadhan/Library/Containers/com.johnholdsworth.InjectionX/Data/eval102.dylib, 2): Symbol not found: ___llvm_profile_runtime
  Referenced from: /Users/doni.ramadhan/Library/Containers/com.johnholdsworth.InjectionX/Data/eval102.dylib
  Expected in: flat namespace
 in /Users/doni.ramadhan/Library/Containers/com.johnholdsworth.InjectionX/Data/eval102.dylib ***

Can you help me on what I did wrong? Or maybe AppCode using XCode 10 is not supported yet?

Recompile Fail For Special Character

There is a directory named ab&de in my project. It works well in xcode. But when I try to use injection for some files which import this special file, It will throw an error said clang: error: no input files or de Common Not Found
I don't know why It works well in xcode, but not in injection.

counld not find file

I try to use it in my project. But I found that it can no work as it's ok in demo.
The error I got is as below:

gunzip: error writing to output: Broken pipe
Compiling /pat/to/tofile.m

real	0m0.057s
user	0m0.039s
sys	0m0.012s
*** Re-compilation failed (/tmp/eval3.sh)
fatal error: malformed or corrupted AST file: 'could not find file '/path/to/somheader.h' referenced by AST file '/Users/sfelixzhu/Library/Developer/Xcode/DerivedData/xxxxProject-csjzipupumxtbqccculhnzlqajfz/Build/Intermediates.noindex/PrecompiledHeaders/somPreCompileFile.pch.pch''
1 error generated.

I guessed the problem is my project is very large so the activitylog is large too. But I cannot resolve the error. I used to inject the project by injectionApp and it worked well.

By the way, I have tried to clean the project and rebuilt it . But it didn't work.

Xcode 9.4.1 Swift 4.1 InjectionIII 1.1 version Simulator iPhone 8p 11.4 macOS High Sierra 10.13.6 not work

I download injectionIII from appstore and write below code at Appdelegate file.

Bundle(path: "/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle")!.load()

I changed view background color, such as:

       // ViewController.swift
       // self.view.backgroundColor from red to blue
       // This is modify code
        self.view.backgroundColor = .blue

But it doesn't work.

Console:

Injection connected, watching /Users/yongpeng.zhu/Desktop/YPCamera/**
*** Compiling /Users/yongpeng.zhu/Desktop/YPCamera/YPCamera/ViewController.swift ***
Loading .dylib - Ignore any duplicate class warning...
objc[5212]: Class _TtC8YPCamera14ViewController is implemented in both /Users/yongpeng.zhu/Library/Developer/CoreSimulator/Devices/F7E35355-4904-48CB-B448-978B3CDE2CAB/data/Containers/Bundle/Application/1B383F7C-BC78-4019-B115-BDEEEEF8AC98/YPCamera.app/YPCamera (0x101837130) and /Users/yongpeng.zhu/Library/Containers/com.johnholdsworth.InjectionIII/Data/eval101.dylib (0x11cf861e0). One of the two will be used. Which one is undefined.
Injected 'YPCamera.ViewController'
*** Compiling /Users/yongpeng.zhu/Desktop/YPCamera/YPCamera/ViewController.swift ***
Loading .dylib - Ignore any duplicate class warning...
objc[5212]: Class _TtC8YPCamera14ViewController is implemented in both /Users/yongpeng.zhu/Library/Developer/CoreSimulator/Devices/F7E35355-4904-48CB-B448-978B3CDE2CAB/data/Containers/Bundle/Application/1B383F7C-BC78-4019-B115-BDEEEEF8AC98/YPCamera.app/YPCamera (0x101837130) and /Users/yongpeng.zhu/Library/Containers/com.johnholdsworth.InjectionIII/Data/eval102.dylib (0x11cf901e0). One of the two will be used. Which one is undefined.
Injected 'YPCamera.ViewController'

Could not locate compile command

*** Could not locate compile command for /Users/chengda/Documents/chenshengbao_swift_new_version/chenshengbao5.0beifen/Tea/ViewController.swift
Injection doesn’t work when using whole module optimisation.
If you have switched xcode versions, please cmd-shift-k to clean then rebuild the project so there is a complete build history logged and try again.
/Users/chengda/Library/Developer/Xcode/DerivedData/Tea-davwimzuyhcukoecqbmyfdslmugk/Logs/Build/E1A3683C-B1E2-40DA-8BF4-84F5BACFFD92.xcactivitylog /Users/chengda/Library/Developer/Xcode/DerivedData/Tea-davwimzuyhcukoecqbmyfdslmugk/Logs/Build/../Debug/E453E80E-3EC2-496B-B74B-ADD3B0B0A62B.xcactivitylog /Users/chengda/Library/Developer/Xcode/DerivedData/Tea-davwimzuyhcukoecqbmyfdslmugk/Logs/Build/9D0A471F-7157-43CA-810C-6C12E0B74E9D.xcactivitylog /Users/chengda/Library/Developer/Xcode/DerivedData/Tea-davwimzuyhcukoecqbmyfdslmugk/Logs/Build/99C26A6F-647D-4E89-9993-7D8F9E9D15C4.xcactivitylog 

 at /Applications/Injection.app/Contents/Resources/common.pm line 61.
 main::error(‘Could not locate compile command for /Users/chengda/Documents…’) called at /Applications/Injection.app/Contents/Resources/injectSource.pl line 292
 Bundle build failed ***

not work for xcode( Version 10.0 (10A255))

Error loading /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection: dlopen(/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection, 265): Library not loaded: @rpath/XCTest.framework/XCTest
Referenced from: /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection
Reason: image not found

Could not locate containing project or it's logs.

The subject error occurs, using the sample GettingStarted.zip app

  • tested on Xcode v9.4.1
  • Xcode Preferences Locations has:
    => Derived Data: Relative build/DerivedData
    -> click Advanced under Derived Data:
    Custom Relative to Workspace
    Products: build/Build/Products
    Intermediates: build/Build/Intermediates.noindex
    Index Datastore: build/Index/DataStore

In other words, all of the build products are put underneath a "build" directory in the root of the project. This was done to allow command line builds, and xcode builds, to share the same build output dir, thereby allowing you to interact with both. It also allows easy full cleans of both, and .gitignore of the build dir in the root of the project.

This change appears to be causing Injection to fail, though, due to the message provided in the subject line.

How may I keep the relative build directory, and still use Injection?

App Store version do not do anything after selecting project folder

The steps I am taking:

  • Install the app from the App Store.
  • Open the app. The icon appeared in the status bar at the top. The icon is blue.
  • Click it and then click 'Open Project'.
  • Navigate to my project folder (containing the xcodeproj / xcworkspace files) and click 'Select Project Directory'.
  • Nothing happens. I don't get an option to 'Start Injection' in the menu. The icon stays blue. Ctrl + = doesn't do anything.

Notes:

  • My project folder has a space in it.
  • I'm using the latest version of Xcode (Version 10.0 (10A255)).

Let me know if there's any other debug output that I can provide you with (nothing seems to be appearing in the Xcode console output or in console.app).

Use Xcode9.4 Crash

*** Compiling /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/AppClass/Controller/Home/Home/View/SOAHomeView.m ***
/bin/bash: -c: line 0: syntax error near unexpected token (' /bin/bash: -c: line 0: (cd "/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest" && cd "/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest" && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -gmodules -fmodules-cache-path=/Users/zhangxing/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/zhangxing/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wunreachable-code -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DDEBUG=1 -DCOCOAPODS=1 -DDEBUG=1 -DGTM_OAUTH2_USE_FRAMEWORK_IMPORTS=1 -DCOCOAPODS=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -mios-simulator-version-min=9.0 -g -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -fobjc-abi-version=2 -fobjc-legacy-dispatch -index-store-path /Users/zhangxing/Library/Developer/Xcode/DerivedData/GearBest-cuijvkjvnmtblbbyocnwzjrgmvzb/Index/DataStore -iquote /Users/zhangxing/Library/Developer/Xcode/DerivedData/GearBest-cuijvkjvnmtblbbyocnwzjrgmvzb/Build/Intermediates.noindex/GearBest.build/Debug-iphonesimulator/GearBest.build/GearBest-generated-files.hmap -I/Users/zhangxing/Library/Developer/Xcode/DerivedData/GearBest-cuijvkjvnmtblbbyocnwzjrgmvzb/Build/Intermediates.noindex/GearBest.build/Debug-iphonesimulator/GearBest.build/GearBest-own-target-headers.hmap -I/Users/zhangxing/Library/Developer/Xcode/DerivedData/GearBest-cuijvkjvnmtblbbyocnwzjrgmvzb/Build/Intermediates.noindex/GearBest.build/Debug-iphonesimulator/GearBest.build/GearBest-all-target-headers.hmap -iquote /Users/zhangxing/Library/Developer/Xcode/DerivedData/GearBest-cuijvkjvnmtblbbyocnwzjrgmvzb/Build/Intermediates.noindex/GearBest.build/Debug-iphonesimulator/GearBest.build/GearBest-project-headers.hmap -iquote/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/Framework/Branch.framework/Headers -I/Users/zhangxing/Library/Developer/Xcode/DerivedData/GearBest-cuijvkjvnmtblbbyocnwzjrgmvzb/Build/Products/Debug-iphonesimulator/include -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Google/Headers -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/AVOSCloud -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/AppsFlyerFramework -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/CorePhotoBroswerVC -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/Crashlytics -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/DLSlideView -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/FLEX -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/Fabric -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/FirebaseAnalytics -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/FirebaseCore -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/FirebaseInstanceID -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/GTMOAuth2 -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/GTMSessionFetcher -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/Google -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/GoogleAnalytics -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/GoogleSignIn -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/GoogleToolboxForMac -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/IQKeyboardManager-GB -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/JSBadgeView-GB -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/KeychainIDFA -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/KxMenu -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/LBXScan -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/LPMessagingSDK -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/MF_Base64Additions -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/MGSwipeTableCell-GB -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/MZTimerLabel-GB -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/Masonry -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/NSDataMD5 -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/NSStringCompareToVersion -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SDCycleScrollView -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOAAFNetworking -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOABase -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOAComponent -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOACore -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOADZNEmptyDataSet -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOADefines -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOAHYFileManager -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOAMBProgressHUD -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOAMJNIndexView -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOAMJRefresh -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOAPriceLabel -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOAProtocols -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOAReachability -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOASaleTimeLabel -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOATTTAttributedLabel -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOATZImagePickerController -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOAUITableViewFDTemplateLayoutCell -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOAYBPopupMenu -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOAYYImage -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOAYYModel -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/UIBarButtonItemBadge -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/UICollectionViewLeftAlignedLayout -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/UIImageRotate -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/UISearchBarContentModeLeft -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/YoutubeHelper -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/ZHAddressTextFiled -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/ZHAlertController2 -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/ZHAutoSizeTagView -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/ZHLocalizationStringMangerObjc -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/ZHSegmentTagView -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/ZHTableViewGroupObjc -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/GoogleInterchangeUtilities -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/GoogleSymbolUtilities -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/GoogleUtilities -I/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/UIView+FDCollapsibleConstraints -I/Users/zhangxing/Library/Developer/Xcode/DerivedData/GearBest-cuijvkjvnmtblbbyocnwzjrgmvzb/Build/Intermediates.noindex/GearBest.build/Debug-iphonesimulator/GearBest.build/DerivedSources/x86_64 -I/Users/zhangxing/Library/Developer/Xcode/DerivedData/GearBest-cuijvkjvnmtblbbyocnwzjrgmvzb/Build/Intermediates.noindex/GearBest.build/Debug-iphonesimulator/GearBest.build/DerivedSources -F/Users/zhangxing/Library/Developer/Xcode/DerivedData/GearBest-cuijvkjvnmtblbbyocnwzjrgmvzb/Build/Products/Debug-iphonesimulator -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/AppsFlyerFramework -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/CorePhotoBroswerVC/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Crashlytics/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Fabric/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/FirebaseAnalytics/Frameworks -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/FirebaseCore/Frameworks -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/FirebaseInstanceID/Frameworks -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Google/Frameworks -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/GoogleSignIn/Frameworks -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/IQKeyboardManager-GB/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/JSBadgeView-GB/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/KeychainIDFA/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/KxMenu/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/LPMessagingSDK/LPMessagingSDK -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/MF_Base64Additions/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/MGSwipeTableCell-GB/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/MZTimerLabel-GB/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/NSDataMD5/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/NSStringCompareToVersion/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/SDCycleScrollView/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/SOAAFNetworking/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/SOAHYFileManager/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/SOAMBProgressHUD/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/SOAMJNIndexView/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/SOAMJRefresh/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/SOAReachability/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/SOASaleTimeLabel/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/SOATTTAttributedLabel/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/SOATZImagePickerController/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/SOAUITableViewFDTemplateLayoutCell/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/SOAYBPopupMenu/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/SOAYYModel/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/UIBarButtonItemBadge/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/UICollectionViewLeftAlignedLayout/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/UIImageRotate/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/UISearchBarContentModeLeft/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/ZHAddressTextFiled/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/ZHAutoSizeTagView/Carthage/Build/iOS -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/Classes/Library/google_signin_sdk_3_0_0 -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/Classes/Framework -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/PrivateFrameworks -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/Classes/Library/FacebookSDKs -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/Classes/Library/ShareSDK -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/Classes/Library/ShareSDK/Support/Optional -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/Classes/Library/ShareSDK/Support/Required -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/Classes/Library/KSCrash -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/Framework -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/Library/FacebookSDKs -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/Library/KSCrash -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/Library/ShareSDK -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/Library/ShareSDK/Support/Optional -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/Library/ShareSDK/Support/Required -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/ThirdLibs/FacebookSDKs -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/ThirdLibs/KSCrash -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/ThirdLibs/ShareSDK -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/ThirdLibs/ShareSDK/Support/Optional -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/ThirdLibs/ShareSDK/Support/Required -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/ThirdLibs/ShareSDK(4-V)/Required -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/ThirdLibs/ShareSDK(4-V)/ShareSDK -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/ThirdLibs/ShareSDK(4-V)/ShareSDK/Support/Optional -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/ThirdLibs/ShareSDK(4-V)/ShareSDK/Support/PlatformConnector -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/ThirdLibs/ShareSDK(4-V)/ShareSDK/Support/Required -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/ThirdLibs/ShareSDK/Required -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/ThirdLibs/ShareSDK/ShareSDK -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/ThirdLibs/ShareSDK/ShareSDK/Support/Optional -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/ThirdLibs/ShareSDK/ShareSDK/Support/PlatformConnector -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/ThirdLibs/ShareSDK/ShareSDK/Support/Required -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/ThirdLibs/LiveChat -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest -F/Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Carthage/Build/iOS -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/AVOSCloud -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/AppsFlyerFramework -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/CorePhotoBroswerVC -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/Crashlytics -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/DLSlideView -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/FLEX -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/Fabric -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/FirebaseAnalytics -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/FirebaseCore -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/FirebaseInstanceID -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/GTMOAuth2 -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/GTMSessionFetcher -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/Google -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/GoogleAnalytics -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/GoogleSignIn -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/GoogleToolboxForMac -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/IQKeyboardManager-GB -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/JSBadgeView-GB -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/KeychainIDFA -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/KxMenu -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/LBXScan -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/LPMessagingSDK -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/MF_Base64Additions -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/MGSwipeTableCell-GB -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/MZTimerLabel-GB -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/Masonry -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/NSDataMD5 -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/NSStringCompareToVersion -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SDCycleScrollView -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOAAFNetworking -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOABase -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOAComponent -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOACore -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOADZNEmptyDataSet -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOADefines -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOAHYFileManager -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOAMBProgressHUD -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOAMJNIndexView -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOAMJRefresh -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOAPriceLabel -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOAProtocols -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOAReachability -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOASaleTimeLabel -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOATTTAttributedLabel -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOATZImagePickerController -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOAUITableViewFDTemplateLayoutCell -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOAYBPopupMenu -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOAYYImage -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/SOAYYModel -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/UIBarButtonItemBadge -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/UICollectionViewLeftAlignedLayout -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/UIImageRotate -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/UISearchBarContentModeLeft -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/YoutubeHelper -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/ZHAddressTextFiled -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/ZHAlertController2 -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/ZHAutoSizeTagView -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/ZHLocalizationStringMangerObjc -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/ZHSegmentTagView -isystem /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/Pods/Headers/Public/ZHTableViewGroupObjc -include /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/Others/PrefixHeader.pch -MMD -MT dependencies -MF /Users/zhangxing/Library/Developer/Xcode/DerivedData/GearBest-cuijvkjvnmtblbbyocnwzjrgmvzb/Build/Intermediates.noindex/GearBest.build/Debug-iphonesimulator/GearBest.build/Objects-normal/x86_64/SOAHomeView.d --serialize-diagnostics /Users/zhangxing/Library/Developer/Xcode/DerivedData/GearBest-cuijvkjvnmtblbbyocnwzjrgmvzb/Build/Intermediates.noindex/GearBest.build/Debug-iphonesimulator/GearBest.build/Objects-normal/x86_64/SOAHomeView.dia -c /Users/zhangxing/Documents/Gitlab/GearBest/GearBest2.6.0_9287/GearBest/GearBest/AppClass/Controller/Home/Home/View/SOAHomeView.m -o /Users/zhangxing/Library/Containers/com.johnholdsworth.InjectionIII/Data/eval101.o >/Users/zhangxing/Library/Containers/com.johnholdsworth.InjectionIII/Data/eval101.log 2>&1)'
(lldb)

*** Could not locate containing project or it's logs. Have you customised the DerivedData path? ***

Hi John,
I am trying to use latest injectionIII app that has been updated on Friday 28th Sept version 1.2.
I have created a sample Mac app project and its inside home directory ,
Injection and xCode both are in /Applications.
still I am getting below error whenever I save a file in my project.

*** Could not locate containing project or it's logs.
Have you customised the DerivedData path? ***

I really want to use this app to escape from the build time in latest xCode, Please help.

A suggestion to write injected code in one file

Hi, johnno1962, thanks for your great work.

I would like to use InjectionIII in a team project, so I should not write the injection code in AppDelegate.swift. ( other team member might not use InjectionIII )

Bundle(path: "/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle")?.load()

So my suggestion is that we should write all injection code in a new file named Injection.swift, and it's content looks like:

import UIKit

#if DEBUG //1

extension UIViewController { //5

    @objc func injected() { //2
        for subview in self.view.subviews { //3
            subview.removeFromSuperview()
        }
        viewDidLoad() //4
    }
}

extension AppDelegate {
    
    private static let installInjectionOn: Void = {
        Bundle(path: "/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle")?.load()
    }()
    
    override open var next: UIResponder? {
        AppDelegate.installInjectionOn
        return super.next
    }
}

#endif

And for other people who want to use InjectionIII, it may be easier to add a single file to his project.

Could not locate compile command

After experiencing the problem explained in the prior issue, I opted to try Vaccine with InjectionIII.

That resolved the problem in that issue, but a new one occurred. When the source code is changed and the file saved, InjectionIII is triggered, but now I always received
"Could not locate compile command for xxxxx Try a clean build" ...

A clean build does not remedy this, and I expect the cause is likely related to what caused the prior issue; the use of certain non-default build output locations.

What should be done? I expect there are numerous possible approaches, all requiring some change to InjectionIII and how it is currently making determinations.

Work with files outside of project directory

Problem

I have a main project, but some supplemental files are maintained in other directory.

  • Root Project: ~/projects/theMainProject/mainProject.workspace
  • Sub Project: ~/projects/otherProject/someFiles.m

so nothing happened while saving sub project files.

What I've try:

Rebuild InejctionIII's filewatcher path, observer the RootProject/../../, that is ~/projects/, and save the files.

  • [Works as usual] Saving appdelegate.m in main project
    • file compiled
    • duplicate warning printed
    • -injected called.
  • [NOT totally Work] Saving someFiles.m in other directory
    • file compiled
    • duplicate warning printed
    • -injected NOT called

but someFiles.m won't have the -injection method called, meanwhile save the appdelegate.m works fine.

I'm thinking if I should modify the iOSInjection.Bundle. But no idea, hope help.

Detect project path

If I was changing a file in subProject, the path returned is subproject's path, not the main porject's path.

And If the subproject's Header Search Path was relative, it would not find the headers. I try to resolve this problem by chainge the code like below:

                    my $realPath = "";
                    while (defined (my $line = <GUNZIP>)) {
                        if (index($line, "cd ") != -1) {
                            $realPath = $line;
                            $realPath =~ s/^\\s+|\\s+$//g;
                        }
                        if ($line =~ m@\(regexp.escaping("\"$"))@o and $line =~ " \(arch())") {
                            # found compile command
                            # may need to extract file list
                            if ($line =~ / -filelist /) {
                                while (defined (my $line2 = <GUNZIP>)) {
                                    if (my($filemap) = $line2 =~ / -output-file-map ([^ \\\\]+(?:\\\\ [^ \\\\]+)*) / ) {
                                        $filemap =~ s/\\\\//g;
                                        my $file_handle = IO::File->new( "< $filemap" )
                                            or die "Could not open filemap '$filemap'";
                                        my $json_text = join'', $file_handle->getlines();
                                        my $json_map = decode_json( $json_text, { utf8  => 1 } );
                                        my $filelist = "/tmp/filelist.txt";
                                        my $swift_sources = join "\n", keys %$json_map;
                                        IO::File->new( "> $filelist" )->print( $swift_sources );
                                        $line =~ s/( -filelist )(\\S+)( )/$1$filelist$3/;
                                        last;
                                    }
                                }
                            }
                            print $realPath." && ";
                            # stop search
                            print $line;
                            exit 0;
                        }
                    }

Simulator stuck InjectionIII

When trying to adjust constraints or adding new UI elements in storyboard the simulator gets stuck.

Any ideas what might cause this or the solution to it?

Resource Copying

First of all I love how useful injection is!

I was wondering if there is a way to extend this project to copy any modified file to the main bundle. I like the idea of reloading xibs and more.

I would be glad to try making the change myself with a pull request but wanted to check in and get pointed in the right direction. Maybe you have tried this and it is intractably hard.

Cheers!
Manny

Error opening input file

Hi, I am using InjectionIII app store version

The GettingStart project work fine in my xcode

but when I use in my project, something seems wrong

the file and directory is exist

*** Compiling /Users/waltcow/Swift/Inner/Classes/Modules/Tweet/ViewController/TweetDetailsViewController.swift ***
*** Re-compilation failed (/Users/waltcow/Library/Containers/com.johnholdsworth.InjectionIII/Data/command.sh)
<unknown>:0: error: error opening input file '/Users/waltcow/Swift/Inner/Classes/Modules/Settings/ViewController/UserNameEditViewController.swift' (No such file or directory)
 ***

Error when Start Injection

I try to Start Injection. But I get the error said that "The operation couldn’t be completed. (CFErrorDomainLaunchd error 4.)"

Error loading

Error loading /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection: dlopen(/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection, 265): Symbol not found: __T0SPyxGs8_PointersWP Referenced from: /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection Expected in: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/libswiftCore.dylib in /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection
I try to set "Symbols Hidden by Default" -> NO;but it dosen't work.

Load bundle fail if serval Xcode exist.

If somebody had serval Xcode in Applications, he will get the error like below:

/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection:  dlopen(/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection, 265): Library not loaded: @rpath/XCTest.framework/XCTest
  Referenced from: /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection
  Reason: image not found

All the Xcode is download through Internet and not from AppStore. At the beginning, I think maybe the problem is the Xcode-GM.app should change it's name to Xcode.app . But I found it doesn't work.

Issue injection xib files

Hey John,

I've been tinkering a bit with injecting xib-files (tinkering is a bit of an overstatement) but I'm stuck when trying to save the xib-file. An exception is thrown with the following error description:

Problem reloading nib: *** -[__NSDictionaryM setObject:forKeyedSubscript:]: key cannot be nil

Anything in particular that I need to configure or set in my xib-file in order to get this working?
The project is an iOS project if that helps narrow it down, so far I've tracked it back to https://github.com/johnno1962/InjectionIII/blob/MAS-version/InjectionBundle/InjectionClient.mm#L212

Unsure what is causing it to throw, any ideas?

Crash in getImplementationForType

My app usually crashes in this method when injecting code. Looks like it is trying to get the class of a non-class pointer and crashes. Any idea of how can I further debug this so I know what the problematic object is?

Using: "Version 1.0 (806)"

libswiftCore.dylib`(anonymous namespace)::getImplementationForType:
    0x10f30c4e0 <+0>:   pushq  %rbp
    0x10f30c4e1 <+1>:   movq   %rsp, %rbp
    0x10f30c4e4 <+4>:   pushq  %r15
    0x10f30c4e6 <+6>:   pushq  %r14
    0x10f30c4e8 <+8>:   pushq  %rbx
    0x10f30c4e9 <+9>:   pushq  %rax
    0x10f30c4ea <+10>:  movq   %rsi, %rbx
    0x10f30c4ed <+13>:  movq   %rdi, %r14
    0x10f30c4f0 <+16>:  movq   (%rbx), %rax
    0x10f30c4f3 <+19>:  xorl   %ecx, %ecx
    0x10f30c4f5 <+21>:  cmpq   $0x7ff, %rax              ; imm = 0x7FF 
    0x10f30c4fb <+27>:  cmoval %ecx, %eax
    0x10f30c4fe <+30>:  cmpl   $0x80, %eax
    0x10f30c503 <+35>:  ja     0x10f30c661               ; <+385>
    0x10f30c509 <+41>:  leaq   0x158(%rip), %rcx         ; <+392>
    0x10f30c510 <+48>:  movslq (%rcx,%rax,4), %rax
    0x10f30c514 <+52>:  addq   %rcx, %rax
    0x10f30c517 <+55>:  jmpq   *%rax
    0x10f30c519 <+57>:  movq   (%rdx), %rdi
    0x10f30c51c <+60>:  callq  0x10f308260               ; swift::_swift_getClass(void const*)
    0x10f30c521 <+65>:  movq   %rax, %rbx
->  0x10f30c524 <+68>:  testb  $0x1, 0x20(%rbx)
    0x10f30c528 <+72>:  jne    0x10f30c53e               ; <+94>
    0x10f30c52a <+74>:  jmp    0x10f30c62c               ; <+332>
    0x10f30c52f <+79>:  nop    
    0x10f30c530 <+80>:  movq   0x8(%rbx), %rbx
(lldb) reg read
General Purpose Registers:
       rax = 0x0000007f92a344a1
       rbx = 0x0000007f92a344a1
       rcx = 0x000000010f30c668  libswiftCore.dylib`(anonymous namespace)::getImplementationForType(swift::TargetMetadata<swift::InProcess> const*, swift::OpaqueValue const*) + 392
       rdx = 0x0000614000261220
       rdi = 0x000061400001a4c1
       rsi = 0x000000010f399fb8  libswiftCore.dylib`InitialAllocationPool + 65336
       rbp = 0x00007ffee8d23ed0
       rsp = 0x00007ffee8d23eb0
        r8 = 0x0000000000000000
        r9 = 0x00000001078e3a78  type metadata for Lana.SliderNavigator
       r10 = 0x0000000107795db6  `direct field offset for SliderNavigator.(containerView in _145D9D0BDC445CFEF171F74A63E81889) : Swift.Optional<__ObjC.UIView> + 102
       r11 = 0x00007f92a40e4f00
       r12 = 0x000000010f399fb8  libswiftCore.dylib`InitialAllocationPool + 65336
       r13 = 0x0000604000834760
       r14 = 0x00007ffee8d23ee0
       r15 = 0x0000614000261220
       rip = 0x000000010f30c524  libswiftCore.dylib`(anonymous namespace)::getImplementationForType(swift::TargetMetadata<swift::InProcess> const*, swift::OpaqueValue const*) + 68
    rflags = 0x0000000000000202
        cs = 0x000000000000002b
        fs = 0x0000000000000000
        gs = 0x0000000000000000

screen shot 2018-07-17 at 11 40 22

One of the two will be used. Which one is undefined.

Error:Class JZOnSiteViewController is implemented in both /Users/Storyer/Library/Developer/CoreSimulator/Devices/73F23592-35D0-4EA8-B0F1-89E90FCC7B31/data/Containers/Bundle/Application/668BD88A-338D-4F01-BB4E-4422BBE4E6D9/fjnuLab.app/fjnuLab (0x10384e2f8) and /tmp/eval3.dylib (0x12dcf4310). One of the two will be used. Which one is undefined.
I can connect injection, then loading /tmp/eval1.dylib. (Ignore any duplicate class warning).But later it have a conflict.I don't know how to fix it.

System Tray colours - what do the different colours indicate?

Hi,

Am using the InjectionX.app, and looked around in the documentation but didn't see anything.

When I ran the QuickStart, the 'blue' colour was showing in the MacOS system tray the entire time.

I then applied Injection to a personal project, and the System Tray colour is orange. I had trouble getting Injection working with my personal project, but after awhile of fighting I got it working. I expected that the System Tray colour would revert back to Blue to indicate all is well but it did not (still orange).

So, just wondering what kind of message the system tray colour is trying to communicate? Orange screenshot included

Thanks

image

Plans for supporting tvOS?

Hey!

It brings me joy to see that this project it still being actively maintained, stellar is the right word for all the effort that you put into this. Anyways... I was gonna try this out in a project and I quickly ran into the issue that there is no tvOS bundle which results in the following message appearing upon app launch:

Error loading /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection:  dlopen(/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection, 265): no suitable image found.  Did find:
	/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection: mach-o, but not built for tvOS simulator

I bet this is not your top priority but I was just wondering if you see this happening on the horizon.

help on Error loading bundle

Using Xcode 10
downloaded Injection here -> johnholdsworth.com/InjectionIII_10.app.zip

I launched your sample app:
but got error:

Error loading /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection:  dlopen(/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection, 265): Library not loaded: @rpath/XCTest.framework/XCTest
  Referenced from: /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection
  Reason: image not found

Xcode 10 - Problem loading bundle

Hey John,

Justed wanted to report a small tidbit that I found when testing Xcode 10.
It seems like the application has issues with loading the bundle when it is located in /Applications.
If I build InjectionIII from source and point to the bundle located in derived data, injection works just like before.

Just a small heads up :)

Re-compilation failed

Some ***.m can Re-compilation succ
but some .m (.m means some of my class)

Log below:
*** Re-compilation failed
xxxxxxxxxx (lots of .h Compiling path )
fatal error: '
.h' file not found
#import "***.h"
^~~~~~~~~~~~~

But when i rebuild all project
xcode can build succ and run succ.

version and language:
Xcode 9.3 object-c

Trouble using the latest class for injection

Hey @johnno1962, I'm seeing some odd behavior when it comes to injecting a view in my application.
If I make a bunch of changes to a view and save, it looks like it jumps back and forwards between the old and the new version when saving. The console prints this message:

Loading /tmp/eval8.dylib. (Ignore any duplicate class warning)
objc[13219]: Class _TtC6APPNAME16HomeFeaturedView is implemented in both /Users/USERNAME/Library/Developer/CoreSimulator/Devices/A6B93370-670E-4F91-8872-86ED8976EB8C/data/Containers/Bundle/Application/43F0E90E-D203-424D-8B52-F81EF5436815/APPNAME/APPNAME (0x101350a90) and /tmp/eval8.dylib (0x127792680). One of the two will be used. Which one is undefined.

This is only a guess on my part but it seems like it cannot determine which of the class is the newest one, hence me getting variable results with what I see when the view (cell in this case) is being reloaded.

Any ideas on what could be the issue here?

Xcode9.4.1,swift4.1, there is no effect

Hello, I added the following code in the project
AppDelegate.swift
#if DEBUG
Bundle(path: "/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle")?.load()
#endif
ViewController.swift
func injected() {
viewDidLoad()
}
Execute "CTRL" +"=" without any response. But I have no problem in the OC project. Could you give me some advice?

Request: Bring back Ctrl+^

Any chance of bringing back the original Ctrl+^ behavior instead of only using the file watcher?

I find the file watcher results in my app crashing in the simulator every time I touch a storyboard, change something in git, or build for my device. Not to mention that I sometimes save while thinking, not only when I'm ready to see my changes.

Building everything is fine (if memory serves, originally it only worked within the same file?), but I would like to do it at a moment of my own choosing.

I'm using the Xcode 10 version.

injection make xcode stuck

when I open injection, the xocde will stuck for a period of time. I had remove the code of file watcher, but it didn't work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.