johnno1962 / injectionforxcode

Runtime Code Injection for Objective-C & Swift
MIT License
6.55k stars 565 forks source link

AppCode main.m patch has IP address that may change #141

Open lyahdav opened 8 years ago

lyahdav commented 8 years ago

When you patch your main.m via the Injection AppCode menu item, it adds your machine's current IP address as a constant. Any reason it doesn't set this to something like "0.0.0.0" which will always work? Most machines these days have a dynamic IP address, so won't this cause issues when you get a new IP?

joedaniels29 commented 8 years ago

+1. I dont suppose setting the ip to a non address would work, but on every injection, we can calculate which files change, why can't we calculate the IP address change with ifconfig and set it as an env. variable?

lyahdav commented 7 years ago

I now always set this to 127.0.0.1 and it never have to change it. Seems like that should always work.

johnno1962 commented 7 years ago

This will work in the simulator but it doesn’t matter anyways as the code detects a build on the simulator and uses 127.0.0.1 internally.