A man has been arrested for shooting at a North Miami Beach Police officer as he sat in his cruiser, officials say.