简体   繁体   中英

Error invalid architecture 'arm' when app from command line + iOS

I want to build an iOS app from command line with iOS simulator.

The build settings are:
1. Architectures - armv7
2. Base SDK - Latest IOS(6.1)
3. Build Active Architecture only - yes
4. Valid architectures - armv7 (also tried adding i386)
5. IOS deployment target - IOS 4.3

I am executing the following command:

xcodebuild -target splistapp2 -sdk iphonesimulator6.1 -configuration Release (also tried with  -arch "i836")

But this command gives following error:

invalid architecture 'arm' for deployment target '-mios-simulator-version-min=4.2'

What could be the problem?

In case anyone running into the same annoying problem again, I will share my script here: Remember to run this command under the directory that has the xcodeproj file.

xcodebuild \
-project "full-path-to-your-xcodeproj-file" \
-target YOUR_TARGET \
-sdk iphonesimulator6.1 \
-arch i386 \
-configuration Debug \
VALID_ARCHS="armv6 armv7 i386" \
ONLY_ACTIVE_ARCH=NO \
TARGETED_DEVICE_FAMILY="1" \
clean install

I modified the TARGETED_DEVICE_FAMILY because I only build for iPhone. If you want to build for both iPhone and iPad, delete this line or replace with TARGETED_DEVICE_FAMILY="1, 2".

The device uses ARM; while the simulator uses i386. Pick one or the other:

  • iphonesimulator6.1 and arch i386
  • iphoneos and arch armv7 (or armv7s)

Implement using arch1386 architecture.

xcodebuild -project splistapp2 -target TEST_TARGET -sdk iphonesimulator -configuration "Debug" -arch i386

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