Unable to build for iOS simulator

477 views
Skip to first unread message

Avery

unread,
Sep 23, 2017, 10:28:48 AM9/23/17
to Chromium-dev
I followed the instructions at https://chromium.googlesource.com/chromium/src/+/master/docs/ios/build_instructions.md to build for iOS simulator, but when i run the XCode project and try to build `sources`, it gives an error "target specifies product type 'com.apple.product-type.tool', but there's no such product type for the 'iphonesimulator' platform".

If i build for `All`, no error is shown but it doesn't start my simulator (and load the app into it).

If i build with `ninja`, how do i get the app to appear in my iphone simulator?

Andrei Kapishnikov

unread,
Sep 23, 2017, 11:14:01 AM9/23/17
to wer...@gmail.com, Chromium-dev
Please select the specific target that you want to build and run in the drop-down list in the Xcode UI. I assume the target should be named "chromium" or similar. Targets "All" & "sources" may not work.

If you build with ninja, you can install the app on a simulator by executing:

out/Debug-iphonesimulator/iossim out/Debug-iphonesimulator/Chromium.app



--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/533b8d8c-0dbc-4933-8e62-31007847de81%40chromium.org.

Sylvain Defresne

unread,
Sep 25, 2017, 5:03:29 AM9/25/17
to wer...@gmail.com, Chromium-dev
The "sources" target cannot be run or built. It is there just to allow indexing of the source files by Xcode (to provide completion, just to source, ...).

The "All" target can be built, but not run as it build all the application (main application and all the tests) so there is no canonical target to run (this correspond to running ninja without a target).

If you want to build and run a target in Xcode, then you should first select the target you want to build/run, and then run it using cmd+R or the run button. This will work for the main target (chrome) and most of the tests targets (*_unittests, *_perf_tests, ...) except EarlGrey tests (*_egtests). For the EarlGrey tests, you need to use cmd+U or the test command (or long press the run button and select test). This is because EarlGrey tests are XCTests while the others are not.

To run the application from the command-line on the simulator, you can use iossim as Andrei pointed. Note that again, the command is more complex for EarlGrey tests (for the same reason). The command to run the EarlGrey tests is documented in the page you linked.

Hope this helps,
-- Sylvain


--
Reply all
Reply to author
Forward
0 new messages