Add field to all custom post types

You can’t use the add_meta_box() function with an array of post types unfortunately although it would be a good core contribution.

The way to do this at the moment is to get an array of your post types and loop over them calling your add_meta_box() line for each one eg:

foreach( get_post_types() as $type ) {
    add_meta_box( $id, $title, $callback, $type, $context, $priority, $callback_args );
}

You can filter the specific post types you get back if you need more control by passing an array into get_post_types() with the post type criteria you want to match eg. 'public' => true.