简体   繁体   中英

Xamarin.iOS linker removing i386 for adhoc

Does Xamarin.iOS do this when building for AdHoc/AppStore? I am binding to a lot of static/fat libraries that have architectures that support the simulator. Are the unused architectures stripped for AdHoc/AppStore?

Short Answer: Yes

Long Answer:

While Xamarin's linker is a managed linker (and only works on managed code) the extra architectures are removed from the final executable binary. That's true for i386 but it's also true for remove ARMv6 (from libraries) for an ARMv7-only executable.

Also since you're including a lot of bindings then you might want to:

  • Enable the managed linker on the binding .dll. That will remove unused code from the .dll and it will also optimize the bindings. You can do so easily by adding the [LinkerSafe] attribute in your binding projects; and

  • Enable the new static registrar and include SmartLink=true in your [LinkWith] attribute. That enable the native linker to do a better job to remove native code (which is made even easier if unused code was removed from the binding .dll).

Both options can reduce your final application size. You can watch my Evolve 2013 talk on Advanced iOS Build mechanics for more details on them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM